 Top Mode Coercion Runtime Library French German Italian Spanish Portuguese Japanese Korean Chinese

# Constraints

When a relational operator formula involving symbolic variables is computed, it may cause a constraint to be placed on the environment. The kinds of constraints that can be placed there are summarized in this section.

If the relational operator formula is not in the format of a constraint to begin with, it is transformed according to the rules of algebra so that it is. This may require coercing the mode of some symbolic variables to input by backtracking out those variables. If the backtracking-out fails, a run-time error, "Too many backtracks..." is raised, as usual.

The setting of a constraint will cause the relational operator formula to fail if the constraint is not compatible with constraints already in the environment; for instance, x < 3 where x > 4 is already in the environment.

The following list summarizes the formats of all possible constraints that can be in the environment, rel here always refers to one of the relational operators (< , > , <=, >=, =,or <>).

• Sum constraint of long integers with coefficients:
`al*xl + a2*x2 + . . . + an*xn  rel a`
where al, a2, ..., an, a are long integer values, and xl, x2, ..., xn are symbolic variables of type L.
• Constant value constraint:
`x rel a`
where x is a symbolic variable of type I, R, S, or a subrange type, and a is some value of the same type.
• Numeric variable constraint:
`x rel y + a`
where x and y are symbolic variables of type I, R, or a subrange type, and a is a numeric value of the same type.
• Array index constraint:
`z(x+a) = y`
where z is a symbolic array, x is a symbolic variable of the index type of z, a is a integer value, and y is a symbolic variable of the element type of z. If a term of the form z(x+a) is used in a relational operator formula, y is implicitly declared, and a constraint of this form is set up. Then y is used in place of the original term in any further constraints.
• Relation variable constraints:
```b in x
~b in x
```
where x is a symbolic variable of a relation type, and b is either a value of the element type of x, or a symbolic variable of the element type of x.
• Simple equality or inequality constraints:
```x = b
x <> b
```
where x is a symbolic variable of any type, and b is either a value of the same type, or another symbolic variable of the same type. Top Mode Coercion Runtime Library