Difference between revisions of "Core.Terms.LogicOperations"
Jump to navigation
Jump to search
Line 24: | Line 24: | ||
== Properties == | == Properties == | ||
+ | |||
+ | '''LogicAnd, LogicOr, LogiXor:''' | ||
+ | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{ | + | {{TableRowPropertie2| Terms | [[Boolean]] | [[Term]] | - | [2..*] | Represents the list of BooleanTerm operands of the disjunction. Terms will be evaluated in the order of appearance in the OTX document.}} |
− | {{TableRowPropertie2| | + | |} |
+ | |||
+ | '''LogicNot:''' | ||
+ | |||
+ | {| {{TableHeader}} | ||
+ | {{TableRowPropertiesHeader}} | ||
+ | {{TableRowPropertie2| Term | [[Boolean]] | [[Term]] | - | [1] | Represents the BooleanTerm operand of the negation.}} | ||
|} | |} | ||
Revision as of 08:34, 26 April 2019
Contents
Classification
Name | LogicOperatios |
Short Description | Basic logical operations with Boolean expressions |
Class | Term |
Extension | OTX Core library |
Group | Operations |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
BooleanValue = BooleanTerm1 operator BooleanTerm2
BooleanValue = !BooleanTerm1
Description
Logical operators are used according to the C# notation for logical operations in the formulation of conditions etc. The following operators can be used:
- &&
- Logical AND (conjunction)
- ||
- Logical OR (disjunction)
- ^
- Logical XOR (exclusive disjunction)
- !
- Logical NOT (negation)
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Boolean | Return value from the logical operation |
Properties
LogicAnd, LogicOr, LogiXor:
Name | Data Type | Class | Default | Cardinality | Description |
Terms | Boolean | Term | - | [2..*] | Represents the list of BooleanTerm operands of the disjunction. Terms will be evaluated in the order of appearance in the OTX document. |
LogicNot:
Name | Data Type | Class | Default | Cardinality | Description |
Term | Boolean | Term | - | [1] | Represents the BooleanTerm operand of the negation. |
OTL Examples
Boolean MyValueOfBool1;
Boolean MyValueOfBool2;
Boolean result;
result = MyValueOfBool1 && MyValueOfBool2;
result = MyValueOfBool1 || MyValueOfBool2;
result = MyValueOfBool1 ^ MyValueOfBool2;
result = !MyValueOfBool1;