The Constraint Programming Solver

Predicates

A predicate asserts a fact about its subject. You use a predicate as the first identifier in a constraint declaration to define what must hold true in any feasible solution. The following is an example of a constraint that uses the ELEMENT predicate:

var X integer, Y integer;
con ElementConstraintExample:   element(X, 1 2 3 4, Y);

The following predicates are available in PROC OPTMODEL:

  • ALLDIFF (variable-list)

  • ELEMENT (scalar-variable,data-list,scalar-variable)

  • GCC (variable-list,set-of-numeric-triplets)

  • LEXICO (variable-list order-type variable-list)

  • PACK (variable-list,data-list,variable-list)

  • REIFY (scalar-variable, linear-constraint)