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 shashikanth123:


constraint c1 {
foreach(arr[i]) { if(i < 5)
arr[i] < arr[i+1];
else
arr[i] > arr[i+1];}   // for i = 9 this arr[i+1]=arr[10] will go outside of array size 
}