% An example based on p262 of Appleby 91 'Programming Lnguages' happy(X):-watching(X, football), has(X,supplies). has(X, supplies):-has(X,beer), has(X, pretzels). watching(X, football):-ison(X, tv), playing(cowboys). ison(tom, tv). playing(cowboys). has(tom,beer). has(tom,pretzels). has(dick,beer). has(harry,pretzels). ison(dick,tv). ison(joan,radio). has(joan,pretzels). has(joan,beer). :- write('happy(Person) is loaded'), nl. :- write('try queries like: happy(X). has(X,beer). has(tom, X). '),nl,nl.