defprolog

( iright X Y List )

( iright Y X List )

nextto X Y List

(defprolog iright Left Right [Left Right | Rest] <--; Left Right [_ | Rest] <-- (iright Left Right Rest)

(defprolog member X [X | _] <--; X [_ | Y] <-- (member X Y)

(defprolog p= Xs Xs <--

(defprolog zebra H W Z \\ Each house is of the form: \\ (house nationality pet cigarette drink house-color) <-- (p= H [[house norwegian _ _ _ _] _ [house _ _ _ milk _] _ _]) \\9 (member [house englishman _ _ _ red] H) \\2 (member [house spaniard dog _ _ _] H) \\3 (member [house _ _ _ coffee green] H) \\4 (member [house ukrainian _ _ tea _] H) \\5 (iright [house _ _ _ _ ivory] \\6 [house _ _ _ _ green] H) (member [house _ snails winston _ _] H) \\7 (member [house _ _ kools _ yellow] H) \\8 (nextto [house _ _ chesterfield _ _] \\11 [house _ fox _ _ _] H) (nextto [house _ _ kools _ _] [house _ horse _ _ _] H) (member [house _ _ luckystrike oj _] H) (member [house japanese _ parliaments _ _] H) \\13 (nextto [house norwegian _ _ _ _] \\14 [house _ _ _ _ blue] H) \\15 (member [house W _ _ water _] H) \\Q1 (member [house Z zebra _ _ _] H)