What's new
New constraints (MiniZinc compatibility)
-
CountConstraint — count(vars, value) <op> n: counts occurrences of a specific value across a set of variables and compares to a bound. Generalises AtLeastN/AtMostN to any domain type. Demo: AustraliaMapColouringTest finds colorings with exactly 3 RED territories.
-
NaryTuplesConstraint — table(vars, tuples): the combined assignment of variables must match one of a set of allowed Assignment tuples. Variable order is irrelevant; all tuples must share exactly the same variable set (validated at construction). Demo: MenuCombinationTest selects valid three-course menus from an explicit compatibility table.
-
BinaryElementConstraint — result = array[index]: 1-based array lookup with a variable index. Out-of-bounds indices violate the constraint. Equivalent to MiniZinc's element(i, array, result). Demo: TwoSumTest finds index pairs where array[i] + array[j] == 9.
New csp builder methods
csp.countConstraint(Set.of(v1, v2, v3), value, Operator.EQ, 2)
csp.tuplesConstraint(Set.of(Assignment.of(...), ...))
csp.elementConstraint(index, result, array)