/* ancestor(Ancestor,Descendant) :- Ancestor is an ancestor of Descendant. */ ancestor(Ancestor,Descendant) :- parent(Ancestor,Descendant). ancestor(Ancestor,Descendant) :- parent(Ancestor,Person), ancestor(Person,Descendant). % Program 2.5: The ancestor relationship