A.8.17.2 Membership constraints
If you are using CLP(FD) to model and solve combinatorial tasks, then you typically need to specify the admissible domains of variables. The membership constraints in/2 and ins/2 are useful in such cases.
- ?Var in +Domain
- Var is an element of Domain. Domain is
one of:
- Integer
- Singleton set consisting only of Integer.
- Lower .. Upper
- All integers I such that Lower
=<
I=<
Upper. Lower must be an integer or the atom inf, which denotes negative infinity. Upper must be an integer or the atom sup, which denotes positive infinity. - Domain1
\/
Domain2 - The union of Domain1 and Domain2.
- +Vars ins +Domain
- The variables in the list Vars are elements of Domain. See in/2 for the syntax of Domain.