[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## fd_labeling/1 does not follow set constraints

**From**: |
Markus Morawitz |

**Subject**: |
fd_labeling/1 does not follow set constraints |

**Date**: |
Mon, 23 Jan 2006 00:02:38 +0100 |

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
address@hidden

[Prev in Thread] |
**Current Thread** |
[Next in Thread] |

**fd_labeling/1 does not follow set constraints**,
*Markus Morawitz* **<=**