In reply to warnerrs:
Thanks for your reply.
I am not trying to sum all the columns. Here is my complete constraint.
constraint constraint_c3_c {
foreach(pipe[i,j]){
foreach(pipe[k,l]){
if(({i,j} != {k,l}) && (pipe[i][j] == pipe[k][l])) {
//if((i+sumUntil(i,j)) >= (k+sumUntil(k,l))) {
// i+sumUntil(i,j) >= (k+sumUntil(k,l))+int'(pipe[i][j]);
//}else {
// i+sumUntil(i,j)+int'(pipe[i][j]) <= (k+sumUntil(k,l));
//}
if(i+pipe[i].sum with (item.index < j) >= (k+pipe[k].sum with (item.index < l))) {
i+pipe[i].sum with (item.index < j) >= k+pipe[k].sum with (item.index < l);
}else {
i+pipe[i].sum with (item.index < j) +int'(pipe[i][j]) <= k+pipe[k].sum with (item.index < l);
}
}
} }
}
Its basically adding a subset of the array together. The solver hangs if I use commented portion instead.