In reply to dave_59:
Thanks Dave.
The ‘with’ trick seems to be fine. To meet my requirements I guess it should be modified a bit:
constraint c3 {
(pos.max() with (pos[item.index] - neg[item.index]) - neg.max() with (pos[item.index] - neg[item.index]))
- (pos.min() with (pos[item.index] - neg[item.index]) - neg.min() with (pos[item.index] - neg[item.index]))
<= relative_c; }
However, even modified the solution is getting a compile error. I think the issue is that min/max functions return a queue as a result, so it cant be used further in constraint. I have a min example on Eda Playground.