providing the annotation of the observable. The partition of the visible but uncontrollable observables is obtained by identifying all observables that only differ in the their annotation, i.e., only in the data at the annotation data-flow locations:
UObs=
{β0∈ Obs : β0(A) = β(A) for all A∈ Nvis\ NAnn} : β ∈ Obs \ Obsctr
. The notion for a fairness condition of a constraint automaton then directly corresponds to that of a fairness condition in a transition system of Chapter 4.
Most general controllers for constraint automata. The encoding detailed above allows us to construct most general controllers for the various types of objectives in the constraint automata setting, i.e., where the system is given in the form of a constraint automaton, the controllers are likewise constraint automata and with the controlled system obtained by the product of the two constraint automata.
8.2
The coordination language Reo
Reo [Arb04] is a channel-based, exogenous coordination language, allowing the specifica- tion of the coordination glue between components by a network of channels, component connectors and Reo nodes. We provide here a brief overview of the main concepts. Reo channels are the primitive building blocks for the network. Each channel has two dis- tinct channel ends. A channel end can be either a source end, through which data enters a channel or a sink end, through which data leaves a channel. The operational semantics of Reo networks can be provided in a compositional way using constraint automata for the channels and an appropriate composition operator on constraint automata for the Reo join operation, which joins channel ends together to form Reo nodes in the network. Compo- nents are connected to the Reo network by connecting channel ends to the interface ports of the components, taking care that only sink channel ends are connected to the input ports of a component and source channel ends to the output ports. To encode the direction of data-flow at the constraint automata level during composition, we use subsetsNin⊆ N and
Nout ⊆ N of the data-flow locations in a constraint automaton. Data-flow locations that are
neither elements ofNin norNout correspond to data-flow locations that have already been
composed and thus are data-flow locations internal to the network.
Reo provides a library of basic channels, which can be extended by user-defined channels by specifying their behavior as a constraint automaton and providing the necessary classifi- cation of the channel ends into source and sink ends.
Figure 8.2 shows some of the most common channels and their constraint automata repre- sentation, as well as two simple components.
The synchronous channel – Figure 8.2a) – synchronizes its source end and its sink end, transferring the data item from the source endA to the sink end B. The synchronous drain channel – Figure 8.2b) – has two source ends and synchronizes both of them, consuming both data items. Note that we use here a synchronous drain channel that requires both data items to be equal. A variant of the synchronous drain channel that does just requires synchronous activity at A and B arises by replacing the data constraint in the constraint
8.2. The coordination language Reo Chapter 8. Synthesis in the Reo and constraint automata framework
{A, B}, d(A) = d(B)
a) Synchronous channel
b) Synchronous drain (with data equality)
c) FIFO1 channel
∅
1 {A}, d(A) = 1 {A}, d(A) = 0 0
{B}, d(B) = 0 {B}, d(B) = 1 A A A B B B
N = {A, B}, Nin={A}, Nout={B}
N = {A, B}, Nin={A, B}, Nout=∅
N = {A, B}, Nin={A}, Nout={B}
{A, B}, d(A) = d(B)
d) Reader component
Reader A {A}, true
N = {A}, Nin={A}, Nout=∅
A {A}, true
e) Writer component Writer
N = {A}, Nin=∅, Nout={A}
Figure 8.2: Basic Reo channels and a Reader and Writer component with their correspond- ing constraint automaton. For the FIFO1 channel, the constraint automaton is shown for Data ={0, 1}.
automaton by true. Figure 8.2c) shows a FIFO1 channel, which can store a single value x ∈ Data received at the source end in its buffer, which is then available for transfer via the sink end. The constraint automaton for the FIFO1 channel is depicted here for the data domainData = {0, 1}. The state called “∅” represents the configuration where the buffer is empty, while the states “0” and “1” represent the configurations where the buffer contains the corresponding data value. Figure 8.2d) and e) show basic components, a nondeter- ministic reader and a nondeterministic writer, that can be used in the construction of Reo networks. The reader accepts any data item offered at its input portA and the writer offers any data item at its output port.
A Reo network then arises by joining channel ends at Reo nodes. Reo nodes mediate the data flow of all the channel ends coinciding at a node. Vereofy supports two variants of nodes, the standard Reo node (depicted as ) and the route node (depicted as ).
Chapter 8. Synthesis in the Reo and constraint automata framework 8.2. The coordination language Reo A B C D E F G H I A B C1 C2 C3 C4 D1 D2 E1 E2 F1 F2 F3 G1 G2 G3 H I a) b)
Figure 8.3: A Reo network of basic synchronous and FIFO1 channels, before (a) and after (b) the channel ends are joined in Reo nodes.
As an example, consider the Reo network depicted in Figure 8.3. The left hand side shows the channels with their channel ends before being connected to the nodes, while the right hand side shows the network after the channel ends have been joined at the nodes.
We classify nodes by the types of channel ends that coincide at the node. A node where all the channel ends are source ends is called a source node. If all the channel ends are sink ends it is called a sink node. A node where both types of channel ends coincide is called a mixed node. A mixed Reo node with standard semantics – such as nodesD, E, F, G in Figure 8.3b) – is active (with data itemx∈ Data) if the following conditions hold:
(S1) Exactly one of the sink ends coinciding at the node is active, with data itemx∈ Data. (S2) All of the source ends coinciding at the node are active with the same data itemx ∈
Data.
As a consequence of condition (S1), a standard Reo node acts as a nondeterministic merger, choosing exactly one of the channel ends capable of providing data at a given moment. The second condition (S2) then ensures the replication of the data as the received data item is copied to all the connected source ends simultaneously. Thus, a data item is suitable for selection only if it can be passed on to all the connected source ends.
A mixed node with route semantics – such as nodeC in Figure 8.3b) – is active (with data itemx∈ Data) if the following conditions hold:
(R1) Exactly one of the sink ends coinciding at the node is active with data itemx ∈ Data.
(R2) Exactly one of the source ends coinciding at the node are active, with the same data itemx∈ Data.
Condition (R1) is the same as (S1) for the standard Reo nodes, while condition (R2) re- places the replicator semantics of the standard Reo node with a routing semantic, where the received data item is routed to exactly one of the connected source ends.
Source nodes – such as nodesA and B in Figure 8.3b) – and sink nodes – such as nodes H and I in Figure 8.3b) – can be regarded as open for reading and writing respectively, and serve as the exported interface ports when regarding a Reo network as a component connector, i.e., when a Reo network is used as a subcomponent in some other Reo network.