text:
Rest in Peace, Sean Connery
Sean Connery (1930-2020)
Posted by D.M. Anderson at 8:43 AM No comments:
The Real Villains of JAWS
JAWS (1975)
Starring Roy Scheider, Robert Shaw, Richard Dreyfuss, Murray Hamilton, Lorraine Gary. Directed by Steven Spielberg. (124 min)
Essay by D.M. ANDERSON💀
Four-and-a-half decades after it first scared the living shit out of me - tossing my popcorn at the sudden appearance of Ben Gardner's eyeless head - Jaws remains my favorite film. I saw it at least a half-dozen times in a theater and have long-since lost count of how often I've revisited the film over the years.
Even though I practically know the movie by heart - every scene, every line of dialogue - it never gets boring and I still discover some aspect I never noticed before. For example, in the classic scene where Quint (Robert Shaw) and Hooper (Richard Dreyfuss) are comparing scars, there's a brief shot of Chief Brody (Roy Scheider) starting to lift his shirt to share a scar of his own, but then changes his mind. Since he was a New York City cop just before moving his family to comparatively quiet Amity Island, his somber, self-conscious expression suggests the scar might be the result of a bullet wound.
Or hell, maybe he just had his appendix removed. My point is there's always been more to Jaws than a ravenous shark. Thematically rich and allegorical, it's also a film with many subtle, understated moments.
You know, just writing about Jaws makes me wanna pop the movie into my player and watch it again.
Two hours and four minutes later…
Once again, I discovered something new about Jaws, but this time it changes my whole perspective. It's still the greatest film ever, but now I find myself asking who the real villain really is.
At one point, Hooper and Brody discuss the theory of 'territoriality,' in which a shark will remain in an area where the feeding is good. So really, all the good citizens of Amity have to do is stay the fuck out of the water for a few days and the shark will move on. But with the Fourth of July coming, Mayor Vaughn refuses to close the beaches. That, however, doesn't make him the villain, just another dumbfuck politician in denial (and probably a Republican).
"Om-nom-nom!" said Jaws.
And what about Mrs. Kintner, the grieving mother who puts a $3000 bounty on the shark after it gobbles down her boy? Sure, Alex's death is tragic, but it ain't like the shark leaped onto the beach and snatched him away. Alex was in his house. That's like putting a cheeseburger in the backyard and getting pissed at your dog for having the audacity to eat it. Her actions instigate total chaos as hundreds of fishermen recklessly crowd the waters hoping to cash-in. They end up killing the wrong shark, which was probably just passing by - from Southern waters, according to Hooper - and minding its own business.
What's really sad is this type of wanton fuckery happens in real life. When celebrity zoologist Steve Irwin was killed by a Stingray, some misguided Aussies retaliated by going out-to-sea and slaughtering dozens of the poor animals that were somehow complicit in an aquatic conspiracy.
But even Mrs. Kintner isn't the biggest villain in Jaws. That honor, I'm sad to say, goes to Chief Brody (with Matt Hooper as his able accomplice). I wouldn't include Quint among them because he's a fisherman by trade and basically a hired gun. Throw in a heaping helping of PTSD - due to his previous shark encounter during the ill-fated U.S.S. Indianapolis mission - and we at least understand his Ahab-like obsession.
Say hello to the bad guy.
After the attack and panic on the Fourth of July, Brody has nothing to gain by killing the shark. Financially, Amity's summer is over - Brody even says as much - because only the dumbest of fucks would dare go into the same water where three people have already been torn to pieces. With no more swimmers to snack on, the shark would probably be gone in a day or two. Instead, Brody hires Quint's boat so the three of them can hunt and kill it, which is essentially the same as a home invasion.
Imagine having your groceries delivered to your home. Then a few days later, the same grocer breaks in and tries to kill you for eating the food. Ultimately, the protagonists in Jaws are seeking revenge for incidents they instigated, just like the United Citizen Federation's war on bugs in Starship Troopers.
Nobody watches Death Wish to cheer-on the three sadistic thugs who break into Paul Kersey's apartment, rape his daughter and murder his wife. So why do I still snarl "Smile, you son-of-a-bitch" right along with Brody every time I watch him blow the shark to smithereens?
Perhaps the fact that we side with the bad guys is a testament to Jaws' greatness. It's a film so well-written, perfectly assembled and impeccably acted that we're effortlessly manipulated into thinking the three main characters are heroes, especially since they're so endearing and likable. And like cinema's greatest antagonists, they don't see themselves as villains at all.
Neither did I until now. It still doesn't change my opinion of the film itself. Jaws is as great today as it was in 1975. Of course, we now know that sharks are not mindless eating-machines, but back then, the film unfortunately played a big part in vilifying them as such, to the point where great white sharks have become a vulnerable species. Because of this, original Jaws author Peter Benchley has-since expressed regret over writing the novel. Even so, I'm still able to block out all that baggage and enjoy Jaws for what it is: brilliant, visceral entertainment that feels new every time I see it. Only a perfect film can do that.
Though part of me might be pulling for the shark from now on.
Posted by D.M. Anderson at 11:11 PM No comments:
RYUICHI SAKAMOTO: CODA: The Life of a Legend
RYUICHI SAKAMOTO: CODA (Blu-ray Review)
2017 / 101 min
From KINO LORBER
Review by Fluffy the Fearless😽
If the name doesn't immediately ring a bell, some of his music might. On this side of the Pacific, Ryuichi Sakamoto is best known for his scores in such films as Merry Christmas Mr. Lawrence, The Last Emperor (for which he won an Oscar) and most recently, The Revenant.
But in Japan, he's been a prominent musician & composer for decades, both as a solo artist and with the synthpop band, Yellow Magic Orchestra. Much older now and a recent cancer survivor, Ryuichi has recommitted himself to exploring unique ways to make music. Aside from his career, he remains an outspoken anti-nuclear activist.
Despite it's slightly ominous title, Coda provides an interesting look at his post-recovery career, such as an ongoing quest for bizarre new sounds, infusing nature into his music and performing a concert using a battered piano recovered from the ruins of the 2011 Tsunami. The film also delves into his early days as a pop star, which segued into an impressive career as a film composer (and sometimes actor). For movie fans, his anecdotes of working for the likes of Bernardo Bertolucci and Alejandro Iñárritu will be the most interesting part of the film.
"Do I know 'Balls to the Wall'? Dude, I wrote 'Balls to the Wall'."
Not that the rest is dull. While his music outside of film scores is definitely an acquired taste, Sakamoto's creative process is fascinating, using samples, walls of computers and synthesizers to shape his unusual compositions. He also speaks at-length about issues important to him and which occasionally influence his music. A live performance of one of his darkest pieces - featuring soundbites from J. Robert Oppenheimer (father of the atomic bomb') - is a prime example.
Aside from his cancer battle, Sakamoto remains mostly guarded about his personal life, which seems to be consumed by music, anyway. Throughout the film, he's charming, humble and obviously grateful to be alive. We also get the impression he treats each new composition like it could possibly be his last. Here's hoping this film (and the accompanying concert) isn't his coda.
"RYUICHI SAKAMOTO: ASYNC AT THE PARK AVENUE ARMORY" - A concert in support of his most recent album, async. Some of this music might redefine avant garde for you, making The Residents sound like Michael Buble.
PURR-R-R...LIKE A GOOD SCRATCH BEHIND THE EARS.
Posted by D.M. Anderson at 9:23 PM No comments:
Nostalgia & Irony in THE LAST BLOCKBUSTER
THE LAST BLOCKBUSTER (Blu-ray Review)
2020 / 88 min
From POPMOTION PICTURES
Review by Fluffy the Fearless😹
It's with no small amount of irony that the corporate monster which essentially wiped-out the mom & pop video store is now on the brink of similar extinction. What was once a 9,000 store franchise has dwindled down to just one, located in the small town of Bend, Oregon (my neck of the woods, by the way).
What's doubly ironic is, even though Blockbuster homogenized home video and played a huge role in killing drive-in theaters, what I mostly felt while watching this film was warm, longing nostalgia. After all, Blockbuster was an indelible brand name and changed the way we watched movies at home, whether we wanted it to or not. For an entire generation of movie lovers, it was a big part of their childhood, the way drive-ins were part of mine.
But the biggest irony, as The Last Blockbuster joyously shows, is that the lone remaining store has become world famous, not only for putting the name back in the spotlight, but essentially becoming the very mom & pop video store Blockbuster all-but-killed decades earlier. It's managed by Sandi Harding, who tirelessly keeps the place stocked and running with the help of her large family, all of whom have worked there at one point or another (and many who still do).
Interspersed throughout her daily routine are testimonials from others in the community, as well as interviews with various familiar faces who grew up in the age of VHS, when Blockbuster was a big part of their lives. Most have charming anecdotes, while a few comedians' attempts to be funny fall flat (such as Doug Benson's overlong, laugh-free tour of the store).
"The Godfather? Never heard of it."
Concurrently, the film also chronicles the franchise's rise, mercilessly pushing-out competitors in every neighborhood they invaded (at one point, opening a new store every 17 days). Equally fascinating is Blockbuster's slow, agonizing fall, not just because of changing technology and succumbing to up-&-comers like Netflix, but a plethora of poor corporate decisions. It's also clear not everybody mourns its downfall as much as those still clinging to their membership cards.
The film even manages to create a fair amount of suspense. The Hardings don't own the Blockbuster name and must appeal to parent company Dish Network every year in order to remain in business. Despite all the media attention, community support and becoming a tourist attraction, the store's long-term future is always uncertain, which we see as Sandi anxiously awaits a return call from corporate headquarters.
So while The Last Blockbuster maintains a feel-good vibe, there's a dash of poignancy beneath the surface. Informative, congenial, funny and surprisingly affecting, the film is most-highly recommended for anyone nostalgic for the weekends when they walked out of their local Blockbuster with an armload of tapes or discs. And if you happen to live in Bend, Oregon, you know what your next rental should be.
FEATURETTES - "Eddie Brandt's Saturday Matinee" (short feature about a famous LA video store); "More with Kevin Smith" (extended interview); "Talkin' Movies with David McAbee"; "JC from Scum & Villainy" (interview with the owner of a Star Wars themed bar); "Our Chat with Coach Pete" (he's a local Bend DJ); "MTV's Matt Pinfield" (interview); "Ska-Punk Show at a Blockbuster" (featurette about a 'concert' performed at a soon-to-be-closed LA store).
MUSIC VIDEOS - Andres' "The Last Blockbuster"; Wordburglar's "Rental Patient" (both songs are actually pretty insufferable)
DVD COPY
MEE-OW! LIKE BEING UNLEASHED IN A BIRD SANCTUARY.
BLUE RIDGE: Murder in the Mountains
BLUE RIDGE (DVD Review)
From IMAGICOMM ENTERTAINMENT
From by Tiger the Terrible😼
The title suggests a western, and in spirit, I suppose it is. However, Blue Ridge is mostly a backwoods murder mystery that plays like a pilot for a potential TV series, though I have no idea if one's actually on the pipeline. If so, I've seen worse.
Johnathon Schaech is Justin Wise, a former Green Beret and the new sheriff of Blue Ridge, one of those tiny Appalachian towns where everybody knows everybody. He took the job so he could be closer to estranged wife Elli (Sarah Lancaster) and spunky daughter Maddie (Taegen Burns). Their relationship is the least interesting aspect of the entire film and never really figures into the plot, in which a woman is found murdered.
The victim is Vivian McGrath, who managed to piss off the entire town with plans to build condos on the land she and husband Lem swindled from her father, Cliff (Graham Greene). So naturally, he's a suspect. However, Cliff thinks Jeremiah Wade (Tom Proctor) killed her, part of a decades-old feud between the two clans over ownership of the land. We're made to suspect several characters throughout the story, sometimes because they simply act suspicious.
"Are you finished?"
When focused on the investigation, Blue Ridge is fairly engaging, briskly moving from A to B with workmanlike efficiency, though some of the story's red herrings are a little ham-fisted. Schaech makes a likably stoic protagonist, while Greene & Proctor are an entertaining pair of redneck rivals. The other characters are merely perfunctory, or in Deputy Thompson's case, distractingly goofy...like a 21st Century Barney Fife.
With a final showdown that suggests some inspiration from classic westerns, Blue Ridge isn't particularly memorable, but works in the moment. It's got a pretty decent story and a main character that seems groomed for weekly television. But even if that ain't in the cards, the film is an enjoyable enough time killer.
4 BEHIND-THE-SCENES FEATURETTES - Running one to three minutes each.
DIGITAL CODE
NOT BAD. LIKE CAT CHOW.
THE POOP SCOOP: Trains, Toys & Towers
SNOWPIERCER: THE COMPLETE FIRST SEASON on Blu-ray & DVD 1/21/21
Attention all passengers - the revolution is coming! Get ready for more secrets, plot twists, and reveals as Warner Bros Home Entertainment takes you on an epic journey with the release of "Snowpiercer: The Complete First Season" on Blu-ray and DVD on January 26, 2021. Strap yourself in for an exhilarating ride with all 10 episodes from the first season, plus enjoy the captivating extra features, behind-the-scenes interviews, featurettes, and more! Set more than seven years after the world has become a frozen wasteland, "Snowpiercer" centers on the remnants of humanity who inhabit a perpetually moving train, with 1001 cars, that circles the globe. Class warfare, social injustice and the politics of survival play out in this riveting television adaptation.
THE HOBBIT Trilogy and THE LORD OF THE RINGS Trilogy arrive on 4K UHD 12/1
From New Line Cinema and Metro-Goldwyn-Mayer Pictures, the two epic trilogies include the theatrical and extended versions of the six films in 4K UHD with HDR. The Hobbit Trilogy includes The Hobbit: An Unexpected Journey, The Hobbit: The Desolation of Smaug, and The Hobbit: The Battle of the Five Armies. The Lord of the Rings Trilogy includes The Lord of the Rings: The Fellowship of the Ring, The Lord of the Rings: The Two Towers, and The Lord of the Rings: The Return of the King, which won Academy Awards® for Best Picture, Best Director, and Best Adapted Screenplay. Both trilogies will also include Digital copies of both versions of each film.
In addition, it was also announced that a 4K UHD "Middle-earth" Ultimate Collectors' Edition featuring the theatrical and extended versions of all six films, along with new bonus content, previously released Blu-ray discs of The Hobbit Trilogy, and remastered Blu-ray discs of The Lord of the Rings Trilogy will be released in the summer of 2021. The Lord of the Rings Trilogy featuring remastered Blu-ray discs of the theatrical and extended versions of the 3 films will also be released in the fourth quarter 2021, to celebrate the 20th anniversary of The Lord of the Rings: The Fellowship of the Ring.
TOYS OF TERROR on Blu-ray & DVD 1/19/21 and Digital 10/27
David and Hannah Cashman have promised their family a fun Christmas getaway, but when they arrive at a grand, old house in the snowy woods of Washington and are greeted by familiar construction foreman, the kids realize their parent's plan to make it a working vacation; renovating the place in the hopes of flipping it. Alicia, the eldest, is annoyed but the younger kids are soon distracted when, wandering through the creepy mansion, they find a stash of old toys in an abandoned playroom and take to them instantly. Before long, they seem to be inseparable from their new playthings, much to the consternation of their nanny Rose who, along with Alicia, senses that something in the house is not quite right. As stranger and stranger things start to happen, Rose and Alicia have a hunch that there may be more to the history of the old house than the Cashman's are letting on. Can the family escape with their lives – or will they stay forever in the crumbling house, never to celebrate another Christmas again?
2067 on Blu-ray & DVD 11/17
By the year 2067, Earth has been ravaged by climate change and humanity is forced to live on artificial oxygen. An illness caused by the synthetic O2 is killing the worlds' population and the only hope for a cure comes in the form of a message from the future: "Send Ethan Whyte". Ethan, an underground tunnel worker, is suddenly thrust into a terrifying new world full of unknown danger as he must fight to save the human race. 2067 stars Kodi Smit-McPhee (X-Men Apocalypse, Let Me In) and Ryan Kwanten ("True Blood," "Sacred Lies") and is written and directed by Seth Larney (Tombiruo)
SPREE...Flee
SPREE (Blu-ray Review)
From RJLE FILMS
Review by Fluffy the Fearless😾
God knows people obsessed with internet fame deserve a good ribbing.
As a teacher who spends most of his time around teenagers, I can assure you there are countless kids convinced that being a professional YouTuber is not only a viable career option, but fortune and glory are just one viral video away. Just like every would-be Eddie Van Halen of my generation were certain they stood apart from all the other would-be Eddie Van Halens.
Rideshare driver Kurt (Joe Keery) is similarly convinced he's destined to be a social media star with his livestream show, kurtsworld96. However, no one's watching and it's easy to see why. Kurt is obnoxious, unfunny and not entirely stable, with an overinflated sense of his own talent and personal appeal. But he's certain he can achieve viral fame by doing something no other streamers have: killing his rideshare customers.
"The cow says, 'Mooooooo'!"
Spree - also the name of the company he drives for - takes place during one of his shifts and presented entirely through phones and the half-dozen cameras he's installed in his car. At first, his exploits are kind-of funny, mainly because his victims are such assholes. However, the more we get to know Kurt, the more excruciating the film becomes. Played almost too effectively by Keery, he's increasingly unlikable, his desperation for attention uncomfortably pathetic.
This is obviously intentional, but unlike such socially maladjusted main characters as Travis Bickle, D-FENS or Joaquin Phoenix's Joker, we never feel an ounce of empathy for him. Even in black comedy, that's important. Ultimately, Kurt is as insufferable to the audience as he is to Jesse (Sasheer Zamata), the popular comedian he fixates on (to a creepy level).
I'm pretty sure there are people out there right now - phones in-hand - who are just as fame-obsessed as Kurt. However, Spree squanders the opportunity to have any real fun at their expense. Despite Keery's excellent, unnerving performance - a far cry from his role in Stranger Things - being around Kurt is mostly just depressing.
"kurtsworld96 SOCIAL MEDIA CONTENT" - Basically a big batch of deleted scenes
AUDIO COMMENTARY - By director Eugene Kotyarenko
MEH...LIKE SHARING THE BED WITH THE DOG.
THE SHINING - The "Overlook Hotel" Today
A VISIT TO THE "OVERLOOK HOTEL" TODAY
Photos and text by D.M. ANDERSON💀
To horror fans around the world, the Overlook Hotel needs no introduction. But in my neck of the woods, it's known as theTimberline Lodge and has sat on Mt. Hood for over 80 years.
The place has been a prime vacation destination for decades - mainly for the skiing - but became iconic when Stanley Kubrick chose it to represent the exterior of the Overlook Hotel in The Shining. For those of you who only know Timberline from the movie, I hate to burst your bubble, but the lavish interiors were actually shot in England and look nothing like the woodsy decor of the real hotel. Still, the reason 'Room 217' from the book was changed to 'Room 237' for the film was because Timberline actually has a Room 217 and management worried people would be afraid to stay there. Personally, I can't think of a horror fan who wouldn't wanna book that room.
Since it's probably Oregon's most famous movie location and practically in my backyard, I recently took the wife & kids on a road trip to visit the place. Here are some photos of the "Overlook" today (not a lot has changed) as well as a look inside...
Obviously, it ain't winter yet.
No, that ain't Jack
The grand entrance...along with a clueless douche who wouldn't move out of the way.
The main lobby.
One of the massive hallways. Barely enough room to ride a trike.
The dreaded elevator.
You can get Shining swag at the gift shop...
...and of course, we bought some!
Disaster & Anger Fuel CUT THROAT CITY
CUT THROAT CITY (Blu-ray Review)
From WELL GO USA
Review by Tiger the Terrible😽
More than just a gritty heist film, Cut Throat City wears its anger on its sleeve. Angry at FEMA's botched response to Hurricane Katrina, angry at those using the disaster to exacerbate the gentrification of neighborhoods and angry at the overall lack of assistance to countless black families who lost everything. As presented in the film, that anger appears to be justified.
Blink (Shameik Moore) is angry, too. An aspiring comic book artist, he finds himself forced to support his wife and stepchild by dealing drugs with his small crew of friends. But even that isn't much of a living, so when the opportunity arises to work for dangerous, sadistic local crimelord 'Cousin' Bass (T.I. Harris), it feels like his only viable option. Blink and his friends are ordered to rob a local casino, a job which goes awry when police show up almost immediately, resulting in a shoot-out in which they barely get away. Now in debt to Bass, they start robbing other casinos in order to pay him off.
Meanwhile, Detective Lucinda Benoit (Eiza Gonzalez) is in charge of the investigation and suspects Blink's crew has been set-up by Bass, a plot development that's fuzzy at-best and the weakest aspect of the narrative. Still, we feel Blink's desperation as he gets further and further in over his head, surrounded by gangsters, crooked cops and corrupt city officials more concerned with making New Orleans real estate valuable again. He knows he should grab his family and get out of town, but the 9th Ward of New Orleans is his home and ultimately refuses to leave. This leads to a final act that's as exciting as it is unpredictable, along with a big 'fuck you' to FEMA. And just when the viewer thinks Blink's story is over, we're thrown an absolutely awesome curveball, reminding us of his original artistic ambitions.
The downside of working for Cousin Bass? Sitting through his vacation slides.
Though the narrative tends to sag in the middle, Cut Throat City has epic aspirations and often succeeds, aided immeasurably by the real-life backdrop of Katrina's aftermath, which not-only fuels the film's anger, but makes Blink a sympathetic protagonist even as he's robbing casinos. Though well performed by a great cast, his friends and enemies aren't nearly as fleshed-out, therefore less interesting. Still, Blink's buddies are personable enough that we care whether they live or die.
Director RZA's most ambitious work so far, Cut Throat City is an action film with heart, brains and a justifiable chip on its shoulder. More than just gangsters and guns, it tells a compelling story of people driven to desperation in light of the systematic racism they've been subjected to. And damn, what an ending! Another film forced to skip theatrical release due to a disaster of a different sort, this is well worth seeking out.
BEHIND-THE-SCENES FEATURETTE
Unwrap This SCARE PACKAGE
THE HAUNTING (Paramount Presents #10): A Pretty Se...
Rest in Peace, Rhonda Fleming
THE OWNERS and a Bit of Title Trouble
BLACK WATER: ABYSS and the Soft Spot
THE POOP SCOOP: Cats, Dogs & Creatures of the Night
REVERSAL OF FORTUNE Leaves a Scar
STAR TREK: PICARD - SEASON ONE: Old Dog, New Tricks
BROIL and the Unwelcome Dinner Guest
BEFORE THE FIRE: Timing is Everything
THE POOP SCOOP: Kreepy Kibbles Edition
THE HONEYMOON PHASE Knows Jack
SERGEANT YORK: Cynics Need Not Apply
ADVENTURES IN THE BUDGET BIN: The Benefits of Comp...
Blu-ray Giveaway: BROIL
TO YOUR LAST DEATH: Sawnimation


text:
\section{Introduction}\label{sec:intro}

In constraint programming (CP), programmers define a model of a
problem using \emph{constraints} over \emph{variables}. The variables
may take values from domains, typically boolean, integer, or rational
values. The solutions to be found are tuples of values of the
variables satisfying the constraints. The search process is performed by
powerful solving techniques, for instance backtracking-like procedures and
consistency algorithms to explore and reduce the space of
potential solutions. In the past, CP has been shown to be efficient
for solving hard combinatorial problems.

CP systems evolved from the early days of constraint logic programming
(CLP). In a CLP system, the constraint language is embedded in a logic
language, and the solving procedure combines the SLD-resolution with
calls to constraint solvers~\cite{JaffarPOPL1987}. The logic language
can be replaced with any computer programming language (e.g. C++ in
ILOG Solver~\cite{PugetSCIS1994} or Java in Gecode/J~\cite{Gecode}) and even
term rewriting~\cite{FruehwirthJLP1998}.
It turns out that the programming task may be hard, especially for non
experts of CP or computer programming. In this approach, modeling
concerns are not enough to write programs, and it is often mandatory
to deal with the encoding aspects of the host language or to
tune the solving strategy. In response to this problem, almost pure
modeling languages have been built, such as OPL~\cite{VanHentenryckBook1999}
and Zinc~\cite{RafehPADL07}.

The design of the last generation of CP systems has been governed by
the idea of separating modeling and solving capabilities (e.g.
Essence~\cite{FrischIJCAI2007} and MiniZinc~\cite{Nethercote2007}).
The system architecture has three layers, including the modeling language,
the solvers, and a middle tool composed by a set of solver-translators
implementing the mappings. In particular, this approach gives important benefits: The full
expressiveness of CP is supported by a unique high-level modeling language,
which is expected to be simple enough for non experts. The user is able
to process one model with different solvers, a crucial feature for
easy and fast problem experimentation. The platform is open to plug new solvers.

Our work follows this solver-independent idea, but under a Model-Driven
Development (MDD) approach~\cite{OMG_MDA}, which is
well-known in the software engineering sphere. General requirements
have been defined for MDD architectures in order to define concise
models, to enable interoperability between tools, and to easily program
mappings between models. The classical MDD infrastructure
uses as base element the notion of a metamodel, which allows one
to clearly define the concepts appearing in a model.

In this paper, the MDD approach is applied to a CP system. The goal is
to implement the chain from modeling to solving constraints. Our
approach is to transform user solving-independent models defined
through a visual modeling language to solver (executable) models using a
metamodeling strategy. CP concepts like domains, variables,
constraints, and relations between them are defined in a metamodel,
and thus the transformation rules are able to map these concepts from
a source language to a target one. It results in a
flexible and extensible architecture, robust enough to support changes at
the mapping tool level. Moreover, we believe that the study of
metamodels for CP is of interest.

These ideas have been implemented in the \sCOMMA{}
platform~\cite{s-COMMA}. The front tool allows users to graphically
define constraint models. It is made on top of a general
object-oriented constraint language~\cite{SotoICTAI07}. Many solvers have
been plugged in the platform such as \Eclipse~\cite{Wallace97eclipse},
Gecode/J~\cite{Gecode}, GNU Prolog~\cite{DiazSAC00} and Realpaver~\cite{GranvilliersACM2006}.
Upgrades are supported at the mapping tool, new solver-translators
can be added by means of the AMMA platform~\cite{Kurtev2006}.

The language for stating constraints in \sCOMMA{} is clearly not the novel part
of the platform, in fact it includes typical and state-of-the-art modeling constructs
and features. Novelty arises from the introduction of a solver-independent
visual language -- which we believe is intuitive and simple enough for non experts --,
and the use of a MDD approach involving metamodeling techniques to implement the mappings.

The outline of this paper is as follows. The MDD architecture
proposed is introduced in Section~\ref{sec:MDD-approach}. The \sCOMMA{}
modeling language and the associated graphical interface are presented in
Section~\ref{sec:modeling-tool}. The mapping tool and the metamodeling
techniques used to develop solver-translators are explained in Section~\ref{sec:mapping-tool}.
Some experimental results are then discussed in Section~\ref{sec:bench}. The related
work and conclusion follows.

\section{A MDD approach for CP}\label{sec:MDD-approach}

Model-Driven Engineering (MDE) aims to consider models as first class
entities. A model is defined according to the semantics of a model of
models, also called a \textbf{metamodel}. A metamodel describes the concepts
appearing in a model, but also the links between these concepts, such as:
inheritance, composition or simple association.

Figure \ref{fig:mda} depicts a general Model-Driven Architecture (MDA) for
model transformation. Level M1 holds the model. Level
M2 describes the semantic of the level M1 and thus identifies concepts
handled by this model through a metamodel. Level M3 is the specification
of level M2 and is self-defined. Transformation rules are defined to translate
models from a source model to a target one, the semantic of these rules
is also defined by a metamodel.

A major strength of using this metamodeling approach is that models are concisely
represented by metamodels. This allows one to define transformation rules that only
operate on the concepts of metamodels (at the M2 level of the MDA approach), not on the
concrete syntax of a language. Syntax concerns are defined independently (we illustrate
this in Section~\ref{sec:mapping-tool}). This separation is a great advantage for a
clearly definition of transformation rules and grammar descriptions, which are the base of
our mapping tool.

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width = 0.8\linewidth]{images/mda.eps}
\caption{A general MDA for model transformation. \label{fig:mda}}
\end{center}
\end{figure}

Let us now illustrate how this approach is implemented in our platform.
Figure~\ref{fig:mdaSCOMMA} shows the MDD \sCOMMA{} architecture, which is
composed by two main parts, a modeling tool and a mapping tool.

The \sCOMMAGUI{} is our modeling tool, and it allow users
to state constraint models using visual artifacts. An exactly textual representation of this
language is also provided (for who does not
want to use visual artifacts). Both languages are solver-independent and are designed conform to the same
metamodel (see Section~\ref{sec:modeling-tool}). The output of the \sCOMMAGUI{} is \flatsCOMMA{} an
intermediate language which is still solver-independent but, in terms of abstraction is closer to the solver level.
The goal is to simplify the development of solver-translators. \flatsCOMMA{} is also designed conform
to a metamodel (see Section~\ref{sec:flatscomma}).

The mapping tool is composed by a set of solver-translators. Solver-translators are designed to
match the metamodel concepts of \flatsCOMMA{} to the concepts of the solver metamodel
(see Section~\ref{sec:mapping-tool}). This process is defined conform to the general MDA for model
transformation.

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width = 0.95\linewidth]{images/mdaSCOMMA.eps}
\caption{The MDD architecture of s-COMMA. \label{fig:mdaSCOMMA}}
\end{center}
\end{figure}

\vspace*{-4mm}
The \sCOMMAGUI{} is written in Java (about 30000 lines) and translators
are developed using the AMMA platform. The whole system allows to perform
the complete process from visual models to solver models. The system involves
several metamodels: an \sCOMMA{} metamodel, a \flatsCOMMA{} and solver metamodels.
The \sCOMMA{} metamodel has been built just for defining the concepts of the \sCOMMA{}
textual and visual language, it is not used to map \sCOMMA{} to \flatsCOMMA{}.
For this task we already have an efficient translator. Our key aim of using metamodeling
techniques is to provide an easier way to develop new solver-translators, compared
to the task of writing translators by hand.

In the following two sections we present the main parts of this architecture:
The modeling and the mapping tool, respectively.

\section{Modeling Tool}\label{sec:modeling-tool}

We have built our \sCOMMAGUI{} modeling tool on top of the \sCOMMA{} language. The \sCOMMA{}
language is defined through its metamodel and it has been designed to represent
the concepts of constraint problems, also called constraint satisfaction problems
(CSPs). In this metamodel, the CSP concepts such as variables and domains have been
merged with object-oriented concepts in order to state CSPs using an object-oriented
style. The result is an object-oriented visual language for modeling CSPs. These
decisions are supported by the following benefits:

\begin{itemize}

\item A problem is generally composed of several parts which may represent objects.
      They are naturally specified through classes.
      Thus, we obtain a more modular model, instead of forcing
      modelers to state the entire problem in a single block of code.

\item We gain similar benefits -- constraint and variable encapsulation, composition, inheritance, reuse --
      to those gained by writing software in a object-oriented programming language.

\item Visual artifacts are more intuitive to use and give a clearer view of the complete
      structure of the problem.

\end{itemize}

Figure~\ref{fig:scommametamodel} illustrates the main concepts of the \sCOMMA{} metamodel
using UML class diagram notation. The role of each one of these concepts is explained in the
following paragraphs.

\subsection{s-COMMA models}

The \sCOMMA{} metamodel defines the concepts appearing in \sCOMMA{} models. Thus, conform to this metamodel
an \sCOMMA{} model must be composed by two main parts, the model and data.
The model describes the structure of the problem and the data contain the constant
values used by the model. In our \sCOMMAGUI{} front tool this problem's
structure is represented by class artifacts and the data concept is represented by the data
artifact\footnote{Artifacts used on the \sCOMMAGUI{} have been adapted from the class artifact provided by the UML
Infrastructure Library Basic Package. This
adaptation is completely allowed by the UML Infrastructure
Specification~\cite{OMG_UML}.} (see Figure~\ref{fig:classartifact}).

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width = 0.7\linewidth]{images/scommametamodel.eps}
\caption{s-COMMA Metamodel. \label{fig:scommametamodel}}
\end{center}
\end{figure}

\subsubsection{Class artifacts}

Class artifacts have by default three compartments, the upper compartment for the class
name, the middle compartment for attributes and the bottom one for constraint
zones. By clicking on the class artifact its specification can be opened to define
its class name, their attributes and constraint zones. Relationships can be used to
define inheritance (a subclass inherits all attributes and constraint zones of its superclass) or
composition between classes.

\subsubsection{Data artifacts}

Data artifacts have two compartments, one for the file name and another for both the
constants and variable-assignments. Constants, also called data variables can be defined with a real, integer or
enumeration type. Arrays of one dimension and arrays of two dimensions of constants are allowed.
Variable-assignment corresponds to the assignment of a value to a variable of an object. Variable-assignments
can also be performed if objects are inside an array (see an example in Section~\ref{sec:stablemarriage}).

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width=0.8\linewidth]{images/classartifact.eps}
\caption{Class artifact used in s-COMMA GUI\label{fig:classartifact}}
\end{center}
\end{figure}

\subsubsection{Attributes}

Attributes may represent decision variables, sets, objects or arrays. Decision
variables can be defined by an integer, real or boolean type. Sets can be composed of
integers or enumeration values. Objects are instances of
classes which must be typed with their class name. Arrays of one and two dimensions are allowed,
they can contain decision variables, sets or objects. Decision variables, sets and arrays can be
constrained to a determined domain.

\subsubsection{Constraint Zones}

Constraint zones are used to group constraints encapsulating them inside a class.
A constraint zone is stated with a name and it can contain the following elements:

\begin{itemize}

\item \textit{Constraints:} Typical operations and relations are provided
to post constraints. For example, comparison relations (\code{<,>,}
\code{<=,>=,=,<>}), arithmetic operations (\code{+,*,} \code{-,/}), logical relations
(\code{and,or,xor,} \code{->,<-,<->}), and set operations (\code{in, subset,
superset, union, diff, symdiff, intersection, cardinality}).

\item \textit{Statements:} Forall and conditional statements are supported. The forall
(e.g. \code{forall(i in 1..5)}) is stated by declaring a loop-variable (\code{i})
and the set of values to be traversed (\code{1..5}). A loop-variable is a local
variable and it is valid just inside the loop
where it was declared. Conditionals are stated by means of if-else expressions.
For instance, \code{if(a) b else c;} where \code{a} is the condition, which can
includes decision variables; and \code{b} and \code{c} are the alternatives,
which may be statements or constraints.

\item \textit{Objective:} objective functions are allowed and they can be stated
by tagging the expression involved with the selected option (e.g. \code{[minimize] x+y+z;}).

\item \textit{Global Constraints}: a basic set of global constraints
(e.g. alldifferent, cumulatives) is supported. Additional constraints
can be integrated to this basic set by means of extension mechanisms
(for details refer to~\cite{SotoICTAI07}).

\end{itemize}

\subsection{The stable marriage problem}\label{sec:stablemarriage}

Let us now illustrate some of these concepts in the \sCOMMAGUI{} by means of
the stable marriage problem.

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width=1\linewidth]{images/GUI.eps}
\caption{The stable marriage problem on the s-COMMA GUI\label{fig:GUI}}
\end{center}
\end{figure}

Consider a group of $n$ women and a
group of $n$ men who must marry. Each women has
a preference ranking for her possible husband, and each men
has a preference ranking for his possible wife. The problem is to find a
matching between the groups such that the marriages are stable i.e., there are
no pair of people of opposite sex that like each other better than their
respective spouses.

Figure~\ref{fig:GUI} shows a snapshot of the \sCOMMAGUI{} where the stable
marriage problem is represented by a class diagram. This diagram is composed by three
classes, one class to represent men, one to represent women, and a main class
to describe the stable marriages. Once the user states a visual artifact,
the corresponding \sCOMMA{} textual version is automatically generated on the
right-panel of the tool. For readability we illustrate the textual version of
the problem in Fig.~\ref{fig:stablemarriage}

\begin{figure}[!htbp]
\begin{scriptsize}
\begin{verbatim}
//Model file
1. import StableMarriage.dat;
2.
3. class StableMarriage {
4.
5.   Man man[menList];
6.   Woman woman[womenList];
7.
8.   constraint matchHusbandWife {
9.     forall(m in menList)
10.      woman[man[m].wife].husband = m;
11.
12.    forall(w in womenList)
13.      man[woman[w].husband].wife = w;
14.  }
15.
16.  constraint forbidUnstableCouples {
17.    forall(m in menList){
18.      forall(w in womenList){
19.        man[m].rank[w] < man[m].rank[man[m].wife] ->
20.        woman[w].rank[woman[w].husband] < woman[w].rank[m];
21.
22.        woman[w].rank[m] < woman[w].rank[woman[w].husband] ->
23.        man[m].rank[man[m].wife] < man[m].rank[w];
24.      }
25.    }
26.  }
27.}
28.
29. class Man {
30.   int rank[womenList];
31.   womenList wife;
32. }
33.
34. class Woman {
35.   int rank[menList];
36.   menList husband;
37. }

//Data file
1. enum menList := {Richard,James,John,Hugh,Greg};
2. enum womenList := {Helen,Tracy,Linda,Sally,Wanda};
3. Man StableMarriage.man :=
    [Richard: {[Helen:5 ,Tracy:1, Linda:2, Sally:4, Wanda:3],_},
     James  : {[Helen:4 ,Tracy:1, Linda:3, Sally:2, Wanda:5],_},
     John   : {[Helen:5 ,Tracy:3, Linda:2, Sally:4, Wanda:1],_},
     Hugh   : {[Helen:1 ,Tracy:5, Linda:4, Sally:3, Wanda:2],_},
     Greg   : {[Helen:4 ,Tracy:3, Linda:2, Sally:1, Wanda:5],_}];

4. Woman StableMarriage.woman :=
    [Helen: {[Richard:1, James:2, John:4, Hugh:3, Greg:5],_},
     Tracy: {[Richard:3, James:5, John:1, Hugh:2, Greg:4],_},
     Linda: {[Richard:5, James:4, John:2, Hugh:1, Greg:3],_},
     Sally: {[Richard:1, James:3, John:5, Hugh:4, Greg:2],_},
     Wanda: {[Richard:4, James:2, John:3, Hugh:5, Greg:1],_}];
\end{verbatim}
\end{scriptsize}
\caption{An s-COMMA model for the stable marriage problem.}
\label{fig:stablemarriage}
\end{figure}

The class representing men (at line 29 in the model file) is composed by one array containing
integer values which represents the preferences of a man, the array is indexed by the enumeration type \code{womenList}
(at line 2 in the data file), thereby the 1st index of the array is \code{Helen}, the 2nd is
\code{Tracy}, the third is \code{Linda} and so on. Then, an attribute called \code{wife} is
defined (line 31), which represents the spouse of an object man. This variable has \code{womenList} as a
type which means that its domain is given by the enumeration \code{womenList}. The definition
of the class \code{Women} is analogous.

The class \code{StableMarriage} has a more complex declaration. We first define two arrays,
one called \code{man} which contains objects of the class \code{Man} and other which
contains objects of the class \code{Woman}. Each one represents the group of men and the group of women,
respectively. The composition relationship between classes can be seen on the class diagram.

At line 8 a constraint zone called \code{matchHusbandWife} is stated. In this
constraint zone, two \code{forall} loops including a constraint are posted
to ensure that the pairs man-wife match with the pairs woman-husband.
The \code{forbidUnstableCouples} constraint zone contains two loops
including two logical formulas to ensure that marriages are stable.

The data file is called by means of an import statement (at line 1). This file contains two enumeration
types, \code{menList} and \code{womenList}, which have been used in the model as a type, for indexing
arrays, and as the set of values that loop-variables must traverse. \code{StableMarriage.man} is a
variable-assignment for the array called \code{man} defined at line 5 in the model file.

This variable-assignment
is composed by five objects (enclosed by \code{`$\lbrace\rbrace$'}), one for each men of the group.
Each of these objects has two elements, the first element\footnote{Let us note that we use standard modeling
variable-assignments, that is, assignments are performed respecting the order of the class'
attributes: the first element of the variable-assignment is matched with the
first attribute of the class, the second element of the variable-assignment with the
second attribute of the class and so on.} is an array (enclosed by \code{`[ ]'}). This array
sets the preferences of a men, assigning the values to the array \code{rank} of a \code{Man} object (e.g. Richard
prefers Tracy 1st, Linda 2nd, Wanda 3rd, etc).

The second element is an underscore symbol ('\_'). This symbol is used to omit assignments, so the
variable \code{wife} remains as a decision variable of the problem i.e., a variable for which the solver
must search a solution.

\subsection{Flat s-COMMA models}\label{sec:flatscomma}

Before explaining how \sCOMMA{} models are mapped to their equivalent solver
models, let us introduce the intermediate \flatsCOMMA{} language.

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width = 0.6\linewidth]{images/flatscommametamodel.eps}
\caption{Flat s-COMMA Metamodel. \label{fig:flatscommametamodel}}
\end{center}
\end{figure}

\flatsCOMMA{} has been designed to simplify the transformation process from
\sCOMMA{} models to solver models. In \flatsCOMMA{} much of the constructs
supported by \sCOMMA{} are transformed to simpler ones, in order to
be closer to the form required by classical solver languages. \flatsCOMMA{}
is also defined by a metamodel.

Figure~\ref{fig:flatscommametamodel} illustrates the main elements of the \flatsCOMMA{}
metamodel, where many \sCOMMA{} concepts have been removed. Now, the
metamodel is mainly a definition of a problem composed by variables (decision
variables) and constraints.

In order to transform \sCOMMA{} to \flatsCOMMA{}, several steps are
involved, which are explained in the following.

\begin{itemize}

\item Enumeration substitution: In general solvers do not support non-numeric types. So,
enumerations are replaced by integer values. However, enumeration values are stored
to show the results in the correct format.

\item Data substitution: Data variables stated in the model file are replaced by their
corresponding values i.e., the value defined in the data file.

\item Loop unrolling: Loops are not widely supported by solvers, hence we generate
an unrolled version of the forall loop.

\item Flattening composition: The hierarchy generated by composition is
flattened. This process is done by expanding each object declared in the main
class adding its attributes and constraints in the \flatsCOMMA{} file. The name
of each attribute has a prefix corresponding to the concatenation
of the names of objects of origin in order to avoid name redundancy.

\item Conditional removal: Conditional statements are transformed to logical formulas.
For instance, \code{if a then b else c} is replaced by $(a\Rightarrow b) \wedge (a \vee c)$.

\item Logic formulas transformation: Some logic operators are not supported by
solvers. For example, logical equivalence ($a \Leftrightarrow b$) and reverse
implication ($a \Leftarrow b$). We transform logical equivalence expressing it in
terms of logical implication ($(a \Rightarrow b) \wedge (b \Rightarrow a)$). Reverse
implication is simply inverted ($b \Rightarrow a$).
\end{itemize}

\begin{figure}[htbp]
\begin{scriptsize}
\begin{verbatim}
1.  variables:
2.
3.    womenList man_wife[5] in [1,5];
4.    menList woman_husband[5] in [1,5];
5.
6.  constraints:
7.
8.    woman_husband[man_wife[1]]=1;
9.    woman_husband[man_wife[2]]=2;
10.   woman_husband[man_wife[3]]=3;
11.   ...
12.
13.   man_wife[woman_husband[1]]=1;
14.   man_wife[woman_husband[2]]=2;
15.   man_wife[woman_husband[3]]=3;
16.   ...
17.
18.   5<man_1_rank[man_wife[1]] ->
19.   woman_1_rank[woman_husband[1]]<1;
20.   1<woman_1_rank[woman_husband[1]] ->
21.   man_1_rank[man_wife[1]]<5;
22.
23.   1<man_1_rank[man_wife[1]] ->
24.   woman_2_rank[woman_husband[2]]<3;
25.   3<woman_2_rank[woman_husband[2]] ->
26.   man_1_rank[man_wife[1]]<1;
27.   ...
28.
29. enum-types:
30.
31.   menList := {Richard,James,John,Hugh,Greg};
32.   womenList := {Helen,Tracy,Linda,Sally,Wanda};
\end{verbatim}
\end{scriptsize}
\caption{The Flat s-COMMA model of the stable marriage problem.}
\label{fig:flatstablemarriage}
\end{figure}

Figure~\ref{fig:flatstablemarriage} depicts the \flatsCOMMA{} model of the stable marriage problem. The file is composed
of two main parts, variables and constraints. Variables at lines 3-4 are generated by the
flattening composition process. The array \code{man} composed by objects of type \code{Man}
is decomposed and transformed to a single array of decision variables. The array
\code{man\_wife} contains the decision variables \code{wife} of the original
array \code{man}; and the array \code{woman\_husband} contains the decision variables
\code{husband} of the original array \code{woman}. The arrays rank of both objects
\code{Man} and \code{Woman} are not considered as decision variables since they have
been filled with constants (at lines 3-4 of the data file in Figure~\ref{fig:stablemarriage}).
The size of the array \code{man\_wife} is 5, this value is given by the enumeration
substitution step which sets the size of the array with the size of the enumeration
\code{menList} (\code{5}). The domain \code{[1,5]} is also given by this step which
states as domain an integer range corresponding to the number of elements of the enumeration
used as a type (\code{womenList}) by the attribute \code{wife}.
The type of both arrays is maintained to give the solutions
in the enumeration format. These values are stored in the block \code{enum-types}. Lines 8-15
come from the loop unrolling phase of the forall statements of the
\code{matchHusbandWife} constraint zone. Likewise, lines 18-26 are generated by the loops
of \code{forbidUnstableCouples}. In these constraints, the data substitution step has replaced
several constants with their corresponding integer values.

\section{Mapping Tool}\label{sec:mapping-tool}

In this section we explain the mechanisms provided by the MDD approach to develop
our solver-translators. These translators are designed to perform the mapping
from \flatsCOMMA{} to solver models. We use the AMMA platform as our base tool to
build them.

The AMMA platform allows one to develop this task by means of two
languages: KM3~\cite{Jouault2006KM3} and ATL~\cite{Jouault2006ATL}. KM3 is used to define metamodels, and ATL is used
to describe the transformation rules and also to generate the target file.

\subsection{KM3}\label{sec:KM3}

The Kernel Meta Meta Model (KM3) is a language to define metamodels.
KM3 has been designed to support most metamodeling standards and
it is based on the simple notion of classes to define each one of the
concepts of a metamodel. These concepts will then be used by the
transformation rules and to generate the target file.
Figure~\ref{fig:flatscommaKM3} illustrates an extract of the \flatsCOMMA{}
metamodel written in KM3.

\begin{figure}[!htbp]
\begin{scriptsize}
\begin{verbatim}
1.  class Problem {
2.    attribute name : String;
3.    reference variables[1-*] container : Variable;
4.    reference constraints[0-*] container : Constraint;
5.    reference enumTypes[0-*] container : EnumType;
6.  }
7.
8.  class Variable {
9.    attribute name : String;
10.   attribute type : String;
11.   reference array [0-1] container : Array;
12.   reference domain container : Domain;
13. }
14.
15. class Array {
16.   attribute row : Integer;
17.   attribute col[0-1] : Integer;
18. }
\end{verbatim}
\end{scriptsize}
\caption{An extract of the Flat s-COMMA KM3 metamodel. \label{fig:flatscommaKM3}}
\end{figure}

The \flatsCOMMA{} KM3 metamodel states that the concept \code{Problem}
is composed of one attribute and three references. The attribute \code{name}
at line 2 represents the name of the model and it is declared with the basic
type \code{String}. Line 3 simply states that the class \code{Problem} is
composed by a set of objects of the class \code{Variable}. The reserved
word \code{reference} is used to declare links with instances of other classes
and the statement \code{[1-*]} defines the multiplicity of the relationship.
If the multiplicity statement is omitted the relationship is defined as
\code{[1-1]}. Lines 4-5 are similar and define that the class \code{Problem}
is also composed by \code{constraints} and \code{enumTypes} (values
stored by the enumeration substitution step). Remaining classes are defined
in the same way.

\subsection{ATL}\label{sec:ATL}

The Atlas Transformation Language (ATL) allow us to
define transformation rules according to one or several metamodels.
The rules clearly state how concepts from source metamodels
are matched to concepts of the target ones. Figure~\ref{fig:rulesATL}
shows some of the ATL rules used to transform the concepts
of the \flatsCOMMA{} metamodel to the concepts of the
Gecode/J metamodel. The metamodel of Gecode/J is not presented
here since it is very close to the \flatsCOMMA{} metamodel.
Indeed, most CP solver languages are used to
express quite the same concepts and \flatsCOMMA{} is designed to
be as close as possible from the solving level. This is a great
asset because transformation rules become simple: we mainly need
one to one transformations.

\begin{figure}[htbp]
\begin{scriptsize}
\begin{verbatim}
1. module FlatsComma2GecodeJ;
2. create OUT : GecodeJ from IN : FlatsComma;
3.
4. rule Problem2Problem {
5.   from
6.     s : FlatsComma!Problem (
7.     )
8.   to
9.     t : GecodeJ!Problem(
10.      name <- s.name,
11.      variables <- s.variables,
12.      constraints <- s.constraints,
13.      enumTypes <- s.enumTypes
14.    )
15. }
16.
17. rule Variable2Variable {
18.   from
19.     s : FlatsComma!Variable (
20.    not s.isArrayVariable
21.   )
22.  to
23.   t : GecodeJ!Variable (
24.    name <- s.name,
25.    type <- s.type,
26.    domain <- s.domain
27    )
28. }
29.
30. helper context FlatsComma!Variable def:
31. isArrayVariable : Boolean=
32.   not self.array.oclIsUndefined();
\end{verbatim}
\end{scriptsize}
\caption{ATL rules for transformation from Flat s-COMMA to Gecode/J.\label{fig:rulesATL}}
\end{figure}

The first line of this file specifies the name of the
transformation. A \code{module} is used to define and
regroup a set of rules and helpers. Rules define the mappings,
and helpers allow to define factorized ATL code that can
be called from different points of the ATL file (they can be viewed as
the ATL equivalent to Java methods).

Line 2 states the target (\code{create}) and source metamodels (\code{from}).
The first rule presented is called \code{Problem2Problem} and defines
the matching between the concepts \code{Problem} expressed in \flatsCOMMA{} and Gecode/J.
The source elements are stated with the reserved word
\code{from} and the target ones with the reserved word \code{to}.
These elements are declared like variables with a name (\code{s,t}) and
a type corresponding to a class in a metamodel (\code{FlatsComma!Problem,
GecodeJ!Problem}). In the target part of the rule the name attribute of
the \flatsCOMMA{} problem is assigned to the Gecode/J name
(\code{name <- s.name}), this is just an string assignment. However,
the following two statement are assignments between concepts that are
defined as \code{reference} in the metamodel. So, they need
a specific rule to carry out the transformation. For instance, the \flatsCOMMA{} KM3
metamodel defines that the reference \code{variables} is composed by a set of
\code{Variable} elements. Thus, the statement (\code{variables <- s.variables})
calls implicitly the rule \code{Variable2Variable}, which defines the match
between each element of objects \code{Variable}. It can be highlighted that the ATL
engine requires a unique name for each rule and a unique matching case: \code{from} and \code{to}
blocks. When several rules can be applied a guard (the boolean test in line 20) over
the from statement must remove choice ambiguities.

The \code{Variable2Variable} rule matches three elements. The first two statements are
simple string assignments and the last one is a reference assignment. Let us remark that
a second rule to process array variables has been defined (but not presented here) which
includes an additional statement for the array element. These two rules are distinguished
according to complementary guards over the source block using the helper
\code{isArrayVariable}. Guards act as filter on the source variable instances to
process. The presented helper \code{isArrayVariable} applies on variable instances
in \flatsCOMMA{} models and returns true when the instance contains an array
element. ATL inherits from OCL~\cite{OMG_OCL} syntax and semantics; and most OCL functions
and types are available within ATL.

Although the rules used here are not complex, ATL is able to perform more difficult rules.
For instance, the most difficult rule we defined, was the transformation rule from \flatsCOMMA{}
matrix containing sets, which must be unrolled in the \Eclipse{} models (since set matrix
are not supported). This unroll process is carried out by defining a single set in \Eclipse{}
for each cell in the matrix. The name of each single variable is composed by the name of the matrix,
and the corresponding row and column index.

\begin{figure}[!htbp]
\begin{scriptsize}
\begin{verbatim}
1. rule Problem2Problem {
2.    from
3.      s : FlatsComma!Problem (
4.          s.hasSetMatrix
5.      )
6.    to
7.      t : ECLiPSe!Problem (
8.          name <- s.name,
9.          constraints <- s.constraints,
10.         enumTypes <- s.enumTypes
11.     )
12.   do {
13.     t.variables <- s.variables->collect(e|
14.      if e.isSetMatrix() then
15.        thisModule.getMatrixCells(e)->collect(f|
16.         thisModule.SetMatrixVariable2Variable(f.var,f.i,f.j)
17.        )
18.      else
19.        e
20.      endif
21.      )->flatten();
22.   }
23. }
24.
25. rule SetMatrixVariable2Variable(var : FlatsComma!Variable,
26.                                  i : Integer, j : Integer) {
27.   to
28.     t : ECLiPSe!Variable(
29.       name <- var.name + i.toString() + '_' + j.toString(),
30.       type <- var.type,
31.       domain <- var.domain,
32.     )
33.   do {
34.     t;
35.   }
36. }
\end{verbatim}
\end{scriptsize}
\caption{ATL rules for decomposing matrix containing sets.\label{fig:setmat}}
\end{figure}

Figure~\ref{fig:setmat} shows the rule \code{Problem2Problem} defined for \Eclipse{}, this rule has a condition
(line 4) to check whether set matrix are defined in the model. If the condition is true, \code{name}, \code{constraints} and \code{enumTypes} are
matched normally, but \code{variables} has a special procedure to decompose the set matrix.

This procedure begins at line 12 with a \code{do} block.
In this block, the \code{collect} loop iterates over the variables. Then, each of these variables (\code{e}) is checked
to determine whether it has been defined as a set matrix (line 14).
If this occurs, the helper \code{getMatrixCells(e)} calculates the set
of tuples corresponding to all the cells of the matrix (\code{thisModule} is used to call explicitly
helpers or rules). Each tuple is composed of the
\flatsCOMMA{} variable (\code{f.var}), a row index
(\code{f.i}) and a column index (\code{f.j}). Then, the rule
\code{SetMatrixVariable2Variable} is applied to each tuple in order to
generate the \Eclipse{} variables. This rule does not contain a source block since the
source elements are the input parameters. The rule sets to the attribute \code{name}, the concatenation of the name of
the matrix with the respective row (\code{i.toString()}) and column (\code{j.toString()}).
Attributes \code{type} and \code{domain} are also matched. Finally, \code{flatten()} is an OCL inherited method
used to match the generated set of variables with \code{t.variables}.

ATL is also used to generate the solver target file. This is possible by defining a new ATL file
(called generically ATL2Text) where we can embed the concepts of the metamodel in the syntax
of the target file. This is done by means of a querying facility that enables to specify requests
onto models.

\begin{figure}[!htbp]
\begin{scriptsize}
\begin{verbatim}
1.  query GecodeJ2Text = GecodeJ!Problem.allInstances()->
2.    asSequence()->first().toString2().
3.    writeTo('./GecodeJ/Samples/'+ thisModule.getFileName() +
4.    '.java');
5.
6.  helper context GecodeJ!Problem def: toString2() : String=
7.    'package comma.solverFiles.gecodej;\n' +
8.    'import static org.gecode.Gecode.*;\n' +
9.    'import static org.gecode.GecodeEnumConstants.*;\n' +
10.   ...
11.
12.    self.variables->collect(e | e.toString2())
13.   ->iterate(e; acc:String = '' | acc +'    '+e) +
14.  ...
15.    '}\n\n'
16.  ;
17.
18. helper context GecodeJ!Variable def: toString2() :
19.   String=
20.   if self.array.oclIsUndefined() then
21.     'IntVar ' + self.name + ' = new IntVar(this,\"' +
22.     self.name + '\",' + self.domain.toString2() +');\n' +
23.     '    vars.add('+ self.name +');\n'
24.   else if self.array.col.oclIsUndefined() then
25.     'VarArray<IntVar> ' + self.name + ' = initialize(\"' +
26.     self.name + '\",' + self.array.toString2() +
27.     ',' + self.domain.toString2()+');\n' +
28.     '    vars.addAll(' + self.name + ');\n'
29.   else
30.     'VarMatrix<IntVar> ' + self.name + ' = initialize(\"' +
31.     self.name + '\",' +  self.array.toString2() +
32.     ',' + self.domain.toString2()+');\n' +
33.     '    vars.addAll(' + self.name + ');\n'
34.   endif endif
35. ;
\end{verbatim}
\end{scriptsize}
\caption{GecodeJ2Text file\label{fig:ATLtoText}}
\end{figure}

Figure~\ref{fig:ATLtoText} shows a fragment of the GecodeJ2Text definition
to generate the Gecode/J file. Lines 1-4 states the query
on the \code{Problem} concept and defines the target file. Queries are able to call
helpers, which allow us to build the string to be written in the target solver file. This query
calls the helper \code{toString2()} defined for the concept \code{Problem}. This helper
is stated at line 6 and it creates first the string corresponding to the headers (package and
import statements) of a Gecode/J model. Then, at lines 12-13 the string corresponding
to the variables declarations is created. This is done by iterating the collection of
variables and calling the corresponding \code{toString2()} helper for the \code{Variable}
instances. This helper is declared at line 18, it defines three possible variable declarations,
single variable (\code{IntVar}), a one dimension array (\code{VarArray<IntVar>}), and a two dimension
array (\code{VarMatrix<IntVar>}). The alternatives are chosen by means of an if-else statement.
The condition \code{self.array.oclIsUndefined()} checks whether the concept array is undefined. If this
occurs, the variable corresponds to a single variable. The string representing this declaration
uses \code{self.name} which refers to the name of the variable, \code{self.domain.toString2()}
calls a helper to get the string representing the domain of the variable. The next alternative
tests if the attribute \code{col} of the \code{array} is undefined, in this case the variable is a
one dimension array, otherwise it is a two dimension array. The call \code{self.array.toString2()} is used
in the two last alternatives, it returns the string corresponding to the size of arrays.

Figure~\ref{fig:stablegecodej} depicts an extract of the Gecode/J file generated for the stable
marriage problem. Lines 1-3 states the headers. Line 6 declares the array called \code{man\_wife}.
which is initialized with size \code{5} and domain \code{[1,5]}. At line 8 the array is added
to a global array called \code{vars} for performing the labeling process. Lines 14-19 illustrate
some constraints, which are stated by means of the \code{post} method.

\begin{figure}[htbp]
\begin{scriptsize}
\begin{verbatim}
1.  package comma.solverFiles.gecodej;
2.  import static org.gecode.Gecode.*;
3.  import static org.gecode.GecodeEnumConstants.*;
4.  ...
5.
6.  VarArray<IntVar> man_wife  =
7.      initialize("man_wife",5,1,5);
8.  vars.addAll(man_wife);
9.
10. VarArray<IntVar> woman_husband  =
11.      initialize("woman_husband",5,1,5);
12. vars.addAll(woman_husband);
13.
14. post(this, new Expr().p(get(this,woman_husband,
15.   get(man_wife,1))),IRT_EQ, new Expr().p(1));
16. post(this, new Expr().p(get(this,woman_husband,
17.   get(man_wife,2))),IRT_EQ, new Expr().p(2));
18. post(this, new Expr().p(get(this,woman_husband,
19.   get(man_wife,3))),IRT_EQ, new Expr().p(3));
20. ...
\end{verbatim}
\end{scriptsize}
\caption{Gecode/J model for the stable marriage problem.\label{fig:stablegecodej}}
\end{figure}

\subsection{TCS}\label{sec:TCS}

TCS~\cite{Jouault2006TCS} (Textual Concrete Syntax) is another language provided by the AMMA platform.
TCS is not mandatory to add a new translator but it is involved in the process since it
is the language used to parse the \flatsCOMMA{} file. TCS is able to perform
this task by bridging the \flatsCOMMA{} metamodel with the \flatsCOMMA{} grammar.

\begin{figure}[!htbp]
\begin{scriptsize}
\begin{verbatim}
1.  template Problem
2.   : "variables" ":" variables
3.     "constraints" ":" constraints
4.     "enum-types" ":" enumTypes
5.   ;
6.
7.  template Variable
8.   :  type name (isDefined(array) ? array) "in" domain ";"
9.   ;
10.
11. template Array
12.  : "[" row (isDefined(col) ? "," col ) "]"
13.  ;
\end{verbatim}
\end{scriptsize}
\caption{TCS for Flat s-COMMA.\label{fig:TCS}}
\end{figure}

Figure \ref{fig:TCS} shows an extract of the TCS file for \flatsCOMMA{}. Each
class of the \flatsCOMMA{} metamodel has a dedicated template declared with
the same name. Within templates, words between double quotes are tokens in the
grammar (e.g. \code{"variables"}, \code{":"}). Words without double quotes are used
to introduce the corresponding list of concepts. For instance \code{variables} is
defined as a reference to objects \code{Variable} in the class \code{Problem} of the metamodel. Thus,
\code{variables} is used to call their associate template i.e., the
\code{Variable} template. This template defines the syntactic structure
of a variable declaration. It has a conditional structure (\code{(isDefined(array) ? array)}),
which means that the template \code{Array} is only called if the variable is defined
as an array.

\subsection{Transformation process}\label{sec:trans-process}

TCS and KM3 work together and their compilation generates a Java
package (which includes lexers, parsers and code generators) for \flatsCOMMA{} (FsC),
which is then used by the ATL files to generate the target model.
Figure~\ref{fig:AMMA} depicts the complete transformation process.
The \flatsCOMMA{} file is the output of the \sCOMMAGUI{}, this file
is taken by the Java package which generates a XMI \footnote{XMI is
the standard used for exchanging metadata in MDD architectures.} (XML Metadata Interchange) for
\flatsCOMMA{}, this file includes an organized representation of models
in terms of their concepts in order to facilitate the task of transformation
rules. Over this file ATL rules act and generate a XMI file for Gecode/J.
Finally this file is taken by the Gecode/J2Text which builds the solver file.

\begin{figure}[!hbtp]
\begin{center}
\includegraphics[width=1\linewidth]{images/mm-amma.eps}
\caption{The AMMA model-driven process on the example of Flat s-COMMA (FsC) to Gecode/J.\label{fig:AMMA}}
\end{center}
\end{figure}

The complete process involves TCS, KM3 and ATL. But, the integration of a new
translator just requires KM3 and ATL (the mapping tool only needs one TCS
file). As we mention in Section~\ref{sec:ATL}, solver metamodels are
almost equivalents, and ATL rules are mainly one to one mappings.
As a consequence, the development of KM3 and ATL rules for new solver-translators
should not be a hard task. So, we could say that the concrete work for plugging a new
solver is reduced to the definition of the ATL2Text file.

Currently, There are two versions of our mapping tool, one with AMMA translators and
one with translators written by hand (in Java), which we got from a preliminary development
phase of the system. Comparing both approaches, let us make the following concluding remarks.

\begin{itemize}

\item The development of hand-written translators is in general a hard task.
Their creation, modification and reuse require to have a deep insight in the code
and in the architecture of the platform, even more if they have a specific and/or
complex design. For instance, the developer may be forced to directly use
lexers and parsers, or a given library which provides specific methods to generates
the target files.

\item The development of AMMA translators does not require advanced language implementation
skills. We show that the use of KM3 and ATL is not really a hard task. Moreover, AMMA
is supported by a set of tools~\cite{EclipseM2M} which provide a great framework to
create and manipulate KM3, ATL and TCS models, and also for project handling.
An independent definition of syntax concerns (ATL2Text) from metamodel concepts (KM3) is
another advantage which gives us a more organized view that facilitates the creation and
reuse of translators.

\item The development of hand-written translators requires more code lines. In our
implementation, the source files of Java translators are approximately
60\% bigger than the AMMA translators source files (ATL+KM3).

\end{itemize}

\subsection{Direct code generation}\label{sec:simpler-process}

There is another approach to develop translators using the AMMA platform.
For instance, if we want to use just the \flatsCOMMA{} features that are
supported by the solver, we can omit the transformation rules and we can apply
the ATL2Text directly on the source metamodel. Figure~\ref{fig:simpler} shows
this direct code generation process.

\begin{figure}[!hbtp]
\begin{center}
\includegraphics[width=0.8\linewidth]{images/mm-amma-simpler.eps}
\caption{Direct code generation.\label{fig:simpler}}
\end{center}
\end{figure}

Although this approach is simpler, it is less flexible since we lose
the possibility of using interesting rules transformations such as the set matrix
decomposition explained in Section~\ref{sec:ATL}.

\section{Experiments}\label{sec:bench}

We have carried out a set of tests in order to first compare the performance of
AMMA translators (using transformation rules)
with translators written by hand, and second, to show that the automatic generation of
solver files does not lead to a loss of performance in terms of solving time. Tests
have been performed on a 3GHz Pentium 4 with 1GB RAM running Ubuntu 6.06, and
benchmarks used are the following~\cite{s-COMMA}:
\vspace*{-2mm}
\begin{itemize}

\item Send: The cryptoarithmetic puzzle Send + More = Money.
\vspace*{-2mm}
\item Stable: The stable marriage problem presented.
\vspace*{-2mm}
\item Queens: The N-Queens problem (n=10 and n=18).
\vspace*{-2mm}
\item Packing: Packing 8 squares into a square of area 25.
\vspace*{-2mm}
\item Production: A production-optimization problem.
\vspace*{-2mm}
\item Ineq20: 20 Linear Inequalities.
\vspace*{-2mm}
\item Engine: The assembly of a car engine subject to design constraints.
\vspace*{-2mm}
\item Sudoku: The Sudoku logic-based number placement puzzle.
\vspace*{-2mm}
\item Golfers: To schedule a golf tournament.

\end{itemize}

\begin{table}[!hbtp]
\caption{Translation times (seconds)\label{table:translators}}
\begin{center}
\begin{small}
\begin{tabular}{|l|l|ll|ll|}
\hline
 &sC to&\multicolumn{2}{l|}{FsC to Gecode/J}&\multicolumn{2}{l|}{FsC to \Eclipse{}}\\
\cline{3-6}
Benchmark&FsC&Java&AMMA&Java&AMMA\\
\hline
\hline
Send             &0.237  &0.052   &0.688   &0.048  &0.644 \\
\hline
Stable           &0.514  &0.137   &1.371   &0.143  &1.386 \\
\hline
10-Queens        &0.409  &0.106   &1.301   &0.115  &1.202 \\
\hline
18-Queens        &0.659  &1.122   &3.194   &0.272  &2.889 \\
\hline
Packing          &0.333  &0.172   &1.224   &0.133  &1.246 \\
\hline
Production       &0.288  &0.071   &0.887   &0.066  &0.783  \\
\hline
20 Ineq.         &0.343  &0.072   &0.895   &0.072  &0.891 \\
\hline
Engine           &0.285  &0.071   &0.815   &0.071  &0.844 \\
\hline
Sudoku           &3.503  &1.290   &4.924   &0.386  &4.196 \\
\hline
Golfers          &0.380  &0.098   &1.166   &0.111  &1.136 \\
\hline
\end{tabular}
\end{small}
\end{center}
\end{table}

Table~\ref{table:translators} shows preliminary results comparing AMMA translators
with translators written by hand (in Java). Column
3 and 4 give the translation times using Java and AMMA translators, from \flatsCOMMA{} (FsC) to
Gecode/J and from \flatsCOMMA{} to \Eclipse{}, respectively. Translation times from \sCOMMA{} (sC)
to \flatsCOMMA{} are given for reference in column 2 (This process involves syntactic and
semantic checking, and the transformations explained in Section~\ref{sec:flatscomma}). The results show that AMMA translators
are slower than Java translators, this is unsurprising since Java translators have been
designed specifically for \sCOMMA{}. They take as input a \flatsCOMMA{} definition and generate
the solver file directly. The transformation process used by AMMA translators is not direct,
it performs intermediate phases (XMI to XMI). Moreover, the AMMA tools are under continued development and many
optimizations can be done especially on the parsing process of the source file (more than 60\% of
the time is consumed by this process). Although our primary scope is not focused on performance, we
expect to improve this using the next AMMA version.

However, despite of this speed difference, we believe translation
times using AMMA are acceptable and this loss of performance is a reasonable price to pay for using
a generic approach.

In Table~\ref{table:modelsize} we compare the solver files generated by AMMA translators
\footnote{In the comparison, we do not consider solver files generated by Java translators.
They do not have relevant differences compared to solver files generated by
AMMA translators.} with native solver files version written by hand.
The data is given in terms of \textit{solving time(seconds)/model size(tokens)}.
Results show that generated solver files are in general bigger than solver
versions written by hand. This is explained by the loop unrolling and flattening
composition processes presented in Section~\ref{sec:flatscomma}. However, this increase
in terms of code size does not cause a negative impact on
the solving time. In general, generated solver versions
are very competitive with hand-written versions.

Table~\ref{table:modelsize} also shows that Gecode/J files are bigger than
\Eclipse{} files, this is because the Java syntax is more verbose than the \Eclipse{}
syntax.

\begin{table}
\caption{Solving times(seconds) and model sizes (number of tokens)\label{table:modelsize}}
\begin{center}
\begin{small}
\begin{tabular}{|l|ll|ll|}
\hline
 &\multicolumn{2}{l|}{Gecode/J}&\multicolumn{2}{l|}{\Eclipse{}}\\
\cline{2-5}
Benchmark&hand&AMMA&hand&AMMA\\
\hline
\hline
Send             &0.002/  &0.002/    &0.01/  &0.01/ \\
                 &590     &615       &231    &329   \\
\hline
Stable           &0.005/  &0.005/    &0.01/  &0.01/ \\
                 &1898    &8496      &1028   &4659   \\
\hline
10-Queens        &0.003/  &0.003/    &0.01/  &0.01/ \\
                 &460     &9159      &193    &1958   \\
\hline
18-Queens        &0.008/  &0.008/    &0.02/  &0.02/ \\
                 &460     &30219     &193    &6402   \\
\hline
Packing          &0.009/  &0.009/    &0.49/  &0.51/ \\
                 &663     &12037     &355    &3212   \\
\hline
Production       &0.026/  &0.028/    &0.014/ &0.014/ \\
                 &548     &1537      &342    &703   \\
\hline
20 Ineq          &13.886/ &14.652/   &10.34/ &10.26/ \\
                 &1576    &1964      &720    &751   \\
\hline
Engine           &0.012/  &0.012/    &0.01/  &0.01/ \\
                 &1710    &1818      &920    &1148   \\
\hline
Sudoku           &0.007/  &0.007/    &0.21/  &0.23/ \\
                 &1551/   &33192/    &797/   &11147/ \\
\hline
Golfers          &0.005/  &0.005/    &0.21/  &0.23/ \\
                 &618/    &4098/     &980/   &1147/ \\
\hline
\end{tabular}
\end{small}
\end{center}
\end{table}

\section{Related Work}\label{sec:related}

\sCOMMA{} is as related to solver-independent languages as object-oriented languages.
In the next paragraphs we compare our approach to languages belonging to these
groups.

\subsection{Solver-Independent Constraint Modeling}

Solver-independence in constraint modeling languages is a recent trend. Just
a few languages have been developed under this principle. One example is
MiniZinc, which is mainly a subset of constructs provided by Zinc, its syntax
is closely related to OPL and its solver-independent platform allows to translate
models into Gecode and \Eclipse{} solver code. This model transformation is performed by
a rule-based system called Cadmium~\cite{BrandPADL2008} which can be regarded as an extension of
Term-Rewriting (TR)~\cite{Baader1998} and Constraint Handling Rules (CHR)~\cite{FruehwirthJLP1998}.
This process also involves an intermediate model called FlatZinc, which plays a similar role
than \flatsCOMMA{}, to facilitate the translation.

The implementation of our approach is quite different to Cadmium. While
Cadmium is supported by CHR and TR, our approach is based on standard model transformation
techniques, which we believe give us some advantages. For instance, ATL and
KM3 are strongly supported by the model engineering community. A considerable amount of
documentation and several examples are available at the Eclipse IDE site~\cite{EclipseM2M}.
Tools such as Eclipse plug-ins are also available for developing and debugging applications.
It is not less important to mention that ATL is considered as a standard solution for model
transformation in Eclipse.

On the technical side, the Cadmium system is strongly tied to MiniZinc. This is a great
advantage since the rules operate directly on Zinc expression, so transformation rules are
often compact. However, this integration forces to merge the metamodel concepts of MiniZinc
with the MiniZinc syntax. This property makes Cadmium programs more compact but less
modular than our approach, where the syntax is defined independently from the metamodel
(as we have presented in Section~\ref{sec:mapping-tool}).

Essence is another solver-independent language. Its syntax is addressed to users
with a background in discrete mathematics, this style makes Essence a specification
language rather than a modeling language. The Essence execution platform allows to
map specifications into \Eclipse{} and Minion solver~\cite{GentECAI96}. A model transformation
system called Conjure has been developed, but the integration of solver translators
is not its scope. Conjure takes as input an Essence specification and transform it to an
intermediate OPL-like language called Essence'. Translators from Essence' to solver code
are written by hand.

From a language standpoint, \sCOMMA{} is as expressive as MiniZinc and Essence, in fact
these approaches provide similar constructs and modeling features. However, a main feature
of \sCOMMA{} that strongly differences it from aforementioned languages is the object-oriented
framework provided and the possibility of modeling problems using a visual language.

\subsection{Object-Oriented Constraint Modeling and Visual Environments}

The capability of defining constraints in an object-oriented modeling
language is the base of the object-oriented constraint modeling paradigm.
The first attempt in performing this combination was on the development of
ThingLab~\cite{BorningTOPLAS1981}. This approach was designed for interactive
graphical simulation. Objects were used to represent graphical elements and
constraints defined the composition rules of these objects.

COB~\cite{JayaramanPADL2002} is another object-oriented language,
but its framework is not purely based on this paradigm. In fact, the
language is a combination of objects, first order formulas and CLP (Constraint
Logic Programming) predicates. A GUI tool is also provided for modeling problems
using CUML, a UML-like language. The focus of this language was the engineering
design. Modelica~\cite{FritzsonECCOP1998} is another object-oriented
approach for modeling problems from the engineering field, but it is
mostly oriented towards simulation.

Gianna~\cite{PaltrinieriCP1995} is a precursor visual environment for modeling CSP. But
its modeling style is not object-oriented and the level of abstraction provided is
lower than in UML-like languages. In this tool, CSPs are stated as constraint graphs
where nodes represent the variables and the edges represent the constraints.

Although these approaches do not have a system to plug-in new solvers
and were developed for a specific application domain, we believe it is
important to mention them.

It is important to clarify too, that object-oriented capabilities are also provided by
languages such as CoJava~\cite{BrodskyCP2006}; and in libraries such as Gecode or ILOG SOLVER.
The main difference here is that the host language provided is a programming language but not a high-level
modeling language. As we have explained in Section~\ref{sec:intro}, advanced programming skills
may be required to deal with these tools.

\section{Conclusions and Future Work}\label{sec:conclusion}

In this work we have presented \sCOMMA{}, an extensible MDD platform for
modeling CSPs. The whole system is composed by two main parts: A modeling
tool and a mapping tool, which provide to the users the following three
important facilities:
\begin{itemize}

\item A visual modeling language that combines the declarative aspects of constraint programming
      with the useful features of object-oriented languages.
      The user can state modular models in an intuitive way, where the compositional structure
      of the problem can be easily maintained through the use of objects under constraints.

\item Models are stated independently from solver languages. Users are able
      to design just one model and to target different solvers. This clearly facilitates
      experimentation and benchmarking.

\item A model transformation system supported by the AMMA platform which follows the standards
      of the software engineering field. The system allows users to plug-in new solvers
      without writing translators by hand.

\end{itemize}

     Currently, we do not use \sCOMMA{} as our source model, because its metamodel is quite large and
     defining generic mappings to different solver metamodels will be a serious challenge. However
     we believe that this task will lead to an interesting future work, for instance to perform reverse
     engineering (e.g. Gecode/J to \sCOMMA{} or \Eclipse{} to \sCOMMA{}). The use of AMMA for
     model optimization will be useful too, for instance to eliminate redundant or useless
     constraints. The definition of selective mappings is also an interesting task, for instance
     to decide, depending on the solver used, whether loops must be unrolled or the composition
     must be flattened.

\acks

We are grateful to the support of this research from the ``Pontificia Universidad Cat\'olica de
Valpara{\'\i}so" under the grant ``Beca de Estudios B\'asica", and to Fr\'ed\'eric Jouault for his
support on the implementation of the AMMA translators.

\bibliographystyle{plainnat}

redpajama_set_name: RedPajamaArXiv


text:
The term "tight gas sands" refers to low permeability sandstone reservoirs that produce primarily dry natural gas. A tight gas reservoir is one that cannot be produced at economic flow rates or recover economic volumes of gas unless the well is stimulated by a large hydraulic fracture treatment and/or produced using horizontal wellbores (Holditch, 2006). Tight gas includes basin-centred gas systems, defined by Law (2002) as low-permeability, gas-saturated reservoirs that are abnormally pressured, regionally pervasive, and lack down-dip water contacts.
In the United States tight sands produce about 6 trillion cubic feet (TCF) of gas per year, which is 25% of the total gas produced (AAPG). As of January, 2009, the U. S. Energy Information Administration (EIA) estimates that 310 TCF of technically recoverable tight gas exists within the U.S, representing over 17% of the total recoverable gas.
Cooper Basin – Pervasive Tight Gas Accumulation
The presence of a Basin Centred Gas Accumulation (BCGA) in the Nappamerri Trough has been suspected for over two decades. Beach Energy has stated that the Encounter and Holdfast wells confirm the presence of gas in sands outside of structural closure and estimate that gas in place potentially exceeds 200 Tcf in sands across PEL 218.
Cooper Basin – Discrete Tight Gas Accumulations
In the Cooper Basin gas reserves are at commercial rather than technical recovery limits and explorers recognise significant upside reserve potential from unconventional sources. These unconventional sources include Early Permian Patchawarra Formation tight gas sands in the Moomba and Big Lake fields on the southern end of the Nappamerri Trough. Tight gas is the most mature unconventional play in the Cooper Basin. The Santos JV has been exploring the Nappamerri Trough since the mid 1990s and has utilised a range of drilling, development and production technologies to extract tight gas from its existing Cooper Basin fields. Tight gas sands have also been intersected at Wimma 1 in the centre of the Patchawarra Trough.
https://www.petroleum.sa.gov.au/geology-and-prospectivity/resource-and-coal-plays/tight-gas

redpajama_set_name: RedPajamaCommonCrawl


text:
St. Nicholas Church in Efremov
Yefremov is a wonderful city of Krasivomechye! Here the rich spiritual life is intertwined with the history of famous writers: Bunin, Griboyedov, and Paustovsky.
Churches were actively built in Yefremov before the revolution. In 1870, a religious school was built here!
It is known that this blessed city had the Church of St. Nicholas in its borders back in 1783 but the exact date of construction is unknown! Throughout its entire history, the church has changed its address.
More detailed information about the Church of St. Nicholas in Tula is stored in the Diocesan Directorate. However, we know that the wooden church was moved to another place and became stone one, and where it had been, a merchant's house was built ut with a memorial kiot and an icon in the wall. This brick church stood until 1832. Since it could no longer accommodate the required number of parishioners, it was again rebuilt into a more spacious one and in 1893, it was renovated. The Church in Yefremov is not like the Church of St. Nicholas in Tula.
In 1936, the Bolsheviks put an end to the life of the sacred place, leaving nothing after it!
Only in 2009, the Church of St. Nicholas in Yefremov obtained a new life, it was rebuilt due to the efforts of Archimandrite Herman and consecrated. A memorial stele was erected in the old place. Now, the church invites all guests of the city to put candles and make commemorative pictures!
Komsomolskaya St., Efremov, Tula Region
The park named after I.A. Bunin
Matrona Of Moscow Temple
Preventive Health Resort EZSK Service JSC (Yefremov)
Tomato pizza and restaurant
Shef Restaurant-Bar
Silf Restaurant
A Monument To I. A. Bunin
Schastye Hotel
Museum of the Yefremov Synthetic Rubber Plant
Krasivomechye
Komsomolsky Square
Khimick Cinema
The temple in honor of the icon of the Mother of God "The Execution of the Dead"
Schastye Cafe and sushi bar
House-Museum of I.A. Bunin
Krasivaya Mecha Hotel


text:
Q: Scroll WinForms DataGridView in a WPF WindowsFormsHost I have Scrollviewer which contains a frame with a WindowsFormsHost. The WindowsFormsHost contains a DataGridView (please don't ask why I'm not doing this with a WPF DataGrid Control).
Because the DataGridView causes display errors while scrolling with the scrollviewer I disabled the scrollviewer and enabled the scrolling on my DataGridView.
    <Grid x:Name="LayoutRoot">
        <WindowsFormsHost HorizontalAlignment="Stretch" Name="_windowsFormsHostGrid" VerticalAlignment="Stretch">
            <Win.Grid:DataGridView x:Name="_buchungGrid" ScrollBars="Both" BorderStyle="None" BackgroundColor="#F7F8FA" CellFormatting="_gridBuchungen_CellFormatting" SelectionChanged="GridSelectionChanged" DoubleClick="_buchungInovaGrid_DoubleClick" AutoSize="True" AutoColumnWidthMode="Window" ZebraColor="LightGray" Anchor="Left" Dock="Fill" />
        </WindowsFormsHost>
    </Grid>

This seems to work. As long I don't resize the Window. When I resize the window (and this will cause all child elements to resize including scrollviewer, frame and WindowsFormsHost), the scrollbars of my DataGridView disappears and I'm not longer able to scroll my grid. I can resize to the old size of the window, but the scrollbars are still hidden.
Any idea why this happens and how to fix it? I'm also not sure why they disappear because I'm resizing just one pixel and this occurs.

A: There seems not to be a solution for this problem. I ended up by using a WPF DataGrid and extend it by the functionality I need.
WinForms will be painted all the time at the top of all other elements. The only solution seems to wrap a windows around it to get scrolling fixed but this would ugly as hell.

A: Given a Forms.DataGridView (dgv) inside a Forms.UserControl (myUserControl) inside a WindowsFormsHost, I discovered that the DGV was given larger dimensions than the UC, so the scrollbars were not visible. (If UC is instead in a WinForm, scrollbars appear as expected; there seems to be an issue with resize logic inside WFHost.)
I was able to fix this in my UC's SizeChanged handler:
// VB code:
Public Class MyUserControl
...
Private Sub MyUserControl_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged
        ' dgv.Size is much larger than it should be; not sure why.
        ' my dgv has controls above it, but extends all the way to bottom and right;
        ' if yours does not, then subtract more as needed.
        dgv.Size = New Size(Me.Size.Width - dgv.Left, Me.Size.Height - dgv.Top)
End Sub
...
End Class

The result is that the WinForms drawing stays within the area it is supposed to; the scrolling is done in WinForms.  (NOT using a WPF scrollviewer.)

XAML for WPF:
...
xmlns:mywf="clr-namespace:MyWinFormAssembly;assembly=MyWinFormAssembly"
...

<WindowsFormsHost>
    <mywf:MyUserControl />
</WindowsFormsHost>

redpajama_set_name: RedPajamaStackExchange


The litter tray is not simply a plastic container for the cat's convenience; it is an important item in any home where cats spend time indoors. It can be a source of great frustration for both cats and owners, and is often a breaking point in a relationship between cat and owners.
The important factors to consider are position, content, litter tray, the number of litter trays, and cleanliness. Each cat will determine the level of priority of these, and they will probably change as kitten grows to adult, to senior then geriatric cat.
Of high importance for most cats is the position of the litter tray, as being safe when in a compromised position is important. Easy access is necessary, but not near food or water or in high-traffic areas. Enough clear space to see any possible threat approaching, and an alternative escape route are important.
The litter itself must suit the cat's likes for smell and texture. Crystal litters, apart from being sharp on delicate paws, are scented for the benefit of people; not all cats appreciate the smell. The addition of scenting compounds can also put him off. Kittens and older cats, as well as cats with soft paws or issues of balance, prefer a finer litter while adult cats will tolerate a coarser litter. Some cats do not like the feel of litter on their paws, they may use torn or flat sheets of newspaper. For cats that previously lived outside it may be necessary to begin with garden soil and gradually introduce small amounts of litter to slowly acclimatise him.
The depth of the litter can be a factor – some cats love to dig and need deeper litter while others feel unsteady on the litter and need only enough to use and cover up.
Finding the right litter tray is crucial. Most cats prefer an open one to a closed one; partly from a safety perspective as they cannot see or escape any threat, and also because a closed litter tray will hold smells which make for an unpleasant experience.
The size of the litter tray is important, at least 1 ½ times as long as the cat (or as the kitten will be when he grows up), and twice as wide. This is to allow space for digging, turning around, and covering up.
Litter trays and plastic containers come in all colours. Cats do not see colour in the same way we do, some colours look the same to them. If the litter tray blends into the surroundings cats may not notice it, or feel comfortable using it as it does not have perspective.
Pet shops and supermarkets sell plastic litter trays, however there are other options. Shops that specialise in plastic products provide alternative options. Large trays with high sides are useful for those who like to dig, while display-style containers with an open side are wonderful for small kittens and arthritic cats who cannot manage to climb over the side.
Litter trays do not last forever. Crevices from cracks, and the continual scratching and abrasion of the litter scratches the plastic and allows bacteria to settle. Check the state of the litter tray when it is cleaned and replace as necessary, possibly with a different size or style if appropriate.
The generally-accepted number of litter trays per household is one per cat plus one; where cats have permanent access to a secure and weather-proof garden this number may be reduced. This will give each cat a choice of litter trays at all times. Where this is not possible or practical, cats will learn to use common litter trays; however elimination in other areas can be expected. A common issue is the guarding of pathways to litter trays by other cats, so it is important to have litter trays in various locations around the home.
Cleanliness is important to cats as an instinctive safety measure. Since their – and there predators' – sense of smell is so good, they need to hide or reduce their smells, hence the covering up of wee and pooh in the litter tray. Many cats will not use a dirty litter tray, or one that has been used by another cat. Litter trays should ideally be cleaned as soon as they are used, or at least twice a day, and washed at least monthly.


text:
Uncle Chunt Facebook
Uncle Chunt Twitter
Uncle Chunt Youtube
Who is Uncle Chunt?
Merchunt
Let's Talk Games
Fear Factory – Genexus: Album Review
I know I have harped about this album a number of times already but I want people to know about it. I believe it is truly a testament to what Fear Factory is musically. It's a brilliant landmark for this band in my opinion
For those that have followed their albums and the concepts behind each one would understand how this one is almost a culmination of what has come before. Burton C. Bell was originally inspired by the first Terminator film which heavily influenced their break out album "Demanufacture". Ever since that album going on 20 years now, he has always instilled stories within the lyrics of Man vs Machine and what that means for humanity. These ideals are evident in most of their album art and if you look at them in order they tell a story of progression and change towards this singularity.
Now with Genexus their latest concept album, Burton has been reading a lot of Ray Kurzweil's work on "The Singularity", which is basically the era of when machines become sentient. Also Blade Runner and the Rutger Hauer character Roy Batty was a great influence for key elements of this journey. As much so that Rutger Hauger's improvised "tears in the rain" monologue in the aforementioned Blade Runner film features in the final and heart pounding, powerful track off the album "Expiration Date". At the launch party for this album they even had Blade Runner being viewed from a projector as the album played.
With standout tracks like "Anodized", "Soul Hacker", "Genexus", "Regenerate", "Battle for Utopia" and "Expiration Date" this is an audible journey that Fear Factory appears to have really outdone themselves with akin to the greatness that is the "Obsolete" album. Burton's haunting and eerie melodies are some of the cleanest I have heard. They set a mood for one that I can't quite describe but very much paints the picture of the world for this story.
The trademark riffage and tone from Dino Casarez is here in force and as great as ever. The intricate, catchy syncopation at work is true to form and supports a rhythm enhancing the story being told to us within each track. It is also great to hear for the most part they have live drums again which gives it the feel required that was missing from their last album, Transgression. Even with all the member changes over recent years and ex-member lawsuits, the fact this album is as great as it is, really is a marvel.
As a long time Fear Factory fan, their music has been the soundtrack to my life, so to have this album impress me on so many levels after 20 years only reinvigorates my love of their music and the band as a whole. If you haven't listened to Fear Factory before or missed a few albums, I can't recommend this album high enough. So far since release I've had repeat listens at least once or twice a day. This will be my go to album for some time.
By Uncle Chunt | August 23, 2015 | Uncategorized | No Comments |
← Batgirl: A Matter of Family DLC Review
CHUNT REACTS!! Star Wars: The Force Awakens →
Shout Outs & Highlights
Copyright ©2021 Uncle Chunt | Theme by: Theme Horse | Powered by: WordPress


The Magic Parlour is on summer HIATUS, returning in September 2016! Join us at Death & Harry Houdini, our magical hit play starring The Magic Parlour's Dennis Watkins. Runs May 12 - July 24.
Guests convene at Potter's on the lobby level and will be escorted to the private performance venue. The performance lasts approximately 75 minutes.
A sneak peek inside the Parlour!