The expand
command in AMPL simplifies constraint expressions. In particular, it combines like terms. For example:
var x;
var y;
subject to c: 2 * (x + y) + 3 * x = 0;
expand c;
prints
subject to c:
5*x + 2*y = 0;
In your case AMPL uses distributivity of multiplication over addition/subtraction: a * (b - c) = a * b - a * c
. This is necessary because CPLEX and many other solvers only accept constraint expressions in a certain form, e.g. a linear expression a1 * x1 + a2 * x2 + ... + an * xn
and there is no way to pass arbitrary expression trees to it (at least using the C API in CPLEX).