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 <>).
al*xl + a2*x2 + . . . + an*xn rel awhere al, a2, ..., an, a are long integer values, and xl, x2, ..., xn are symbolic variables of type L.
x rel awhere x is a symbolic variable of type I, R, S, or a subrange type, and a is some value of the same type.
x rel y + awhere x and y are symbolic variables of type I, R, or a subrange type, and a is a numeric value of the same type.
z(x+a) = ywhere 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.
b in x ~b in xwhere 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.
x = b x <> bwhere 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.