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

atmost(+N, ?Vars, +V)

At most N elements of Vars have the value V.
An integer
A collection (a la collection_to_list/2) of domain variables or integers
An integer


This constraint ensures that at most N element of Vars have the value V. As soon as some domain variable from the collection is updated, this constraint is woken and it checks if the constraint is still satisfiable and if so, if it is already satisfied or not.

Fail Conditions

Fails if more than N elements of Vars are instantiated to V.

See Also

atleast / 3, occurrences / 3, lists : collection_to_list / 2