Availability:

`:- use_module(library(clpfd)).`

**global_cardinality**(

`+Vs, +Pairs, +Options`)

`Vs`is a list of finite domain variables,

`Pairs`is a list of Key-Num pairs, where Key is an integer and Num is a finite domain variable. The constraint holds iff each V in

`Vs`is equal to some key, and for each Key-Num pair in

`Pairs`, the number of occurrences of Key in

`Vs`is Num.

`Options`is a list of options. Supported options are:

**consistency**(`value`)- A weaker form of consistency is used.
**cost**(`Cost, Matrix`)`Matrix`is a list of rows, one for each variable, in the order they occur in`Vs`. Each of these rows is a list of integers, one for each key, in the order these keys occur in`Pairs`. When variable v_i is assigned the value of key k_j, then the associated cost is`Matrix`_{ij}.`Cost`is the sum of all costs.