The portmanteau picture has been long been a convenient way to allow a multitude of directors to discuss a range of issues without going into exhaustive detail. However, the format has also been exploited by single film-makers since the Expressionist era, when Fritz Lang's Destiny (1921) and Paul Leni's Waxworks (1924) first linked the anthology with the horror genre. Although the multi-story picture is nowhere near as popular as it was in the 1960s, it continues to entice talents like Paolo and Vittorio Taviani, who recently followed in the footsteps of Pier Paolo Pasolini with Wondrous Boccaccio, which used a 14th-century plague in Florence as the starting point for a series of tales taken from The Decameron.

But the most ambitious portmanteau project has to be the trilogy fashioned by the Portuguese critic-turned-director Miguel Gomes, which is now available as a boxed set. Revisiting themes explored in

Our Beloved Month of August (2008) and Tabu (2012), this 382-minute analysis of recessional Portugal comes with an on-screen index to guide viewers through this recklessly ambitious analysis of the state of pre-Brexit Europe.

The prologue to Arabian Nights Volume 1: The Restless One begins in the north of the country, where 600 workers stand to lose their job at the Viana do Castelo shipyard. Over a montage of images from the yards heyday, those who have been laid off share their memories and complain about the mismanagement that has sounded the death knell of a proud tradition. Intercut with these lamentations is a snippet about a local beekeeper, whose hives are under threat from a strain of Asian wasp. The message is clear (and is one that British steel workers will recognise) and is reinforced by the revelation that some fire brigades have stopped attending certain types of blaze, as they no longer have the equipment or the trained personnel to do so without excessive risk.

Back at Viana do Castelo, violence erupts as strike breakers are sent into the yard and director Miguel Gomes (who is covering the stand-off) begins to doubt his ability to do justice to what he is witnessing. He makes an excuse to leave his crew and tries to run away, protesting that he feels impotent and foolish and is suffering from a vertigo brought on by abstraction. However, they catch up with him and declare that he deserves execution for such scurrilous dereliction of duty. But Gomes pleads for leniency and promises to amuse everyone with an array of anecdotes.

He decides to delegate the responsibility, however, and the scene shifts to the Island of Young Virgins in Baghdad, where Scheherazade (Crista Alfaiate) awaits to regale the audience with `The Men With Hard-Ons', which opens with delegates representing the Troika of the European Commission, the International Monetary Fund and the European Central Bank arriving on camels to urge Portuguese dignitaries to make swingeing budget cuts in order to keep the economy afloat.

Interpreter Carloto Cotta bizarrely translates the discussions into Brazilian Portuguese and struggles to understand French-speaking African wizard Basirou Diallo, when he interrupts proceedings after lunch to announce that each man has been rendered impotent and that he can cure them with his patented aerosol spray. The politicians and financiers are thrilled with their new virility and the Troika delegates grant concessions that allows the Portuguese to accept their ruinous terms. However, they soon come to realise that a permanent erection has its disadvantages.

The mood is similarly playful, but markedly less focused in `The Story of the Cockerel and the Fire', which is based on the experiences of Fernanda Loureiro. The action takes place in the wine-growing community of Resende and begins with a judge putting a rooster on trial for crowing too early in the morning. The bird protests that it is merely warning the residents of the dangers to come and decides to stand in the forthcoming mayoral election. Meanwhile, a young girl becomes increasingly frustrated when her boyfriend becomes involved in a texting relationship with a female fire fighter. In order to keep her rival busy, she starts setting fires across the surrounding countryside.

A sombre tone also informs `The Swim of the Magnificents', which sees mayor Adriano Luz enlist the help of punk Crista Alfaiate to organise the annual New Year swim in the sea. However, the carcass of a dead whale washes up on the shore and Luz has to find a way to remove it so that the festivities can go ahead. As he ponders, a trade union official interviews two men and a couple about their struggle to survive at a time of high unemployment. But the immediate crisis is averted when the whale suddenly explodes and the locals brace the waters to uphold their tradition.

Similar signs and symbols (which will be much more familiar to Lusophonic audiences) abound throughout this challenging, but always accessible feature. But even those who fail to spot the references to totems like the fabled Rooster of Barcelos will still leave the screening with plenty to think about. Gomes may be happy making allusions to pictures like Wim Wenders's Lisbon Story (1994) - in which Rüdiger Vogler plays another director having trouble with his film - but he never looks as comfortable taking a self-reflexive role as Pasolini and Jean-Luc Godard have been before him. He and co-scenarists Mariana Ricardo and Telmo Churro also have problems incorporating all of the disparate strands, with the threads about some Austrian schoolchildren and a Chinese emperor feeling particularly extraneous. Gomes also skirts serious statements about authorship and the subversion of linear narrativity, while largely settling for being dryly amusing rather than bitingly satirical or overtly political. But, in basing his vignettes on real life, he does succeed in presenting an intriguing snapshot of a country at the crossroads.

He also displays the passion for cinema and an eye for a telling image that characterised his earlier work. There is something a little archly cineastic about hiring Apichatpong Weerasethakul's regular cinematographer Sayombhu Mukdeeprom, as little of his personality appears to pervade the mostly restrained 16mm and 35mm widescreen visuals that owe much to the ingenuity of production designer Artur Pinheiro and the acuity of Gomes, Churro and fellow editor Pedro Filipe Marques. The performances are fine, if a touch anonymous alongside the more heartfelt contributions of the non-professional cast. But few who check out this brazenly ambitious epic will want to miss the ensuing instalments.

Gomes dispenses with the elaborate framing devices and plunges into the heart of the action in Arabian Nights Volume 2: The Desolate One. Once again, Scheherazade (Crista Alfaiate) relates the bitingly ironic fables from the Island of Virgins. But Gomes avoids distractions and digressions in fashioning another triptych that will reward those prepared to look for the universal truth beneath the Lusospheric specifics.

The clumsily titled `Chronicle of the Escape of Simão "Without Bowels"' starts with a shot of a police drone hovering over the scrubland outside a small hillside town. Suddenly, Chico Chapas appears. He is a scrawny man of advanced years, who has earned his nickname because he can eat what he likes and never put on an ounce of weight. However, he has just killed his wife and daughter, along with two other women, and is on the run from the police.

As he lays low, Chapas allows his mind to wander and he fantasises about lavish banquets with partridges and prostitutes. But Scheherazade refuses to judge him, as in times of economic privation, `evil is only a severe tendency of selfishness'. None of his neighbours seem to blame Chapas for his crime and he becomes something of a folk hero over the ensuing six weeks for giving 160 armed policemen the run around. Children play nearby as he stops for a smoke, while the grown-ups would rather side with a killer than the hypocrites who rule over them. Hence, they say nothing when Chapas sleeps in their barns or steals clothing from their scarecrows.

Even Gomes also takes pity on the fugitive, by suggesting that it appears to be easier to survive on the lam than it is making ends meet on meagre wages or benefits. But Chapas is eventually apprehended and bundled into the back of a police car. As he is driven through the town, however, the residents applaud him for his act of defiance and for exposing the incompetence of the authorities (which is further mocked by the fact that the leader of a troop of scouts plummets to his death while guiding his charges through a team-building exercise).

The legal system comes in for more ribbing in `The Tears of the Judge', which centres on magistrate Luisa Cruz, who leaves to hear a case in an open-air courtroom after congratulating daughter Joana de Verona on losing her virginity to a man of her mother's choosing. On trial is a woman who has been accused of stealing her landlord's furniture. She explains that she sold the items to pay compensation to her daughter-in-law, who has to put up with her husband's voracious sexual appetite.

A witness informs Cruz that the landlord is something of a dolt and has a habit of phoning the emergency services at all hours of the day and night because he likes to hear the sirens as they pass. The man admits his guilt, but protests that he was only acting on the instructions of a genie. As if by magic, he is brought into court and pleads that he was solely following the orders of the wicked fellow who confined him to a lamp. But, just as Cruz thinks things cannot get any stranger, successive witnesses bring to her attention the theft of 13 cows and a racket to import Chinese mail-order brides. When Cruz complains that it is impossible to discern who is telling the truth, a man wielding a machete presents himself and insists that he is a lie detector.

Nonplussed by the escalating insanity of the testimony, Cruz despairs of ever finding a just resolution to a case in which everyone involved seems to have wronged or offended someone else. She opines that `tears are contagious' and laments that there simply aren't enough prisons to hold the culprits holding society to ransom. Having adjourned proceedings without reaching a verdict, Cruz goes home to her deflowered daughter. She is relieved to get away from the florid speeches and bizarre revelations. But, most of all, she is glad to escape the ordinary people who seem to be as responsible for their own misfortunes as the system the rail against. Yet, Gomes still notes that the Chinese consular official confides that his client had given Portugal a recommendation on TripAdvisor.

If this vignette becomes impossibly convoluted, `The Owners of Dixie' has a structural intricacy to match its narrative elaboration. Dixie is a stray cross between a Maltese terrier and a poodle, who is taken in by Margarida Carpinteiro when it starts mooching around a rundown tenement building. She quickly passes the dog on to the depressive Teresa Madruga, who shares her flat with her agoraphobic partner, João Pedro Bénard.

They have befriended reformed drug addicts Gonçalo Waddington and Joana de Verona, and persuade them to keep an eye on Dixie while they go away for a few days. However, the bodies of Madruga and Bénard are found 16 days later and it is confirmed that they were victims of a suicide pact. Waddington and Verona have enough problems without worrying about a dog. So they hand her over to the building supervisor, who gives Dixie to her daughter-in-law and she becomes an immediate favourite of her children, who give her the affection she has craved all along.

All of life seems to teem around this shabby neighbourhood. When they are not arguing about money, queuing at food banks or facing eviction, the residents are having noisy sex in full view of the local kids, who spy on they through a hole in the wall. They also peek at nude sunbathers between their games. But this is a community in which people muddle through. The lift has been broken for some time since its mechanism was damaged by urinating party revellers. Yet no one complains or makes inquiries about getting it repaired. They simply use the stairs and get on with their lives.

Fainy echoes of Robert Bresson's Au hasard Balthazar (1966) can be detected in this closing segment, as Gomes muses on the enduring struggle of the lower classes and the way in which people treat animals that only require a little respect in return for undying loyalty. The appearance of a ghost dog seems to add a little post-colonial acidity to the mix, although each episode contains references to the casual racism of Portuguese society, as well as the other reasons for its malaise.

Once again strikingly photographed by Thai maestro Sayombhu Mukdeeprom, this is by far the most freewheeling entry in the series. Yet, while a vein of wry humour marbles proceedings, Gomes does not shy away from either tragic incident or trenchant analysis. Nor does he flinch from apportioning blame in denouncing the austerity measures that have placed the heaviest burden on those least fitted to shouldering it. But he also finds reasons to be optimistic in the indomitable spirit of those in the margins or on and below the lower rung.

After such an epic journey, many will expect Gomes to make a grand pronouncement on the state of the world at the end of Arabian Nights Volume 3: The Enchanted One. But he proves as mischievously elusive as he has been in the previous instalments and settles instead for showing that life goes on, whether one inhabits an exotic realm or a working-class Lisbon neighbourhood in the depths of the worst recession for 80 years. Moreover, Gomes suggests that the line between fact and fiction is very narrow and forever shifting, with the consequence that people with little left to lose are finding it increasingly difficult to discern between fantasy and reality.

Back in the Antiquity of Time, Scheherazade (Crista Alfaiate) continues to tell stories to her tyrannical husband, King Shahryar (Amar Bounacharda) in the hope of delaying her inevitable execution. She has spent 500 days devising new fables to distract and delight and her Grand Vizier father (Américo Silva) is concerned that she is running out of inspiration. As she constantly reminds him of his much-missed wife, he longs to free his daughter from her ordeal, but dares not confront Shahryar, whose growing restlessness convinces Scheherazade that her time is running out.

She takes an excursion to the old quarter of Baghdad and meets a variety of eccentrics and lowlifes. A diver named Lionel (Lionel Franc) worships her from a distance, while a break-dancing thief (Elvis Barrientos) tries to entice her before he takes up with Beatriz (also Alfaiate), a married noblewoman whose husband pays the ultimate price for interfering in her affairs. Scheherazade also encounters a genie of the wind (Hervés Diasnas) and a tousle-haired blonde Adonis called Paddleman (Carloto Cotta), who reveals that he has fathered over 200 children. He offers to impregnate Scheherazade, but she dismisses him as a fool and tosses away the rare fragrant flower he had given her.

Returning to the palace,

Scheherazade embarks upon her next story, `The Inebriated Chorus of the Chaffinches'. This is essentially a documentary interlude that ventures into some of the capital's less salubrious neighbourhoods to meet the impoverished Lisboans who trap and train songbirds to exhibit in prestigious competitions. Known as `vinkensport', this pastime was imported from Belgium at the end of the Great War and actors Chico Chapas and Gonçalo Waddington mix with non-professionals to show how nets are used to catch finches who are kept in covered cages and whose song is passed down through the generations until it is heard no more.

Gomes briefly interrupts his investigation (which relies heavily on explanatory captions) with a potted history of postwar Portugal and a treatise on the state of public housing in Lisbon. He also includes a final fable, `Hot Forest', which centres on the relationship between a vinkenier and a Chinese student (Jing Jing Guo). She gets pregnant, but is abandoned after opting to have an abortion. Distracted from her studies, she becomes a live-in companion to an elderly lady. However, when she perishes in a fire, the girl decides the fates are against her and she returns to Beijing.

Leaving Scheherazade to her destiny on the 515th night, Gomes ends the picture by having Chapas free a wind genie who has become ensnared in a chaffinch net. But those who have been paying attention will know that Gomes has little faith in such easy escapes and leaves the audience to lament that the gap between the utopia we wish to inhabit and the grim reality we have created for ourselves (or, rather, allowed others to impose upon us) is getting wider with each passing day and no amount of exotic yarn-spinning is going to make a ha'porth of difference.

Although Gomes reveals debts here to Manoel de Oliveira and Chris Marker, the biggest influence on this concluding episode is undoubtedly Pier Paolo Pasolini, who produced his own version of The 1001 Nights in the `trilogy of life' that was composed of The Decameron (1971), The Canterbury Tales (1972) and Arabian Nights (1974). However, it is also worth noting that Catalan film-maker Marc Recha also based Little Indi (2009) on a 17 year-old youth from the rundown Barcelona suburb of Valbona who devotes himself to the cherished goldfinch he hopes will win enough prize money to help his impecunious family.

Despite the gloriously stylised Orientalism of the Baghdad segments - which boast splendid pastiche costumes by Silvia Grabowski and Lucha d'Orey and lavish Bruno Duarte and Artur Pinheiro interiors that Thai cinematographer Sayombhu Mukdeeprom ensures clash anachronistically with modern settings visible on the horizon - this challenging climax to an epic achievement often comes closer in tone to the actuality aspects of the first film's real-world prelude. Gomes reminds us that stories emanate from people's fears and desires and help them survive the trials of daily life. But he also seems to suggest that we can only help ourselves (whether we are telling tales to avoid execution, training songbirds or reacting to personal tragedies), as we can expect little assistance from neighbours as enmired as we are and nothing at all from those above us in the social strata, as they are too busy looking up to notice what is going on below them.

As before, Gomes reins in his anger to appear optimistic in the face of quiet despair and there is something deliciously quirky about his decision to include on the soundtrack the cover version of Klaatu's `Calling Occupants of Interplanetary Craft' by the children of the Langley Music School Project. But, while some may be frustrated by the open-endedness of Gomes's approach at the end of such a mammoth undertaking, this peerless triptych acknowledges the failings of the past and rails against the austerity of the present in the hope that Portugal and its people can eventually look forward to a brighter future - Brexit permitting, of course.