Logical structures
- Last Updated: June 28, 2022
- 4 minute read
- Corticon
- Version 7.2
- Documentation
Logical AND
A common requirement when you define rules is to specify AND logic. For example, consider a situation where a rule must assign a maximum cargo weight for an aircraft only when the aircraft type is a 747 AND the cargo volume is 4000. You achieve it by defining two conditions and entering their values in the same rule column, as shown in this image. The rule fires only when all the conditions are satisfied.
Logical OR
Just like AND, a common requirement is to use OR logic in a Rulesheet.
Specify OR logic in either of two ways:
- Through multiple rules—Used when the OR logic requires two or
more conditions that are different, as shown here:

After defining the rules, when you save the file, Corticon Studio automatically detects the OR logic and adds hyphens in any empty cells that correspond to the defined conditions.
- Through OR value sets—Use when the OR logic needs to check
for a list of values for a single attribute, you can enclose those values in curly
braces in a rule column cell as shown here:

- Comparison operators in an OR value set—Use multiple values.
For example if you specify
{<200, >600}, any value that is less than200or greater than600satisfies the condition.
Logical NOT
You can also use negating logic in Rulesheets when you want to define a rule that fires when the attribute is NOT a specified value. For example, if a rule assigns a maximum cargo weight to any aircraft that is not a 747, then the condition must be defined in such a way that the rule checks for cases where the value of the aircraft type attribute is not 747.
There are several ways to use logical NOT:
- Specify a Boolean condition expression with an equality operator
(
Aircraft.aircraftType='747') that returnsFalse.
- Specify a Boolean condition expression with an inequality operator
(
Aircraft.aircraftType < >'747') that returnsTrue. The inequality operator (< >) is available for all data types.
- Specify a condition (Boolean or value-set based) that checks if the
value is
notsomething. To do this, you must use thenotoperator, which is a Boolean operator available in the Attribute Operators > Boolean subcategory in the Rule Operators view.
In these examples, negating logic is expressed in different ways. You should choose whichever way is most intuitive to you and any stakeholders who may want to read and understand the rules in your Rulesheet.
Avoid multiple negatives
While a Corticon Rulesheet enables you to define double and triple negatives, defining multiple negatives is not a good practice. As in natural language, double and triple negatives are difficult for human readers to grasp, so any stakeholder who reads your rules may find them hard to understand.
For
example, as shown in the image, you can create a rule in Corticon that checks if the
aircraft type is a 747 using two negatives—Aircraft.aircraftType <>
'747' and F. While this works the same way as
Aircraft.aircraftType = '747' and T, it is harder
to read.