In AIMMS, how do I do the following:
This is my constraint:

Which I'm trying to put into an AIMMS constraint:

Clearly, there is a contradiction:
In the mathematical summation, we sum (e.g. in the second summation expression) from j=1,...,p-1 and we have p=1,...,P of such constraints.
In AIMMS this translates to: sum[p | ord(p) <= ord(p) - 1, ... ] which clearly doesn't make any sense.
How can I make p=1,...,P constraints (predefined set) where I have to use the value of p in the definition (equation) as well?