a. b. d. y. fatherOf(a,y). fatherOf(a,'YYYYY'). motherOf(a,bfff). motherOf(d,bddd). motherOf(d,bccc). motherOf(d,b). q(_,q). q(_,b). q(1,2,3). parentOf(X,Y) :- motherOf(X,Y) ; fatherOf(X,Y). ancestor(X,Y) :- motherOf(X,Y) ; fatherOf(X,Y); fatherOf(X,Z),fatherOf(Z,Y). child(X) :- motherOf(X,_);fatherOf(X,_). dog(fido). dogx(fido,2,as,4,3). goodQ(mother(a,B)). happy(X) :- \+ X=3.