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

# <ConsistencyModule:> ?ExprX #= ?ExprY

ExprX is equal to ExprY.
ExprX
Integer arithmetic expression
ExprY
Integer arithmetic expression

## Description

Constrains ExprX and ExprY to be equal. Also constrains all variables appearing in ExprX and ExprY to be domain variables and checks that all constants and ground sub-expressions are integers.

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. Note that some operators (integer division, modulus) only support bounds consistency and will be propagated with bounds consistency even when posted with gfd_gac.

This constraint is implemented using Gecode's MiniModel's rel() for both integer and boolean expressions, with sub-expressions/constraints not supported by MiniModel factored out and posted as auxiliary constraints.

A more restricted version of this constraint is defined in the global constraint catalog as 'eq'. Here the constraint is defined between two domain variables rather than two expressions.

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

## Examples

```[eclipse 28]: A :: [1,3,5,7], A #= B.

A = A{[1, 3, 5, 7]}
B = B{[1 .. 7]}

[eclipse 29]: A :: [1,3,5,7], gfd_gac: (A #= B).

A = A{[1, 3, 5, 7]}
B = B{[1, 3, 5, 7]}

[eclipse 30]:  A :: [1,3,5,7], gfd_gac: ( A #= B + 1).

A = A{[1, 3, 5, 7]}
B = B{[0, 2, 4, 6]}

```