Constraint to generate an array of random numbers where a certain value is repeated fixed number of times

In reply to JGu:

You want count the number of time (item == 10). The result of that expression is a single bit, so you need to cast that equality to a wider result.

arr.sum(item) with (int'(item == 10)) == 5;