/* Filename: ancestor.pro Author: Br. David Carlson Date: December 6, 1999 This program creates a small set of facts and rules on who is the ancestor of whom. The user types the desired goal interactively when the program is run. */ /* Note that ancestor(A, B) means that A is an ancestor of B. */ ancestor(bob, susan). ancestor(A, X) :- parent(A, X). ancestor(A, X) :- parent(A, C), ancestor(C, X). /* Note that parent(P, C) means that P is a parent of C. */ parent(fred, sally). parent(tina, sally). parent(sally, john). parent(sally, diane). parent(sam, bill).