[ library(gfd) | Reference Manual | Alphabetic Index ]

<ConsistencyModule:> all_eq(?Collection,?Y)

Constrains Collection to be equal to Y.
Collection
Collection of integers or (domain) variables
Y
An integer or (domain) variable (array notation accepted)

Description

Constrains every element in Collection to be 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.

This constraint is known as arith (with the equal to relation) in the Global Constraint Catalog, and is implemented using Gecode's rel() constraint.

Examples

[eclipse 51]: all_eq([1,2,3,5], X).     % fail

[eclipse 52]: all_eq([1,1,1,1], X).

X = 1

[eclipse 53]: [X,Y] :: 0..10, Z :: 9..15, all_eq([X,Y,Z], A).

X = X{[9, 10]}
Y = Y{[9, 10]}
Z = Z{[9, 10]}
A = A{[9, 10]}

See Also

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