Conditions & Assignments
Conditions
Rules can be enriched with conditions in order to constrain specific values for variables of the body. A condition is the comparison (>, <, ==, >=, <=, <>) of a variable of the body and an expression.
Notice that although the comparison symbols used in conditions partially overlap with the symbols for comparison operators, they have different semantics. While comparison operators calculate Boolean results, comparison symbols in conditions only specify a filter.
Each rule can have multiple comma-separated conditions.
Y>=20 and classifies the respective employee as rich. The expected result:
Assignment
Rules can be enriched with assignments in order to generate specific values for existentially quantified variables of the head. An assignment is the equation (=) of a variable of the body and an expression.
Each rule can have multiple comma-separated assignments.
I1=="loans" and I2=="deposits" are conditions to select the balanceItems (as I1 and I2 appear in the body), whereas Z=X+Y and A=(X+Y)/2 are assignments (as Z and A do not appear in the body).
The expected result:

