[ library(fd_global) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]
alldifferent(+List)
All members of List are different
Description
All members of List are different. This is an implementation with
the same semantics but with stronger propagation behaviour.
It checks for exhaustion of all sub-ranges of possible values.
Examples
?- length(Xs,5), Xs::1..4, alldifferent(Xs).
no (more) solution.
?- [X1,X2]::1..2, [X3,X4,X5]::1..5, alldifferent([X1,X2,X3,X4,X5]).
X1 = X1{[1, 2]}
X2 = X2{[1, 2]}
X3 = X3{[3..5]}
X4 = X4{[3..5]}
X5 = X5{[3..5]}
Delayed goals:
alldifferent([X1{[1, 2]}, X2{[1, 2]}], 1)
alldifferent([X3{[3..5]}, X4{[3..5]}, X5{[3..5]}], 1)
See Also
alldifferent / 1, alldifferent / 2