fd_labeling/1 does not follow set constraints

Markus Morawitz <[email protected]>
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
Using the finite domain constraint solver of GNU Prolog version 1.2.16
on a Mac OS X 10.4.4 PPC machine the behaviour of fd_labeling/1
seems to be not correct with respect to constraints set up prior
using fd_labeling/1.

At least the behaviour is different if the sequence of goals is  
different
with respect to fd_labeling.

The following sequence of goals generates the expected answer:

| ?- fd_domain([X,Y],1,3),fd_labeling([X,Y]),fd_all_different([X,Y]).
X = 1
Y = 2 ? a

X = 1
Y = 3

X = 2
Y = 1

X = 2
Y = 3

X = 3
Y = 1

X = 3
Y = 2

(1 ms) no
| ?-

Changing the sequence of the two last goals not all
possible combinations of values for X and Y are generated.
Even more fatal: one combination is generated which
is forbidden by the constraint.

| ?- fd_domain([X,Y],1,3),fd_all_different([X,Y]),fd_labeling([X,Y]).

X = 1
Y = 2 ? a

X = 1
Y = 3

X = 2
Y = 3

X = 3
Y = 3

(1 ms) yes
| ?-

Markus Morawitz
[email protected]
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.