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.

10 lines
294 B
MiniZinc

include "among.mzn";
/** @group globals.counting
Returns the number of variables in \a x that take one of the values in \a v.
*/
function var int: among(array[int] of var int:x, set of int:v) :: promise_total =
let { var 0..length(x): n;
constraint among(n,x,v); }
in n;