father(paul, john); father(john, george); father(tom, mary); father(henk, martha); mother(mary, john); mother(martha, george); parent(X, Y) :- father(X, Y); parent(X, Y) :- mother(X, Y); grandfather(X) :- parent(Y, X), father(Z, Y), Z; ancient(X, Y) :- parent(X, Y); ancient(X, Y) :- parent(X, Z), ancient(Z, Y); allGf() :- Y = grandfather(X), write(Y +" is grandfather of "+X+nl()), fail; allAnc() :- ancient(X, Y), write(X +" is ancient of "+Y+nl()), fail; gfd(X) :- (father(Y,X) ## mother(Y,X)), father(Z,Y), Z;