Item.index usage in constraints

In reply to kernalmode1:

The problem with your constraint on cnum is that there is no constraint on any element. The expression
cnum.sum with (int’(item.index<3?1:0))
has a constant value 3. It would easier to do what you want using
and
reduction.

cnum.and with (item.index<3?item:!item));

BTW, always test the result of calling randomize().