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

?Vars $:: ++Lo..Hi

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

Description

Logically: Constrain a variable (or all variables in a list) to take only real values in a given range. Unlike (::)/2, the type of bounds does not determine the type of the variable. Also allowed are the symbolic bound values inf, +inf and -inf. For instance

X $:: 0..1        % real between 0.0 and 1.0
X $:: -1..5       % real between -1.0 and 5.0
X $:: 1..inf      % strictly positive real >= 1.0
X $:: 0.0..10.0   % real between 0.0 and 10.0
X $:: 1.5..3.7    % real between 1.5 and 3.7
X $:: 0.0..inf    % positive real
X $:: 0.0..5      % real between 0.0 and 5.0

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

See Also

suspend : $:: / 2, eplex : $:: / 2, range_eplex : $:: / 2, ic : $:: / 2, :: / 2, #:: / 2, integers / 1, reals / 1