The Zebra Puzzle
- There are five houses.
- The Englishman lives in the red house.
- The Spaniard owns the dog.
- The Japanese is an artist.
- The Italian drinks tea.
- The Norwegian lives in the first house (in the leftmost).
- Coffee is drunk in the green house.
- The green house is immediately to the right of the white house (right means your right.).
- The sculptor owns snails.
- The diplomat's house is yellow.
- Milk is drunk in the middle house.
- The Norwegian lives next to the blue house.
- The violinist drinks orange juice.
- The doctor lives in the house next to the man with the fox.
- The diplomat's house is next to the house where the horse is kept.
- Now, who drinks water? Who owns the zebra?
In the interest of clarity, it must be added that each of the five houses is painted a different color, and their inhabitants are of different national extractions, own different pets, drink different beverages and have different professions.
Its solution in Prolog