Challenge 2: Progressively Refining a Partially-Bound Term — Possible Solution ==================================================================== SWI-Prolog session: ?- pair(X, Y) = pair(f(Z), 10), Z = 42. X = f(42), Y = 10, Z = 42. Explanation: The first goal, pair(X, Y) = pair(f(Z), 10), unifies X with f(Z) -- a compound term that ITSELF still contains the unbound variable Z -- and unifies Y directly with 10. At this point X is only PARTIALLY known: it's "f of something," but that something isn't concrete yet. The second goal, Z = 42, then unifies Z with 42. Because X was bound to f(Z) (not a copy of Z's value at that moment, but a genuine reference to the same variable), binding Z retroactively completes X's own value too -- X now reports as f(42), fully resolved, even though it was only ever unified once, before Z had a value at all. WHY THIS WORKS AS AN ANSWER ------------------------------ This reproduces the chapter's own f(X, Y) = f(g(Z), 5), Z = 3 example with a renamed structure, confirming the exact "partially bound, later completed" behavior the chapter names as having no Haskell pattern- matching equivalent.