Solutions


wizard(harry).
scare(hagrid,dudley).
magical(X) :- wizard(X).
hate(uncle_vernon,X) :- magical(X).
hate(aunt_petunia,X) :- magical(X).
hate(aunt_petunia,X) :- scare(X,dudley).

This is, of course, not the only solution. What your knowledge base looks like depends on the atoms that you choose to stand for certain individuals and properties. The first fact could, for example, also be encoded as
wizard('Harry').

or as

is_wizard(harry).


Last modified: Thu Dec 2 15:02:42 CET 2004