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

nvalue(??N, ??Vars)

The collection Vars contains N different values.
?N
An integer or variable
?Vars
A collection (a la collection_to_list/2) of domain variables or integers

Description

This constraint ensures that the collection Vars contains N different integer values. The value of N can therefore lie between 1 and the length of the list.

Behaviour: This implementation uses decomposition and guarantees neither bounds- or arc-consistency.

Fail Conditions

The collection contains too many or to few different values.

See Also

alldifferent / 2, atmost / 3, atleast / 3, occurrences / 3, eclipse_6 : collection_to_list / 2, lists : collection_to_list / 2