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

?Vars :: ++Lo..Hi

Constrain Vars to the 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 values between and including Lo and Hi. The type of the bounds determines the type of the variable (real or integer). It is possible to use the bounds -inf (or -1.0Inf) and inf (or 1.0Inf) to represent infinities. This is the default range used for variables where no range has been declared. Operationally: This information is immediately stored into the variable's attribute. The bounds are also widened by one float below and above to ensure the bounds are included in the range.

Exceptions

(5) type error
Lo and Hi are not both floats or integers
(4) instantiation fault
Second argument is a variable.

Examples

[eclipse 18]: A::1.0..3.2.

A = A{0.99999999999999989 .. 3.2000000000000006}
yes.
[eclipse 19]: A::1..4.

A = A{1 .. 4}
yes.
[eclipse 21]: A :: 1 .. -2.

no (more) solution.
[eclipse 23]: A::1..2.0.
type error in A :: 1 .. 2.0000000000000004

See Also

suspend : :: / 2, fd : :: / 2, range : :: / 2, eplex : :: / 2, fdplex : :: / 2, fd_sets : :: / 2, range_eplex : :: / 2, ic : :: / 2, ic_sets : :: / 2, range : integers / 1, range : reals / 1