[ library(gfd) | Reference Manual | Alphabetic Index ]
# <ConsistencyModule:> all_le(?Collection,?Y)

Constrains all in Collection to be less than or equal to Y.
*Collection*
- Collection of integers
or (domain) variables
*Y*
- An integer or (domain) variable (array notation accepted)

## Description

Constrain every element in Collection to be less than or equal to Y.
ConsistencyModule is the optional module specification to give the
consistency level for the propagation for this constraint:
gfd_bc for bounds consistency, and gfd_gac for domain (generalised
arc) consistency.

The constraint is known as arith (with the less than or equal
relation) in the Global Constraint Catalog.This constraint
is implemented using Gecode's rel() constraint.

## Examples

[eclipse 2]: all_le([X,Y,Z],3).
X = X{[-1000000 .. 3]}
Y = Y{[-1000000 .. 3]}
Z = Z{[-1000000 .. 3]}
[eclipse 3]: [X,Y] :: 1..10, Z :: 2..5, A :: [1,3..5], all_le([X,Y,Z], A).
X = X{[1 .. 5]}
Y = Y{[1 .. 5]}
Z = Z{[2 .. 5]}
A = A{[3 .. 5]}
[eclipse 4]: all_le([2,3,4], 3). % fail

## See Also

#=< / 2, all_lt / 2, all_gt / 2, all_ge / 2, all_ne / 2, all_eq / 2