Help with backtracking with CLPFD

Ok so I solved this finally here:

It can’t be done the way I suggest previously because its just not how clpfd works. I’ve found it much simpler to think about clpfd in terms of domains. I.e. what domains do I start with? How are they changed by the code to give me an answer at the end? The enumeration of domains is not important: its just enumeration.

I see now why “constraints” are incidental really, and why therefore you can define your own constraints: what matters is the domain they imply for the result. For example, say I have a domain such that X in 1…10, if I want a domain which is offset by 5 I could write 5…15, or I can write:

X in 1..10, Z #= X + 5, fd_dom(Z,Y).

The implication of the constraint above is entirely contained in the domain Y.