Graphics Programs Reference
In-Depth Information
...
...
...
...
s
t u v w
x y
z {
x
Figure 10.3: Translation rules for concurrent constructs
A sequence of statements none of which is modelled explicitly is simply
represented by a timed transition with one input and one output place.
Fig. 10.2( a) depicts the translation of an if statement: the two alternatives
are represented by a nondeterministic choice (two immediate transitions with
a common input place). If nothing is known about the relative frequencies
of the outcomes of the condition evaluation, equal weights are assigned to
the two immediate transitions. The case statement can be translated in
the same way, yielding a structure with as many parallel sequences as there
are cases. The while statement is instead shown in Fig. 10.2( b); the same
discussion as for the if statement applies; the translation of the while true
statement, not shown in the figure, is a simplification of the translation of the
regular while that is obtained by eliminating the exit arc out of the decision
plac e 1 . The translation of the SEQ statement is shown in Fig. 10.2( c): the
output place of the translation of A i is superposed with the input place of
the translation of A i+1 .
For what concerns concurrent statements, communications (either ! or ?)
are simply represented (for the moment) by an immediate transition with a
single input and a single output place. This is a reasonable choice considering
that we are modelling each process in isolation, and therefore communication
is seen as an action that involves no delays. Process activation statements
are translated into a timed transition, again with one input and one output
place. The translation of the PAR statement is shown in Fig. 10.3( a): the
timed transition represents the time needed to activate the single branches of
the PAR. The final transition represents the fact that the PAR completes
its execution only when this is true for all branches: it is an immediate
transition because it expresses a logical condition (there is no time involved,
1 Observe that in this case there is no direct path between the input place and the
output place.
 
 
Search WWH ::




Custom Search