Usage of expressions

Describes how to use expressions in OPL.

Expressions are used in fundamentally different ways in OPL:

  • to specify items in generic arrays and sets (described in this chapter)

  • to filter iterations (see Formal parameters)

  • to state constraints over decision variables (see Constraints)

In the first two cases, the expressions do not contain decision variables, since decision variables have no value at this stage of the computation. These expressions are said to be ground and they are subject to almost no restrictions.

In the second case, of course, the expressions may contain decision variables. Boolean expressions containing decision variables are called constraints and are subject to a number of restrictions; for example, float constraints must be linear, piecewise-linear, or quadratic.