Collection_Index = Valuethe domain of the other variable is updated accordingly. Index starts from 1.
Note that unlike the element constraint in IC, the values in Collection can be domain variables as well as integers. Also note that the actual Gecode constraint has an index that starts from 0 - a dummy element is added to start of Collection to map Index to ECLiPSe style index starting from 1. A version of this constraint that uses the native Gecode indexing is element_g/3.
This constraint can be embedded in a constraint expression in its functional form (without the last argument).
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 element in the global constraint catalog, and is implemented with Gecode's element() constraint.
[eclipse 2]: element(I, [1,3,6,3], V). I = I{[1 .. 4]} V = V{[1, 3, 6]} [eclipse 2]: element(I, [1,3,6,3], V), V #\= 3. I = I{[1, 3]} V = V{[1, 6]} [eclipse 2]: X :: [1..10], gfd_gac: element(I, [1,X,6,3], V), V #\= 3. Z = Z{[1 .. 10]} I = I{[1 .. 3]} V = V{[1, 2, 4 .. 10]}