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

<ConsistencyModule:> sequence(+Low,+High,+K,+Vars,++Values)

The number of values taken from Values is between Low and High for all sequences of K variables in Vars.
Low
Non-negative integer
High
Positive integer
K
Positive integer
Vars
A collection of (domain) variables or integers
Values
A collection of (different) integers

Description

This constraint ensures that the number of values taken from the set specified in Values is at least Low and at most High for all sequences of K consecutive variables/values in Vars.

ConsistencyModule is the optional module specification to give the consistency level for the propagation for this constraint: gfd_gac for generalised arc consistency (domain consistency).

This constraint is known as among_seq in the global constraint catalog, and is implemented using Gecode's sequence() constraint.

Examples

[eclipse 22]: sequence(1,2,4,[9,2,4,5,5,7,2], [0,2,4,6,8]). % Succeed

See Also

sequence / 4, fd_global_gac : sequence / 5, ic_global_gac : sequence / 5