parent(bill,mary).
parent(mary,john).
parent(john,jack).

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



