PermutationBehavior

The PermutationBehavior operator results in all possible orderings of the operand behaviors.

PermutationBehavior ::= Behavior & Behavior .

Permutation behavior can be reduced syntactically as follows: (B1;B2)|(B2;B1)

The offered signature is the union of the offered signatures of the operands.

The following Cord code shows the use of the PermutationBehavior operator. This code is extracted from the stand-alone Operators sample (see Finding the Code Samples).

machine Permutation() : AllActivities
{
    (Dance;Sleep) & (Eat; Drink)
}

In machine Permutation, the PermutationBehavior operator (&) constructs all possible permutations of two behaviors treated as atomic; no interleaving of individual actions is produced. The example also shows use of the Tight SequencingBehavior operator (;) and the GroupingBehavior.



Show: