PROJECT 1: Who owns the Zebra?

(From Sterling and Shapiro.)

Due:Thursday, 15 February.

There are five houses each of a different color (red, green, ivory, blue, and yellow) and inhabited by a man of a different nationality (Japanese, Englishman, Norwegian, Ukrenian, and Spaniard), with a different pet (horse, snails, zebra, fox, and dog), drink (water, coffee, tea, milk, and orange juice) and brand of cigarettes (Lucky stripe, Winston, Chesterfields, Kools, and Parliaments). Following is the available information.

  1. The Englishman lives in the red house.
  2. The Spaniard owns the dog.
  3. Coffee is drunk in the green house.
  4. The Ukranian drinks tea.
  5. The green house is immediately to the right (your right) of the ivory house.
  6. The Winston 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 on the left.
  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.
Write an Smodels program that reasons with the available information and finds out who owns the zebra and who drinks water? Submit your Smodels program with comments.

To help you check your answer, the Smodels program should give the following assignment as its only answer set.

positioncolornationalitysmokesdrinkspet
1 (leftmost) yellow Norwegian Kools water fox
2 blue Ukrainian Chesterfields tea horse
3 red Englishman Winston milk snails
4 green Japanese Parliaments coffee zebra
5 (rightmost) ivory Spaniard Lucky stripe orange juice dog