Newer Version Available

This content describes an older version of this product. View Latest

Constraints

Constraints enforce rules and conditions on types, variables, and relationships. Use constraints to define logical restrictions and ensure consistency within the model.

Supported Logic Operators

These logic operators are supported in CML.

Arithmetic Operators

  • Multiplication (*)
  • Division (/)
  • Remainder (%)
  • Addition (+)
  • Subtraction (-)

Relational Operators

  • Greater than (>)
  • Greater than or equal to (>=)
  • Less than (<)
  • Less than or equal to (<=)

Equality Operators

  • Equal (==)
  • Not equal (!=)

Logic Operators

  • Not (!)
  • And (&&)
  • XOR/Exclusive or (^)
  • Or (||)
  • Bi-conditional (<->)
  • Conditional (?:)
  • Implication (->)

Operator Precedence

In resolving equations, operator precedence determines the order in which operations are performed. Operators in CML have precedence in this order:

  • Arithmetic operators have the first precedence.
  • Relational operators have the second precedence.
  • Equality operators have the third precedence.
  • Logic operators have a lower precedence than equality operators, in decreasing order as listed, with Implication having the lowest precedence.

Constraint Annotation

Here are the details of abort, a constraint annotation.

Annotation Possible Values Description
abort true, false Specifies that, if this constraint fails, abort search and return false for configuration.