git-subtree-dir: software/mza git-subtree-split: f970a59b177c13ca3dd8aaef8cc6681d83b7e813
14 lines
538 B
MiniZinc
14 lines
538 B
MiniZinc
include "fzn_global_cardinality.mzn";
|
|
include "fzn_global_cardinality_reif.mzn";
|
|
|
|
/** @group globals.counting
|
|
Requires that the number of occurrences of \a cover[\p i] in \a x is \a counts[\p i].
|
|
*/
|
|
predicate global_cardinality(array[int] of var int: x,
|
|
array[int] of int: cover,
|
|
array[int] of var int: counts) =
|
|
assert(index_set(cover) = index_set(counts),
|
|
"global_cardinality: cover and counts must have identical index sets",
|
|
fzn_global_cardinality(x, cover, counts)
|
|
);
|