Different version of Einstein Riddle

You can also put freeze/1 around the inequality tests, and move the rules that instantiate the possibilities to the end.
That’s what I meant by delayed-test&generate vs generate&test … the delayed tests “fire” as values get instantiated, which can often remove large parts of the search space. CLP(FD) goes further, by actively propagating constraint information, e.g. all_distinct/1.

1 Like