%Mini-Zebra Puzzle
%There are three houses in a row on street. 
%Each house is inhabited by a man of a different nationality, 
%who has a different pet, and drinks a different beverage.  
%The Spaniard own a dog.  The Ukranian drinks tea.  
%The man in the third house drinks milk.  
%The Norwegian lives next to the tea drinker.  
%The juice drinker owns a fox.  The fox is next door to the dog.  
%Question: Who owns the zebra? 

house(h1).        house(h2).        house(h3). 
next(h1,h2).      next(h2,h3)       next(h2,h1).       next(h3,h2). 


solution(Hmilk,Htea,Hjuice,Hdog,Hfox,Hzebra,Hspaniard,Hukranian,Hnorwegian):- 
   Hspaniard=Hdog, Hukranian=Htea, Hmilk=h3, 
   next(Hnorwegian,Htea), 
   Hjuice=Hfox, next(Hfox,Hdog), 
   house(Hmilk),         house (Htea),             house(Hjuice),
   house(Hdog),          house (Hfox),             house(Hzebra), 
   house(Hspaniard),     house(Hukranian),         house(Hnorwegian), 
   Hdog\=Hfox,           Hdog\=Hzebra,             Hfox\=Hzebra, 
   Hmilk\=Htea,          Hmilk\=Hjuice,            Htea\=Hjuice, 
   Hspaniard\=Hukranian, Hspaniard\=Hnorwegian, Hukranian\=Hnorwegian.