====== Ancestor ====== {{tag>family recursion}} ===== Description ===== The ancestor relationship. **Source**: The Art of Prolog ===== Download ===== Program source code: {{ancestor.pl}} ===== Listing ===== /* 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 ===== Comments =====