Challenge 3: What Happens Without label/1 — Possible Solution ==================================================================== Query, deliberately omitting label/1: ?- X in 1..9, Y in 1..9, X + Y #= 10. X in 1..9, Y in 1..9, X+Y#=10. -- Explanation -- -- -- Without label/1, the query reports back the CURRENT STATE OF THE -- CONSTRAINTS themselves -- the narrowed domains for X and Y, plus -- the constraint connecting them -- not a concrete pair of numbers. -- In this particular example the domains happen to stay 1..9 for -- both variables (X + Y #= 10 alone doesn't narrow either domain -- further without more constraints to combine it with), but even -- when propagation genuinely does shrink a domain down significantly -- (as in the chapter's own X #= Y + 1 example, where X's domain -- narrowed to 2..6), the result is still a RANGE, never a single -- committed value. This isn't yet a usable answer for anything -- expecting an actual number -- X and Y remain domain variables, -- constrained but not yet resolved. label([X, Y]) is the step that -- actually searches through the remaining possibilities and commits -- to one concrete pair at a time, which is why forgetting it is -- flagged as a common, easy-to-miss mistake. WHY THIS WORKS AS AN ANSWER ------------------------------ This runs the chapter's own example with label/1 deliberately removed, shows the resulting domain-only output rather than concrete numbers, and explains why that output -- even when propagation has narrowed the domains -- still isn't a usable final answer without the labeling step.