ancestor(X,Y):-parent(X,Y).
ancestor(X,Y):-parent(X,Z),ancestor(Z,Y).

badancestor(X,Y):-parent(X,Y).
badancestor(X,Y):-badancestor(X,Z),parent(Z,Y).

parent(adam,caine).
parent(caine,enoch).
parent(enoch,irad).


