users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constraints order


From: Daniel Diaz
Subject: Re: constraints order
Date: Sat, 19 Mar 2005 12:41:04 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041122

A FD solver is not complete. This means that you can "trust" the value of a variable only when you enumerate it (using for instance fd_labeling). In the case of your constraint and since you have not defined initial domains for X and Y the solver will will take a long time to try each value for X and to see there is no good value for Y.


Michel Levy wrote:
I do not understand why these two requests have different answers :
| ?- X #\=Y, X #=Y.
X = _#2(0..268435455)
Y = _#21(0..268435455)
| ?-  X #=Y, X #\= Y.
no.
This contradicts the assumption that the order of the constraints is unimportant.

Furthemore, in the official documentation, I read :
fd_all_different(List) constrains all variables in List to take distinct values. This is equivalent to posting an inequality constraint for each pair of variables.

But this equivalence is no true :
| ?- X #=Y, fd_all_different([X,Y]).
X = _#0(0..268435455)
Y = _#0(0..268435455)
yes

Can you explain me the difference ?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]