CS323: Programming Languages and Methodologies


Homework #5
Due Friday, May 25

Write a Prolog program to solve the following puzzle.

There are five houses on a street, each a different color, inhabited by a person of a different nationality, with a differrent pet, drink, and musical instrument. Answer the following queries... Who owns the Zebra? Who drinks water?

a) The Englishman lives in the red house.
b) The Spaniard owns the dog.
c) Coffee is drunk in the green house.
d) The Ukranian drinks tea.
e) The green house is to the right of the white house.
f) The bouzouki player owns snails
g) The bodhran is played in the yellow house
h) Milk is the drink of the middle house.
i) The Norwegian lives in the first house on the left.
j) The bagpipes are played in the house next to the fox.
k) The bodhran is played in the house next to the horse.
l) The banjo player drinks orange juice.
m) The Japanese plays accordion.
n) The Norwegian lives next to the blue house.