Use
constraint c_sum {array.sum() < 2345;}
You may want to use int unsigned if you do not want to consider negative numbers in the array.
Use
constraint c_sum {array.sum() < 2345;}
You may want to use int unsigned if you do not want to consider negative numbers in the array.