Constraint for array of 10 elements in which first 5 elements are in increment in nature and next 5 elements are in decrementing nature

In reply to Rahulkumar:

Thanks Rahul, for the logic and also i tried to modify with if - else case from your logic which is also working.For which i have taken fixed array of 10 elements so i tried with 5 elements increment and next 5 elements with decrement order.

like : constraint c1 {
foreach(arr[i]) { if(i < 5)
arr[i] < arr[i+1];
else
arr[i] > arr[i+1];}
}