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

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
Postive integer
Vars
A list of variables or integers
Values
A list 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.

This is currently a prototype -- the constraint has not been tested very extensively and little effort has been spent to optimise performance. We welcome any feedback on using this constraint.

This constraint is known as among_seq in the global constraint catalog. The algorithm implemented is described in M. Maher et al.'s paper 'Flow-Based Propagators for the SEQUENCE and Related Global Constraints' in CP'2008.

See Also

sequence / 4, ic : element / 3, ic_global : sequence_total / 6, ic_global : sequence_total / 7