In reply to Have_A_Doubt:
In reply to Alokpati:
Shouldn’t there be an additional constraint to ensure d’s value is within arr ?
constraint INSIDE { d inside { arr } ; }
It will work as solver should take care of it to satisfy the constraint.
Adding additional constraint on ‘d’ may help solver to solve constraint fast.
arr[i]==d // it will force RHS to be equal to LHS, and 'd' doesn't have any constraint so it will work