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

<ConsistencyModule:> alldifferent_cst(+Vars,++Offsets)

The values of each element plus corresponding offset are pair-wised different.
Vars
A collection (a la collection_to_list/2) of variables or integers
Offsets
A collection (a la collection_to_list/2) of integers, with the same cardinality as Vars.

Description

Constrains all elements of Vars plus its corresponding offset value in Offset to be different. That is,

        Vari + Offseti #\= Varj + Offsetj, i #\= j
where Vari, Offseti are the i'th element of Vars and Offsets, and Varj, Offsetj are the j'th element.

This constraint is also known as alldifferent_cst in the global constraints catalog, and is implemented using Gecode's distinct() constraint.

ConsistencyModule is the optional module specification to give the consistency level for the propagation for this constraint: gfd_vc for value consistency (naive), gfd_bc for bounds consistency, and gfd_gac for domain (generalised arc) consistency.

See Also

alldifferent / 1, eclipse_6 : collection_to_list / 2, lists : collection_to_list / 2