1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.

12 lines
472 B
MiniZinc

include "distribute.mzn";
/** @group globals.counting
Returns an array of the number of occurences of \a value[\p i] in
\a base. The values in \a value need not be distinct.
*/
function array[int] of var int: distribute(array[int] of var int: value,
array[int] of var int: base) :: promise_total =
let { array[index_set(value)] of var 0..length(base): card;
constraint distribute(card, value, base); }
in card;