Challenge 1: max/3 With Cut, Confirmed No Second Answer — Possible Solution ==================================================================== max_demo.pl: max(X, Y, X) :- X >= Y, !. max(X, Y, Y). Query: ?- max(3, 5, Result). Result = 5. Pressing ; after the first answer: Result = 5. false. Explanation: For max(3, 5, Result), the first clause's guard X >= Y becomes 3 >= 5, which is false -- so the first clause fails BEFORE it ever reaches its own cut, and Prolog moves on to the second clause, succeeding with Result = 5. Since the cut was never actually reached in this particular call, it had nothing to prune here -- but the important part is that pressing ; afterward correctly reports no further solutions (false), confirming there genuinely is only one correct maximum, not that the cut accidentally suppressed a real alternative. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses the chapter's own max/3 definition exactly, confirms the correct single answer, and explicitly checks via ; that no incorrect second solution is offered, directly demonstrating the predicate's correctness.