libminizinc
libminizinc copied to clipboard
Standard library does not support set counting
I noticed that the standard library does not support set counting. As this might be an inadvertent omission, I thought it might be worth reporting it.
I pushed a fix but I'm not 100% sure it's for the issue you're reporting. The fix addresses the problem that the following code didn't work:
var set of 1..10: x;
var int: i ::output = count(j in x)(j <= 5);
Is that the problem you found, or is some other counting function missing?
Consider this example:
int: N = 10;
array [1..N] of var set of 1..N: x;
var set of 1..N: y;
var 1..N: c;
constraint count_eq(x, y, c);
Running minizinc for Gecode results in this error message:
Error: type error: no function or predicate with this signature found: `count_eq(array[int] of var set of int,var set of int,var int)'