[ library(range) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

?Vars #:: ++Lo..Hi

Constrain Vars to the integer interval between Lo and Hi.
Vars
Variable or list of variables
Lo..Hi
Lo, Hi are integers

Description

Logically: Constrain a variable (or all variables in a list) to take only integer values in a given range. Lo and Hi must be integers or the symbolic bound values inf, +inf and -inf. For instance

X #:: 0..1        % boolean
X #:: -1..5       % integer between -1 and 5
X #:: 1..inf      % strictly positive integer
X #:: 0.0..10.0   % type error
X #:: 1.5..3.7    % type error
X #:: 0.0..inf    % positive integer
X #:: 0.0..5      % integer between 0 and 5

Operationally, the range and type (integer) information is immediately stored into the variable's attribute.

Exceptions

(5) type error
Lo or Hi are not integers.

See Also

suspend : #:: / 2, fd : #:: / 2, fdplex : #:: / 2, ic : #:: / 2, :: / 2, $:: / 2, integers / 1, reals / 1