Re: clpfd constraints not taking effect

Markus Triska <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi James,

James Hogan <[email protected]> writes:

> The last constraint doesn't seem to have taken effect B in 101..sup,
> but B < D, so D should be reduced to 102..sup.

Very well, I have committed a change that makes this and other cases
behave as you expect with the example above.

Note that in SWI-Prolog, CLP(FD) propagation always terminates, so you
still get for example:

   ?- X #> Y, Y #> X, X #> 0.
   %@ X in 3..sup,
   %@ X#=<Y+ -1,
   %@ Y#=<X+ -1,
   %@ Y in 4..sup.

In this case, since X #> Y, we could constrain X to 5..sup. Moving on,
since Y #> X, we could then constrain Y to 6..sup, then X to 7..sup etc.
In SWI-Prolog, each involved constraint now gets a new propagation
opportunity when a new constraint is added. When unbounded domains are
involved, infinite propagation chains are (as before) avoided by
imposing certain restrictions on admissible domain changes. So there
necessarily are examples where the solver does not propagate fully.

Please let me know how this works and whether you need anything else.

Thank you and all the best,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.