% Prolog of Problem 8.14 in AI book %Some statements to suppress stupid warnings about facts and rules being separated. :- discontiguous male/1. :- discontiguous female/1. :- discontiguous child/2. :- discontiguous spouse/2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Rules of how kinship relationship works % This is where you encode your FOL statements about kinship. Here, I'll give you one freebie %Sibling relationship was not listed in book but is also required to define the given predicates % FOPL: Sibling(x,y) ⇔ ∃p Child(x,p)∧Child(y,p) sibling(X,Y) :- child(X,P), child(Y,P), X\=Y. %%%%% Partial fact base for problem 8.14 kinship %%%%% child(william,diana). child(william,charles). spouse(diana,charles). etc etc etc