Issue with following dist Constraint

In reply to ABD_91:

Your assumption is correct. For iterative constraints, each iteration gets ANDed together. For the simple case you can use a reduction or instead of foreach

constraint c_value { a.or() with (value inside { [a[i]:b[i]] } ); }

Applying weights from a variable sized array can get complicated. You might try

constraint c_value { a.or() with ( (value inside { [a[i]:b[i]] } ) dist {0:= c.sum(), 1:=c[i]} );  }

I didn’t verify the code or the math, but that might get you going in the right direction. You can also look at this link.