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

<ConsistencyModule:> element_g(?Index, ++List, ?Value)

Value is the Index'th element of the integer list List, with native Gecode indexing.
?Index
A (domain) variable or an integer.
+Collection
A non-empty collection of integers or (domain) variable.
?Value
A (domain) variable or an integer (array notation accepted).

Description

This version of element/3 uses the native Gecode indexing, which starts from 0, i.e. the first element of Collection has index 0. This is different from normal ECLiPSe's indexing, which starts from 1.

This predicate maps directly to Gecode's native implementation of the constraint, and may therefore be more efficient, but could also be incompatible with existing ECLiPSe code.

This constraint can be embedded in a constraint expression in its functional form (without the last argument).

See element/3 for a more detailed description of this predicate.

Fail Conditions

Fails if Value is not the Index'th element of Collection.

See Also

element / 3