/* after opening this file, resave it as promotes.pro */ /* person1 likes person2 */ /* john likes mary */ likes(john, mary). /* likes is a predicate */ /* john and mary are constants */ /* upper case indicates variables */ /* facts are headless Horn clauses */ tall(troy). short (sarah). tall (alex). short (sean). /* command to load code stored on disk */ /* is consult('filename.pro'). *. /* filename can't be more than 8 characters long */ /* stupid rule - doesn't do what we want */ loves (Male, Female) :- likes (Female,Male). /* mother (mother,child) */ mother(sarah,jane). /* father (father, child) */ /* parent (parent, child ) :- mother (parent,child). */ parent (Parent,Child) :- mother (Parent,Child). parent(Parent, Child) :- father (Parent,Child). mother (margie, paul). mother(sandra, sam). mother (dolly, joe). father (jack, billy). father(jack, sam). father(paul, joe). /* married (man, woman) :- mother(woman,child) , father (man, child) */ married (M,W) :- mother (W,C), father (M,C).