Author: *Markus Triska*

The `library(clp/clp_distinct)`

module provides the
following constraints:

**all_distinct**(`+Vars`)-
The variables in
`Vars`are constrained to be pairwise distinct. All variables must already be assigned domains (via vars_in/2 or vars_in/3) when this constraint is posted. **vars_in**(`+Vars, +Domain`)-
Where
`Vars`is a list of variables and`Domain`is a list of non-negative integers. Each variable of`Vars`is constrained to be in`Domain`. **vars_in**(`+Vars, +From, +To`)-
Where
`Vars`is a list of variables, and`0 < From < To`. Each variable in`Vars`is constrained to be in the discrete interval [From,To].

?- vars_in([X,Y,Z], [1,2]), all_distinct([X,Y,Z]). No

?- vars_in([X,Y], [1,2]), vars_in([Z], [1,2,3]), all_distinct([X,Y,Z]). X = _G180{1-2} Y = _G183{1-2} Z = 3 ;

:- use_module(library(bounds)). :- use_module(library(clp_distinct)). ?- [X,Y] in 1..2, vars_in([X,Y], [1,2]), all_distinct([X,Y]), label([X,Y]). X = 1 Y = 2 ; X = 2 Y = 1 ;