UnionBehavior
The UnionBehavior operator denotes either one or the other behavior, semantically creating the union of the traces of its operand behaviors.
Syntax Definition
UnionBehavior ::= Behavior | Behavior .
Remarks
The offered signature is the union of the offered signatures of the operands.
Example
The following Cord code shows the use of the UnionBehavior operator. This code is extracted from the stand-alone Operators
sample (see Finding the Code Samples).
machine Party() : PartyActivities
{
(
(Dance; Sing) | (Eat; Drink)
);
KeepPartying?
}
The UnionBehavior operator builds the union of its operands' behavior paths. The possible behavior paths of machine Party
are:
1. |
|
2. |
|
Notice that there are two accepting states before and after KeepPartying
. The example also shows use of the Tight SequencingBehavior operator (;), the Option RepetitionBehavior operator (?), and the GroupingBehavior.