Where is Zebra?

Problem Description. There are five houses.

  1. The Englishman lives in the red house.
  2. The Spaniard owns the dog.
  3. Coffee is drunk in the green house.
  4. The Ukrainian drinks tea.
  5. The green house is immediately to the right of the ivory house.
  6. The Old Gold smoker owns snails.
  7. Kools are smoked in the yellow house.
  8. Milk is drunk in the middle house.
  9. The Norwegian lives in the first house.
  10. The man who smokes Chesterfields lives in the house next to the man with the fox.
  11. Kools are smoked in the house next to the house where the horse is kept.
  12. The Lucky Strike smoker drinks orange juice.
  13. The Japanese smokes Parliaments.
  14. 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:

THE END