
son_of(Parent,Son) :- parent_of(Son,Parent), male(Son).
parent_of(Child,Parent) :- father_of(Child,Parent).
parent_of(Child,Parent) :- mother_of(Child,Parent).
grandparent_of(Grandchild,Grandparent) :-
parent_of(Grandchild,Parent), parent_of(Parent,Grandparent).
:-assert((father_of(fred,tom))).
:-assert((father_of(lisa,tom))).
:-assert((mother_of(fred,jill))).
:-assert((mother_of(lisa,jill))).
:-assert((father_of(tom,john))).
:-assert((father_of(jill,henry))).
:-assert((male(fred))).
:-assert((male(tom))).
:-assert((male(henry))).
:-assert((female(lisa))).
:-assert((female(jill))).
