Previous

3.3. Collateral and parallel clauses

{Collateral-clauses allow an arbitrary merging of streams of actions. Parallel-clauses provide, moreover, levels of coordination for the synchronization {10.2.4 } of that merging.

A collateral- or parallel-clause consists of a sequence of units separated by and-also-symbols (viz., ","), and is enclosed by parentheses or by a BEGIN-END pair; a parallel-clause begins moreover with PAR.

Collateral-clauses, but not parallel-clauses, may yield stowed values composed from the yields of the constituent units.

Examples of collateral-clauses yielding stowed values:

[ ] INT q = (1, 4, 9, 16, 25);
STRUCT(INT price, STRING category) bike := (150, "sport")
.
Example of a parallel-clause which synchronizes eating and speaking:.
PROC VOID eat, speak; SEMA mouth = LEVEL 1;
PAR BEGIN
      DO
          DOWN mouth;
          eat;
          UP mouth
      OD,
      DO
          DOWN mouth;
          speak;
          UP mouth
      OD
  END 
.}

3.3.1. Syntax

a) strong void NEST collateral clause{5D ,551a} : strong void NEST joined portrait{b} PACK.

b) SOID NEST joined portrait{a,b,c,d,34g } : where SOID balances SOID1 and SOID2{32e } , SOID1 NEST unit{32d } , and also{94f} token, SOID2 NEST unit{32d } or alternatively SOID2 NEST joined portrait{b}.

c) strong void NEST parallel clause{5D ,551a} : parallel{94f } token, strong void NEST joined portrait{b} PACK.

d) strong ROWS of MODE NEST collateral clause{5D ,551a} : where (ROWS) is (row), strong MODE NEST joined portrait{b} PACK ; where (ROWS) is (row ROWS1), strong ROWS1 of MODE NEST joined portrait{b} PACK ; EMPTY PACK.

e) strong structured with FIELDS FIELD mode NEST collateral clause{5D ,551a} : NEST FIELDS FIELD portrait{f} PACK.

f) NEST FIELDS FIELD portrait{e,f} : NEST FIELDS portrait{f,g}, and also{94f } token, NEST FIELD portrait{g}. {FIELD :: MODE field TAG.}

g) NEST MODE field TAG portrait{f} : strong MODE NEST unit{32d } .

h) *structure display : strong structured with FIELDS FIELD mode NEST collateral clause{e}.

i) *row display : strong ROWS of MODE NEST collateral clause{d}.

j) *display : strong STOWED NEST collateral clause{d,e}.

k) *vacuum : EMPTY PACK. {Examples:

}

a)
(x := 1, y := 2)
b)
x := 1, y := 2
c)
PAR(task1, task2)
d)
(1, 2) (in [ ] REAL(1, 2))
e)
(1, 2) (in COMPL(1, 2))
f)
1, 2
g)
1
{Structure-displays must contain at least two FIELD-portraits, for, otherwise, in the reach of

MODE M = STRUCT(REF M m); M nobuo, yoneda;, the assignation nobuo := (yoneda) would be syntactically ambiguous and could produce different effects; however, m OF nobuo := yoneda is unambiguous.

Row-displays contain zero, two or more constituent units. It is also possible to present a single value as a multiple value, e.g., [1: 1] INT v := 123, but this uses a coercion known as rowing {6.6 }.}

3.3.2. Semantics

a) The elaboration of a void-collateral-clause or void-parallel-clause consists of the collateral elaboration of its constituent units and yields empty.

b) The yield W of a STOWED-collateral-clause C is determined as follows:

If the direct descendent of C is a vacuum,
then{'STOWED' is some 'ROWS of MODE' and} each bound pair in the descriptor of W is (1,0) {and it has one ghost element whose value is irrelevant};
otherwise,

Case A: 'STOWED' is some 'structured with FIELDS mode':


· the fields of W, taken in order, are V1, ... , Vm;

Case B: 'STOWED' is some 'row of MODE1':


· W is composed of

  1. a descriptor ((1,m)),
  2. V1, ... , Vm;
For i = 1... m,


· the element selected by the index (i) in W is Vi;

Case C: 'STOWED' is some 'row ROWS of MODE2':
For i = 1... m,
  • the element selected by an index (i, i1, ... , in ) in W is that selected by (i1, ... , in) in Vi.
{Note that in [,,]CHAR block = ("abc", "def"), the descriptor of the three-dimensional yield W will be ((1, 2), (1, 1), (1, 3)), since the units "abc" and "def" are first rowed {6.6 }, so that V1 and V2 have descriptors ((1, 1), (1,3)).}
 
Next