ligett (03/08/83)
We recently acquired CProlog. After trying out a few simple Prolog problems, I decided to try and solve the enclosed puzzle using Prolog. I've come to realize that I don't know enough about Prolog to do it. I'd like to see how an experienced Prolog programmer would solve it. Feel free to MAIL me any hints. I'll post a summary of any response I get. Thank you. ******************************************************************* (Who Owns the Zebra?) There are five houses, each of a different color and inhabited by men of different nationalities, with different pets, drinks and cigarettes. 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 (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. THE PROBLEM: Who owns the Zebra? Who drinks water? ******************************************************* Dan Ligett decvax!wivax!ligett Wang Institute, Tyngsboro MA 01879