Challenge 2: A Recursive ancestor/2 Spanning Three Generations — Possible Solution ==================================================================== family.pl: parent(george, susan). parent(susan, tom). parent(tom, alice). ancestor(X, Y) :- parent(X, Y). ancestor(X, Y) :- parent(X, Z), ancestor(Z, Y). Query: ?- ancestor(george, alice). true. Explanation: george is not alice's direct parent, so the base case (ancestor(X, Y) :- parent(X, Y)) does not match directly for ancestor(george, alice). The recursive case fires instead: parent(george, Z) binds Z = susan, and the rule then needs ancestor(susan, alice) to also hold. THAT itself isn't a direct parent relationship either, so the recursive case fires AGAIN: parent(susan, Z2) binds Z2 = tom, requiring ancestor(tom, alice) -- which now genuinely IS a direct parent fact, satisfying the base case at last. The recursion "unwinds" back up through each level, confirming ancestor(george, alice) overall, exactly the kind of multi-generation reach the chapter's own base-case/recursive-case shape is designed to handle. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses the chapter's own recursive ancestor/2 definition over a genuine three-generation gap (requiring the recursive case to fire twice before the base case resolves it), confirming the recursion correctly reaches beyond a single generation.