[ library(ic) | Reference Manual | Alphabetic Index ]
# $::(?Var, ++Domain, ?Bool)

Reflect into Bool the truth of Var having the domain Domain. Does not impose integrality.
*Var*
- Variable
*Domain*
- Domain specification
*Bool*
- Reified truth value

## Description

Provides a reified form of the $::/2 domain assignment predicate. This
reified $::/3 is defined only to work for one variable and real
variables (unlike ::/3), hence only the Domain formats suitable for
reals may be supplied to this reified $::/3.

For a single variable, V, the Bool will be instantiated to 0 if the
current domain of V does not intersect with Domain. It will be
instantiated to 1 iff the domain of V is wholly contained within Domain.
Finally the Boolean will remain an integer variable in the range 0..1, if
neither of the above two conditions hold.

Instantiating Bool to 1, will cause the constraint to behave exactly like
$::/2. Instatiating Bool to 0 will cause a set of delayed goals to
excluded the range from the domain of the variable where such an
exclusion is representable.

Note that calling the reified form of $:: will NOT result in the Variable
becoming constrained to be integral, even if domain contains only integers.

Further note that, like other reified predicates, $:: can be used infix in
an IC expression, e.g. B #= (X $:: [1..10]) is equivalent to
$::(X, [1..10], B).

## Examples

[eclipse 2]: $::(X, 1..30,1).
X = X{1.0 .. 30.0}
Yes (0.00s cpu)
[eclipse 3]: $::(X, [1..10, 12..30],0).
Abort
type error in $::(X, [1 .. 10, 12 .. 30], 0)
[eclipse 4]: $::(X, 1.0..30.0,B).
X = X{-1.0Inf .. 1.0Inf}
B = B{[0, 1]}
There are 3 delayed goals.
Yes (0.00s cpu)

## See Also

integers / 1, reals / 1, suspend : $:: / 2, eplex : $:: / 2, $:: / 2, :: / 3