Logic functions¶
Logic functions implement conditional and logical constructs.
The following functions are available:
See also
See Constraint Programming functions for a general explanation on how to read the signature tables below.
ifelse¶
Ternary conditional operator: returns Argument 2 if Argument 1 is equal to 1, and Argument 3 otherwise.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
boolean |
Mandatory |
Argument 2 |
any |
Mandatory |
Argument 3 |
same type and dimension as Argument 2 |
Mandatory |
if¶
Function used only in constraints to define a conditional constraint. The row containing the function if should have the same Row value as the constraint it conditions. The constraint is enforced only if Argument 1 is equal to 1.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
boolean |
Mandatory |
iff¶
Function used only in constraints to define a conditional constraint. The row containing the function iff should have the same Row value as the constraint it conditions. The constraint must be verified if Argument 1 is equal to 1 and must not be verified if Argument 1 is equal to 0.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
boolean |
Mandatory |