
Problem Description. There are five houses.
- The Englishman lives in the red house.
- The Spaniard owns the dog.
- Coffee is drunk in the green house.
- The Ukrainian drinks tea.
- The green house is immediately to the right of the ivory house.
- The Old Gold smoker owns snails.
- Kools are smoked in the yellow house.
- Milk is drunk in the middle house.
- The Norwegian lives in the first house.
- The man who smokes Chesterfields lives in the house next to the man with the fox.
- Kools are smoked in the house next to the house where the horse is kept.
- The Lucky Strike smoker drinks orange juice.
- The Japanese smokes Parliaments.
- The Norwegian lives next to the blue house.
Question: where is Zebra?
Implementation. Let’s start with a business glossary:

Here is the corresponding data (test case):

Here are two main tables “Define” and “Solve”:

The following tables defines variables with domains from 1 to 5 specifying yet unknown house numbers:

The following table defines expressions needed to express problem constraints:

This table defines constraints that will be posted later:

And now we are ready to post all constraints:

As you can see, we used here different constraint types: VarOperVar, VarOperValue, Or, AllDiff.
After a double-click on “test.bat”, we will receive the following results:
- Green[5] Ivory[4] Blue[2] Red[3] Yellow[1]
- Norwegian[1] Ukrainian[2] Japanese[5] Englishman[3] Spaniard[4]
- Juice[4] Tea[2] Milk[3] Water[1] Coffee[5]
- Snail[3] Dog[4] Fox[1] Horse[2] ZEBRA[5]
- Chesterfield[2] Parliament[5] Lucky[4] OldGolds[3] Kools[1]
- House Right of Ivory[5] House Right of Fox[2] House Left of Fox[0] House Right of Horse[3] House Left of Horse[1] House Right of Blue[3] House Left of Blue[1]
- Zebra lives in the House# 5
THE END
