5.2.1. Logical Term

[Tip]Description

A logical term is an ASM term that evaluates to a boolean value. It can be either a simple or a compound expression.

[Important]Syntax
LogicalTermAST ::= LogicalAndTermAST 
                 | LogicalTermAST || LogicalAndTermAST
	               | LogicalTermAST xor LogicalAndTermAST	       

A logical term can be a compound expression, i.e. it can be composed of conjunctive logical terms with a logical OR operation.

The logical OR operator can be either the || (OR) or the xor operator; these are interpreted in the classical way.

[Note]Semantics

Logical operations are defined only for Boolean and Multiplicity types.

The interpretation of operations is trivial in case of Booleans.

A Multiplicity value is handled as a pair of boolean values: one denotes if source can be multiple or not, whereas the other denotes it for the target of the relation. Logical operations on Multiplicity values are performed separately for the first and second parts of the pairs. The result is a Multiplicity value.

Table 2.3. Logical operators (AND, OR, XOR)

 UndefBooleanStringIntegerDoubleModelElementMultiplicity
UndefUndefUndefUndefUndefUndefUndefUndef
BooleanUndefBool     
StringUndef      
IntegerUndef      
DoubleUndef      
ModelElementUndef      
MultiplicityUndef     Multi


[Warning]Warning

Note that the evaluation rules of boolean operators changed in the new release to be compliant with its use in Java.

Defined In:  term

Used By:  base logical term, check condition, if rule