Next Article in Journal
Some Identities on the Twisted q-Analogues of Catalan-Daehee Numbers and Polynomials
Next Article in Special Issue
Logarithmic SAT Solution with Membrane Computing
Previous Article in Journal
Multiplicity of Positive Solutions to Nonlocal Boundary Value Problems with Strong Singularity
Previous Article in Special Issue
Two Extensions of Cover Automata
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Hypergraph Model for Communication Patterns

by
Gabriel Ciobanu
Faculty of Computer Science, Alexandru Ioan Cuza University, 700506 Iasi, Romania
In Memoriam Solomon Marcus (1925–2016).
Submission received: 30 October 2021 / Revised: 25 November 2021 / Accepted: 2 December 2021 / Published: 23 December 2021
(This article belongs to the Special Issue In Memoriam, Solomon Marcus)

Abstract

:
The article deals with interaction in concurrent systems. A calculus able to express specific communication patterns is defined, together with its abstract control structures. A hypergraph model for these structures is presented. The hypergraphs are able to properly express the communication patterns, providing a fully abstract model for the pattern calculus. It is also proved that the hypergraph model preserves the operational reductions of processes from pattern calculus and of the actions from the control structures.

1. Introduction

Mathematics has sometimes been called a ‘science of patterns’ [1], meaning that patterns are at the heart of mathematics. The nice description of mathematics as the “study of patterns” was given by G.H. Hardy in his book A Mathematician’s Apology: “A mathematician, like a painter or a poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas”. Essentially, patterns are regularities that we can perceive. Regarding the skilful ability of applying a pattern to multiple contexts, Solomon Marcus was a wonderful example of applying knowledge patterns to surprising contexts.
Since mathematics and technology have developed a fruitful relationship over past few decades, patterns have been investigated recently in modern fields. New communication technologies have changed the computing landscape, and the Internet is now a platform for large scale distributed programming. Nowadays, we deal with global computation based on multiple interactions with the environment (instead of isolated systems). Concurrency is essential now in computer science; web servers handle multiple simultaneous clients, and cloud servers allow several simultaneous applications and users. Message-passing represents a way in which concurrent processes communicate (a process is an instance of a running program). In software architecture, a messaging pattern describes how two different processes communicate with each other. In telecommunications, a message exchange pattern describes the messages required by a communications protocol or the message flow between parties involved in communication. For example, when navigating on Internet (representing the channel), a web browser (the communicating party) uses the communication protocol HTTP to request a web page from the server (another communicating party). In general, the interaction between clients and servers follows a specific communication pattern: the client sends a request, the server returns a response, and so on. Such an exchange of messages is only an example of communication patterns. More complicated behaviours appear due to the concurrent interaction of communicating processes; this complexity reveal the necessity to find new ways to describe and build up concurrent systems. The communicating parties in such a concurrent system should have a common language to communicate; moreover, they should follow the rules defined in a communications protocol. There exits already a calculus able to express communication patterns called join calculus; it is used as a basis for some programming languages (JoCaml and Cω), but also as a basis for libraries (embedded in C#, F# and Scala). This calculus is based on ‘join patterns’, namely rules describing how a certain combination of values sent through multiple channels triggers a specific reaction and removes the values from the communication channels. Interaction in such a calculus is provided by sharing the communication channels names.
We introduce the pattern calculus as a weak version of join calculus. After presenting the control structures for pattern calculus, we provide a hypergraph model of these structures. The hypergraphs are able to express properly the communication patterns described by the pattern calculus. It is proved that the hypergraph model is fully abstract for the calculus; a model is fully abstract if all observationally equivalent processes represent the same object in the model, meaning also that processes with different behaviour are not mapped to the same hypergraph. Furthermore, there is a correspondence between the dynamics of the processes of the calculus and their hypergraph representation.

2. Pattern Calculus

The pattern calculus is inspired by the join calculus [2], a calculus proposed to underlie programming languages for distributed systems. A presentation of the join calculus can also be found in [3]. The specific construction of the new calculus is the definition of communication channels: def u y P in Q . To elucidate the simplicity of this syntactical construction, let us say that it could be expressed in the π -calculus [4] by using several syntactical constructions: def u y P in Q = ν u . ( ! u ( y ) . P Q ) .
The syntax of the pattern calculus is defined by using a countable set X of names ranging over u , v , x , , together with u ˜ , v ˜ , x ˜ , y ˜ ranging over finite strings of names. We use P , Q , R , ranging over the set of processes. The set P of processes contains an empty process 0, as well as an output message  u v sending v by using a channel u. The process P Q describes the parallel composition of processes P and Q. The communication between processes is achieved by the channel definition  def u v P in Q indicating that the interaction of processes P and Q is realized by the channel u (which is created only for the communication between them).
Definition 1.
The processes of our calculus are defined by the following syntax:
P ::=   0 u v P Q def u v P in Q .
In   def u v P in Q , both u and v are bound. The scope of v is P, while the scope of u is given by the whole definition. It is worth noting that only this definition binds names. The free names are defined inductively by fn ( 0 ) = , fn ( u v ) = { u , v } , fn ( P Q ) = fn ( P ) fn ( Q ) , and fn ( def u v P in Q ) = ( fn ( Q ) ( fn ( P ) { v } ) ) { u } .
A substitution { y / x } P replaces all the free occurrences of name x in P by name y; name-capture is avoided by using the α -conversion (defined in the standard way).
Definition 2.
A structural congruence P × P is defined as the smallest congruence satisfying the following axioms:
  • def u v P in Q def u t { t / v } P in Q , if t fn ( P )
  • def u v P in Q def w v { w / u } P in { w / u } Q if v { u , w } and w fn ( P Q )
  • Q 1 def u v P in Q 2 def u v P in ( Q 1 Q 2 ) if u fn ( Q 1 )
  • def u v P 1 in def w t P 2 in Q def w t P 2 in def u v P 1 in Q
          if u w , u fn ( P 2 ) , and w fn ( P 1 )
  • P 0 P        P Q Q P        ( P Q ) R P ( Q R ) .
The evolution of the processes is given by a reduction relation → .
For the specific construct def u y P in Q , the reduction is described mainly by:
def u y P in Q u v def u y P in Q { v / y } P .
More exactly, process Q can send a name v along the channel u, while process P waits at the other end of channel u to receive certain channel names. When the name v is received, process Q continues its execution in parallel with process P in which all free occurrences of y are replaced by v, i.e., { v / y } P . Then, channel u remains open to receive other names. The formal definition is given below.
Definition 3.
The reduction relation P × P is defined as the smallest relation satisfying:
r1:
def u 1 v 1 Q 1 in def u 2 v 2 Q 2 in def u n v n Q n in ( P u i v )
def u 1 v 1 Q 1 in def u 2 v 2 Q 2 in def u n v n Q n in ( P { v / v i } Q i )
      if { u i + 1 , , u n } ( fn ( Q i ) { u i } ) = with i [ n ] and n 1  
r2:
             P 1 P 2 def u v Q in P 1 def u v Q in P 2  
r3:
                   P 1 Q 1 , Q 1 Q 2 and Q 2 P 2 P 1 P 2 .
It is worth noting that there is no rule for parallel composition in the definition of this reduction. The following (easy-to-prove) results show that such a rule for parallel composition is just a consequence.
Lemma 1.
Considering any substitution σ = { x / y } ,
P Q implies σ P σ Q , and P 1 P 2 implies σ P 1 σ P 2 .
Proposition 1.
    P 1 P 2 implies Q P 1 Q P 2 .

3. Hypergraphs

In the theory of distributed systems, Petri nets [5] and π -nets [6] provide both algebraic and graphical descriptions for concurrent systems. Compared to Petri nets, our hypergraph model for pattern calculus has a flexible structure; compared to π -nets, the hypergraph model is simpler, but still able to describe a large class of processes.
Following [7], we present the definitions for hypergraphs and some standard related notions such as isomorphism and contractions (on nodes and on edges). For a set S of hyperedges and a set V of vertices, it is defined an incidence relation E S × V . A rooted hypergraph is a tuple H = S , V , E , s , where s S is the root hyperedge. For a hypergraph H, we use the notations S H , V H , E H and s H .
The graphical presentation of a hypergraph H is provided by:
-
A hyperedge t represented as an oval with its name t outside.
-
A vertex v represented as a point having the name v .
-
An element ( t , v ) of the incidence relation represented as lines from the hyperedge t to the vertex v; “v lies on t” whenever ( t , v ) E H .
-
The root indicated by an arrow pointing to the hyperedge s H .
Example 1.
Considering a hypergraph with S H = { s , t , t } , V H = { v , w , w } , E H = { ( s , v ) , ( t , v ) , ( t , w ) , ( t , v ) , ( t , w ) } and s H = { t } , various graphical representations are depicted in Figure 1. The left representation uses only lines of non-zero length, while the right one uses only lines of zero length. The representation in the middle is a compromise (between lengths) to provide a reasonable picture.
For a given rooted hypergraph H and a nonempty subset W V H of nodes, a contraction on vertices is specified by the hypergraph H / W with the same root hyperedge ( s H / W = s H ), the same hyperedges ( S H / W = S H ), but with V H / W = ( V H \ W ) { v } for a fresh v V H and E H / W = ( E H \ S H × W ) { ( t , v ) | { t } × W E H } .
For a given rooted hypergraph H and a nonempty subset T S H of hyperedges, a contraction on hyperedges is specified by the hypergraph H / T with the same set of vertices ( V H / T = V H ), but with S H / T = ( S H \ T ) { t } for a fresh t S H , and E H / T = ( E H \ T × V H ) { ( t , v ) | T × { v } E H } . Regarding the root hyperedge s H / T , if s H T then s H / T = t , otherwise it remains the same s H .
Example 2.
Considering two vertices v , w V H , we denote by H v = w the contraction on vertices in H / { v , w } . For two hyperedges s , t S H , we denote by H s = t the contraction on hyperedges in H / { s , t } . For the hypergraph H used in the previous example, the contraction on vertices H w = w and the contraction on hyperedges H t = t are depicted in Figure 2.
The isomorphism between two hypergraphs H and H is defined by two bijections ϕ S : S H S H and ϕ V : V H V H which satisfy ϕ S ( s H ) = s H and ( s , v ) E H if and only if ( ϕ S ( s ) , ϕ V ( v ) ) E H for all s S H and v V H . In such a situation, we say that hypergraphs H and H are isomorphic (denoted by H = H ).
The isomorphism relation is an equivalence over hypergraphs. The names of hyperedges and vertices do not play any role in the isomorphism of hypergraphs. For the graphical representation of an equivalence class, it can be used any hypergraph (after removing the names of hyperedges and vertices).

4. Control Structure for Pattern Calculus

Milner proposed the control structures and action calculi as a unifying framework for the models of concurrent systems in [8]. A control structure defines the static aspects of a process calculus, while the corresponding action calculus describes various models of interactive behaviours. Regarding the behaviour, distinct action calculi differ only in their generators (called controls). Thus, the previously mentioned Petri nets and π -nets, as well as our hypergraph model, differ only in their generators. Analyzing these generators, it is possible to compare and classify the formal models for concurrent systems. Moreover, by selecting some specific generators, it is possible to combine existing models in order to obtain a new desired model.
The control structures presented here follow the definitions of [9]. Essentially, a control structure is defined by a set of terms, an equational theory, and a reduction relation over terms. This fact is condensed in the following expression:
C o n t r o l S t r u c t u r e = A c t i o n s + E q u a t i o n a l T h e o r y + R e a c t i o n .
From an algebraic viewpoint, a control structure is a symmetric strict monoidal category with an additional structure [10]. The morphisms of the symmetric strict monoidal category correspond to the terms of the control structure; they are denoted by a , b , c , and called actions.
The control structure uses an enumerable set X of names together with a signature ( P , K ) in which P is a set of prime arities and K is a set of control operators. Every name x X has a prime arity p P , and this is denoted by x : p . Each control K K has an arity rule. In addition to the specific control operators, every control structure contains a datum operator x : ϵ p (where x : p ) and a discard operator ω p : p ϵ , as well as an abstractor operator ab x a : p m p n (where x : p and a : m n ). The equational theory is the same for all control structures. To express the evolution, a set R of reaction rules is used; reaction rules are ordered pairs of terms with the same arity.
Each action a possesses a surface surf ( a ) = { x X | p . x : p and ab x a id p a } .
The equality = between actions is valid whenever the equation a = b could be proved by using the axioms of the control structure; otherwise a b .
We present here some results used later in the proofs of our results.
Proposition 2.
The following properties hold in any control structure:
surf ( x ) { x } surf ( ω ) = surf ( a b ) surf ( a ) surf ( b ) .
The following properties hold in any control structure, whenever x surf ( c ) :
surf ( id ) = surf ( p ) = surf ( a · b ) surf ( a ) surf ( b ) .
Additionally,
1. p n , ϵ = id n
2. a b = b a ( a , b : ϵ ϵ )
3. ( x ) ( c · b ) = ( id p c ) · ( x ) b ( x : p )
4. ( x ) ( c b ) = c ( x ) b ( c : ϵ n )
5. ( x ) ( a c ) = ( x ) a c
6. ( z ) ( y ) a = ( p p , q id m ) · ( y ) ( z ) a    ( z : p , y : q , a : m n )
Proposition 3.
The following properties are provable in any control structure:
1. [ x / y ] ( a · b ) = [ x / y ] a · [ x / y ] b ;
2. [ x / y ] ( a b ) = [ x / y ] a [ x / y ] b ;
3. [ x / y ] ( z ) a = ( z ) [ x / y ] a if z { x , y } ;
4. [ x / y ] ( x ) a = ( w ) [ x / y ] [ w / x ] a    if w surf ( a ) { x , y } and x y .
We define the control structure for our pattern calculus, emphasizing on its actions. We also present a graphical representation for its processes. The monoid ( N , + , 0 ) of the natural numbers provides the arity monoid of the control structure, with m , n , k , ranging over natural numbers, and [ n ] = { 1 , 2 , , n } denoting the first n natural numbers. The (unique) prime arity 1 is associated with each name x X . For a number k and a function f : [ n ] Y , we define k f : { k + 1 , k + n } Y by ( k f ) ( i ) = f ( i k ) . Following [9], the control structure is defined over the set X = { z i | i N } of names using x , y , u , as meta-variables.
Regarding the actions of the control structure for our calculus, they are given by enriched hypergraphs called shortly pattern nets. An action a = ( H , Σ ) with arity m n is given by a hypergraph H together with its decoration Σ = I , O , λ , τ , μ consisting of:
-
An input function given by an injective function I : [ m ] V H ;
-
An output function given by a function O : [ n ] V H ;
-
A label function given by an injective function λ : Z V H , where Z X ;
-
A transition relation  τ V H × V H ;
-
A resource function  μ : S H N V H × V H .
We can look at these functions as multisets over S H × V H × V H . We denote by { x , y , y } a multiset μ over { x , y , z } such that μ ( x ) = 1 , μ ( y ) = 2 and μ ( z ) = 0 ; we use the standard multiset operations over these functions: ( , , ).
We extend in a straightforward way the isomorphism and contraction introduced for hypergraphs. Considering a i = ( H i , Σ i ) with Σ i = I i , O i , λ i , τ i , μ i ( i [ 2 ] ), the nets  a 1 and  a 2 are isomorphic if there is a hypergraph isomorphism ( ϕ S , ϕ V ) between  H 1 and  H 2 such that ϕ V I 1 = I 2 , ϕ V O 1 = O 2 , ϕ V λ 1 = λ 2 , and ( v , v ) τ 1 if and only if ( ϕ V ( v ) , ϕ V ( v ) ) τ 2 , together with μ 1 ( s , v , v ) = μ 2 ( ϕ S ( s ) , ϕ V ( v ) , ϕ V ( v ) ) for all s S H 1 and v , v V H 1 .
For the graphical representations of the pattern nets, let us consider a generic net a = ( H , Σ ) with Σ = I , O , λ , τ , μ ; the hypergraph H is presented by assuming that its lines are of length zero (see Figure 1):
-
Whenever I ( i ) = v , O ( k ) = v and λ ( x ) = w , an input label  ( i ) is assigned to vertex v, an output label  k to vertex v , and a name labelx to vertex w;
-
Whenever ( v , v ) τ , an arc is drawn outside any oval from vertex v to vertex v ;
-
Whenever μ ( s , v , v ) > 0 , v and v lie on the same hyperedge s: ( s , v ) , ( s , v ) E H ; more exactly, whenever μ ( s , v , v ) = k > 0 , we have k arcs inside the oval s from vertex v to vertex v .
As for hypergraphs, isomorphic nets are not distinguished. The names of vertices and hyperedges do not play any role in the isomorphic nets, and so the graphical representation of an isomorphic (equivalence) class of pattern nets is given by any net of the class after removing the names of vertices and hyperedges.
The control structure operators for our pattern nets are:
- datum  x γ = ( H , Σ ) : 0 1 defined by
H = { s } , { v } , { ( s , v ) } , s and
Σ = , { 1 v } , { x v } , ,
Axioms 11 00008 i001
- discard  ω γ = ( H , Σ ) : 1 0 defined by
H = { s } , { v } , { ( s , v ) } , s and
Σ = { 1 v } , , , ,
Axioms 11 00008 i002
The three controls generating the pattern nets are:
ν γ = ( H , Σ ) : 0 1 defined by
H = { s } , { v } , { ( s , v ) } , s and
Σ = , { 1 v } , , ,
Axioms 11 00008 i003
out γ = ( H , Σ ) : 2 0 defined by
H = { s } , { v , v } , { ( s , v ) , ( s , v ) } , s and
Σ = , { 1 v , 2 v } , , , { ( s , v , v ) }
Axioms 11 00008 i004
– If a = ( H , Σ ) : 1 0 and Σ = I , O , λ , τ , μ , then
    def γ a = ( H , Σ ) : 1 0 , where
H = S H { t } , V H { v } , E H { ( t , v ) } , t , for fresh
t S H and v V H , and
Σ = { 1 v } , O , λ , τ { ( v , I ( 1 ) ) } , μ .
The equational theory is defined by the following operators.
Let us consider the nets a i = ( H i , Σ i ) with Σ i = I i , O i , λ i , τ i , μ i and λ i : Z i V H i , where i [ 2 ] . Without loss of generality, we consider s H 1 = s H 2 = s . ( S H 1 { s H 1 } ) ( S H 2 { s H 2 } ) = and λ 1 ( z ) = λ 2 ( z ) z Z 1 Z 2 , as well as ( V H 1 λ 1 ( Z 1 Z 2 ) ) ( V H 2 λ 2 ( Z 1 Z 2 ) ) = .
Identity  id m γ = ( H , Σ ) : m m defined by
H = { s } , { v i | i [ m ] } , { ( s , v i ) | i [ m ] } , s and
Σ = { i v i | i [ m ] } , { i v i | i [ m ] } , , ,
Axioms 11 00008 i005
Symmetry  p m , n γ = ( H , Σ ) : m + n n + m defined by
H = { s } , { v i | i [ m + n ] } , { ( s , v i ) | i [ m + n ] } , s
Σ = { i v i | i [ m + n ] } , { i v m + i | i [ n ] } { n + i v i | i [ m ] } , , ,
Axioms 11 00008 i006
Tensorial product  a 1 a 2 : m + k n + l of two nets a 1 : m n and a 2 : k l is obtained by combining them as follows: in a 2 , the input labels are incremented by m and the output labels are incremented by n; then overlap the two roots and the vertices of a 1 and of  a 2 with the same name. Formally, a 1 a 2 = ( H , Σ ) , where
H = S H 1 S H 2 , V H 1 V H 2 , E H 1 E H 2 , s and
Σ = I 1 m I 2 , O 1 n O 2 , λ 1 λ 2 , τ 1 τ 2 , μ 1 μ 2 .
Composition  a 1 · a 2 : m k of two nets a 1 : m n and a 2 : n k is obtained by combining them as follows: overlap the two roots and vertices of a 1 and a 2 with the same name; for every i [ n ] , overlap the vertex labelled i in a 1 with the vertex labelled ( i ) in  a 2 , and then remove the labels ( i ) and i .
Formally, a 1 · a 2 = ( H , Σ ) O 1 ( 1 ) = I 2 ( 1 ) , , O 1 ( n ) = I 2 ( n ) , where
H = S H 1 S H 2 , V H 1 V H 2 , E H 1 E H 2 , s and
Σ = I 1 , O 2 , λ 1 λ 2 , τ 1 τ 2 , μ 1 μ 2 .
Abstractor. Let us consider a net a = ( H , Σ ) : m n with Σ = I , O , λ , τ , μ .
Then ab x γ a : 1 + m 1 + n is obtained from a in the following steps: increment all the input and output labels by 1; assign both the input label ( 1 ) and the output label  1 to vertex x, and then remove the label x. Formally, ab x γ a = ( H , Σ ) , where
Σ = { 1 λ ( x ) } 1 I , { 1 λ ( x ) } 1 O , λ { x λ ( x ) } , τ , μ .
In general, these operators over the pattern nets are well-defined. However, the abstractor ab x γ a is not well-defined if a vertex labelled by x is not contained in the net a. To avoid such a situation, we adjust the definition of the above operators by
op ( a , ) = d e f op γ ( a γ i , ) γ i ,
where op stands for each operator defined above, and i = ( H , Σ ) is the pattern net
H = { s } , { v i | i N } , { ( s , v i ) | i N } , s
Σ = , , { z i v i | i N } , , .
Following [9], it is not difficult to prove the following result.
Proposition 4.
The operators x , ω, ν, out , def , id , p , ·, and ab x define a control structure.
The actions of this control structure determine the hypergraph model for the pattern calculus. We actually use the derived control operators:
out u = d e f ( u id 1 ) · out ; def u a = d e f u · def a .
The reaction ↘ is the smallest relation over the pattern nets closed under equality, composition, tensorial product and abstraction which satisfies the control rule
out u def u a a def u a .
The corresponding graphical description of the reaction rule is given by: Axioms 11 00008 i007
In this diagram, the scope of the def operator is represented as a gray patch; due to the properties derived from the syntax of our calculus, this patch can actually be determined from the hypergraph structure.
The operators, actions and reaction complete the definition of our nets.
It is worth noting that the def operator can be generalized, namely we can have a more general control operator def u 1 u m by def u 1 u m a = ( u 1 u m ) · def a . Moreover, the corresponding graphical representation is extended by using m external arcs to connect the new root hyperedge to the old one. The corresponding reaction is generalized in the following way: out u 1 out u m def u 1 u m a a def u 1 u m a .
We present some proprieties of the pattern nets. The proofs of these properties are tedious (but easy), based mainly on definitions and the structure of the nets.
Lemma 2.
We have the following properties:
1.
surf ( out u ) { u } and surf ( def u a ) { u } surf ( a ) .
2.
For any substitution σ = { x / y } , [ x / y ] out u = out σ u and [ x / y ] def u a = def σ u [ x / y ] a .
3.
If a b , then there exists b such that b = b and surf ( b ) surf ( a ) .
4.
v · out w def u ( y ) a b iff u = w and b = [ v / y ] a def u ( y ) a .
5.
a 1 a 2 a 3 c    iff    
  • either there exists i [ 3 ] such that a i b and c = b a j a k , or
  • there exist i , j [ 3 ] such that a i a j b and c = b a k , where [ 3 ] = { i , j , k } .
6.
Whenever u surf ( b ) , b def u a c    iff     b b and c = b def u a .
7.
ν · ( x ) a b    iff     a a and b = ν · ( x ) a .

5. Fully Abstract Hypergraph Model of the Pattern Calculus

This section presents the main results of the paper. These results reveal the hypergraphs as a fully abstract model for the pattern calculus. According to [11], a model is fully abstract if all observationally equivalent terms in the object language represent the same object in the model. This means that processes with different behaviour are not mapped to the same hypergraph. Moreover, we prove a correspondence between the reduction of the processes and the reduction of their hypergraph representation.
Definition 4.
The semantic relationship [ [ ] ] between the pattern calculus processes and the pattern nets is defined by structural induction as follows:
1.
[ [ 0 ] ] = id 0 ;
2.
[ [ u v ] ] = v · out u ;
3.
[ [ P Q ] ] = [ [ P ] ] [ [ Q ] ] ;
4.
[ [ def u y P in Q ] ] = ν · ( u ) ( [ [ Q ] ] def u ( y ) [ [ P ] ] ) .
We prove some results involving this semantic relationship [ [ ] ] .
Lemma 3.
For every process P P , we have [ [ P ] ] : 0 0 .
Proof. 
A simple induction on the structure of P. In the case of our nets, 0 is the neutral element of the arity monoid ( N , + , 0 ) . For case ( 4 ) of the previous definition, we use the discard operator ω instead of ω p . Since 1 is the only prime arity p of the monoid ( N , + , 0 ) , we omit the index without any risk of confusion.    □
Lemma 4.
For every process P P , we have surf ( [ [ P ] ] ) fn ( P ) .
Proof. 
By induction on the structure of P (the proof uses Lemma 2).    □
Lemma 5.
For two names x , y X and a process P P , we have [ [ { x / y } P ] ] = [ x / y ] [ [ P ] ] .
Proof. 
Induction on the definition of the substitution over processes (and Lemma 5).    □
Proposition 5.
If P Q , then [ [ P ] ] = [ [ Q ] ] .
Proof. 
Induction on the definition of structural congruence. Let us consider the relation
= { ( P , Q ) P P Q and [ [ P ] ] = [ [ Q ] ] } .
Proof is reduced to the equality between ∼ and ≡. Obviously, . We show that ∼ satisfies the axioms from the definition of ≡. Since ≡ is the smallest relation satisfying these axioms, it follows that , and so = . Thus, to prove that , it is enough to verify that ∼ satisfies the axioms from the definition of ≡.
The cases P 0 P , P Q Q P and ( P Q ) R P ( Q R ) are rather trivial, based on the fact that id 0 is neutral for tensor product, together with the commutativity and associativity of tensor product ⊗ in the equational theory (of the control structures).
Let us consider the other cases.
def u v P in Q def u t { t / v } P in Q , if t fn ( P ) .
Assume t fn ( P ) . By Lemma 4, it follows that t surf ( [ [ P ] ] ) . Then,
[ [ def u t { t / v } P in Q ] ] =
= ν · ( u ) ( [ [ Q ] ] def u ( t ) [ [ { t / v } P ] ] ) by   Lemma   5 = ν · ( u ) ( [ [ Q ] ] def u ( t ) [ t / v ] [ [ P ] ] ) = [ [ def u v P in Q ] ] .
def u v P in Q def w v { w / u } P in { w / u } Q if v { u , w } , w fn ( P Q ) .
Assume v { u , w } and w fn ( P Q ) ; then, u v and w fn ( P ) fn ( Q ) { v } . By Lemma 4, w surf ( [ [ P ] ] ) surf ( [ [ Q ] ] ) . If u = w , then the result is trivial.
Let us assume that u w .
[ [ def w v { w / u } P in { w / u } Q ] ] =
= ν · ( w ) ( [ [ { w / u } Q ] ] def w ( v ) [ [ { w / u } P ] ] ) by   Lemma   5 = ν · ( w ) ( [ w / u ] [ [ Q ] ] def w ( v ) [ w / u ] [ [ P ] ] ) by   Proposition   3   and Lemma   2 = ν · ( w ) [ w / u ] ( [ [ Q ] ] def u ( v ) [ [ P ] ] ) by   Lemma   2 = [ [ def u v P in Q ] ] .
Q 1 def u v P in Q 2 def u v P in ( Q 1 Q 2 ) if u fn ( Q 1 ) .
Assume u fn ( Q 1 ) . By Lemma 4, u surf ( [ [ Q 1 ] ] ) . Then,
[ [ def u v P in ( Q 1 Q 2 ) ] ] =
= ν · ( u ) ( [ [ Q 1 ] ] [ [ Q 2 ] ] def u ( v ) [ [ P ] ] ) by   Lemma   3   and   Proposition   2 = [ [ Q 1 def u v P in Q 2 ] ] .
def u v P 1 in def w t P 2 in Q def w t P 2 in def u v P 1 in Q
      if u w , u fn ( P 2 ) , and w fn ( P 1 ) .
Assume u w , u fn ( P 2 ) and w fn ( P 1 ) . By Lemma 4, it follows that u surf ( [ [ P 2 ] ] ) and w surf ( [ [ P 1 ] ] ) . Furthermore, by Lemma 2, w surf ( def u ( v ) [ [ P 1 ] ] .
[ [ def u v P 1 in def w t P 2 in Q ] ] =
= ν · ( u ) ( ν · ( w ) ( [ [ Q ] ] def w ( t ) [ [ P 2 ] ] ) def u ( v ) [ [ P 1 ] ] ) by   Proposition   2 = ν · ( u ) ( ν · ( w ) ( [ [ Q ] ] def w ( t ) [ [ P 2 ] ] def u ( v ) [ [ P 1 ] ] ) ) by   Proposition   2 = ( ν ν ) · ( u ) ( w ) ( [ [ Q ] ] def w ( t ) [ [ P 2 ] ] def u ( v ) [ [ P 1 ] ] ) = X .
In a similar way, we obtain [ [ def w t P 2 in def u v P 1 in Q ] ] =
= ( ν ν ) · ( w ) ( u ) ( [ [ Q ] ] def u ( v ) [ [ P 1 ] ] def w ( t ) [ [ P 2 ] ] ) = Y .
To complete the proof, it remains to prove that X = Y.
X = by   Proposition   2       
= ( ν ν ) · p 1 , 1 · ( w ) ( u ) ( [ [ Q ] ] def w ( t ) [ [ P 2 ] ] def u ( v ) [ [ P 1 ] ] ) = p 0 , 0 · ( ν ν ) · ( w ) ( u ) ( [ [ Q ] ] def u ( v ) [ [ P 1 ] ] def w ( t ) [ [ P 2 ] ] ) = Y .    □
Theorem 1.
If P Q , then [ [ P ] ] [ [ Q ] ] .
Proof. 
By induction on the definition of P Q .
* r1: P Q is
def u 1 y 1 Q 1 in def u 2 y 2 Q 2 in def u n y n Q n in R u i v
def u 1 y 1 Q 1 in def u 2 y 2 Q 2 in def u n y n Q n in R { v / y i } Q i , where
{ u i + 1 , , u n } ( fn ( Q i ) { u i } ) = , i [ n ] , and n 1 . According to Lemma 2 and Lemma 4, { u i + 1 , , u n } surf ( def u i ( y i ) [ [ Q i ] ] ) = . According to Proposition 2 and using the compatibility of ↘ with composition, tensorial product and abstraction,
[ [ P ] ] = ν · ( u 1 ) ( def u 1 ( y 1 ) [ [ Q 1 ] ]
= ν · ( u i ) ( def u i ( y i ) [ [ Q i ] ] ν · ( u n ) ( def u n ( y n ) [ [ Q n ] ] [ [ R ] ] v · out u i ) ) )
= ν · ( u 1 ) ( def u 1 ( y 1 ) [ [ Q 1 ] ] by   Lemma   2 ν · ( u i 1 ) ( def u i 1 ( y i 1 ) [ [ Q i 1 ] ] ν · ( u i ) ( ν · ( u i + 1 ) ( def u i + 1 ( y i + 1 ) [ [ Q i + 1 ] ] ν · ( u n ) ( def u n ( y n ) [ [ Q n ] ] [ [ R ] ] v · out u i def u i ( y i ) [ [ Q i ] ] ) . . . ) ) ) . . . )
ν · ( u 1 ) ( def u 1 ( y 1 ) [ [ Q 1 ] ] by   Lemma   5 ν · ( u i ) ( def u i ( y i ) [ [ Q i ] ] ν · ( u n ) ( def u n ( y n ) [ [ Q n ] ] [ [ R ] ] [ v / y i ] [ [ Q i ] ] ) ) ) = [ [ Q ] ] .
* r2: P Q is def u v R in P def u v R in Q with P Q .
By induction, [ [ P ] ] [ [ Q ] ] . Since ↘ is closed under composition, tensor and abstraction, it follows that
[ [ P ] ] = ν · ( u ) ( [ [ P ] ] def u ( v ) [ [ R ] ] ) ν · ( u ) ( [ [ Q ] ] def u ( v ) [ [ R ] ] ) = [ [ Q ] ] .
* r3: P Q with P P , P Q and Q Q .
By the induction hypothesis, [ [ P ] ] [ [ Q ] ] . By Proposition 5, we have [ [ P ] ] = [ [ P ] ] and [ [ Q ] ] = [ [ Q ] ] . Since ↘ is closed under equality, then [ [ P ] ] [ [ Q ] ] .    □
Lemma 6.
v · out u [ [ P ] ] a    iff     [ [ P ] ] b and a = v · out u b .
Proof. 
( ) A consequence of the fact that the reaction is closed under tensorial product and equality.
( ) Induction on the structure of P.
If P is the empty process or a message, then v · out u [ [ P ] ] . Therefore, the statement of the lemma is obviously true because its premise is not satisfied.
If P is a parallel composition P 1 P 2 , then v · out u [ [ P 1 ] ] [ [ P 2 ] ] a . Since v · out u , it follows (Lemma 2) that one of the following cases remains possible:
(1)
[ [ P i ] ] b and a = v · out u b [ [ P j ] ] ;
(2)
[ [ P i ] ] [ [ P j ] ] b and a = v · out u b ;
(3)
v · out u [ [ P i ] ] a and a = a [ [ P j ] ] , where { i , j } = [ 2 ] .
Note that by Proposition 2, we have [ [ P ] ] = [ [ P i ] ] [ [ P j ] ] .
In case ( 1 ) , [ [ P ] ] b [ [ P j ] ] , and we consider b = b [ [ P j ] ] . In case ( 2 ) , we take b = b . In case ( 3 ) , by induction, we have [ [ P i ] ] b and a = v · out u b . Thus, [ [ P ] ] b [ [ P j ] ] , considering b = b [ [ P j ] ] .
If P is a definition def w t P 1 in P 2 , then we may assume without losing generality that w { u , v } . It follows from Lemma 2 together with Proposition 2 that ν · ( w ) ( v · out u [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] ) a . By Lemma 2, v · out u [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] a and a = ν · ( w ) a . Since v · out u , def w ( t ) [ [ P 1 ] ] and v · out u def w ( t ) [ [ P 1 ] ] , it follows (according to Lemma 2) that one of the following cases remains possible:
(1)
[ [ P 2 ] ] b and a = v · out u b def w ( t ) [ [ P 1 ] ] ;
(2)
[ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] b and a = v · out u b ;
(3)
v · out u [ [ P 2 ] ] a and a = a def w ( t ) [ [ P 1 ] ] .
  In case ( 1 ) , [ [ P ] ] = ν · ( w ) ( [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] ) ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) . Considering b = ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) , it satisfies the requirements (according to Proposition 2). In case ( 2 ) , we have [ [ P ] ] ν · ( w ) b , and consider b = ν · ( w ) b . In case ( 3 ) , by induction hypothesis, [ [ P 2 ] ] b and a = v · out u b . Thus, [ [ P ] ] ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) , and consider b = ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) .    □
Lemma 7.
[ [ P ] ] [ [ Q ] ] a    iff    one of the following conditions holds:
1.
[ [ P ] ] b and a = b [ [ Q ] ] ;
2.
[ [ Q ] ] b and a = [ [ P ] ] b .
Proof. 
( ) A consequence of the fact that the reaction is closed under tensorial product and equality.
( ) Induction on the structure of P.
If P is the empty process 0, then condition 2 holds obviously.
If P is a message, then condition 2 holds by Lemma 6.
If P is a parallel composition P 1 P 2 , then [ [ P 1 ] ] [ [ P 2 ] ] [ [ Q ] ] a .
By Lemma 2, it follows that one of the following cases is possible:
( i )
[ [ Q ] ] b and a = [ [ P 1 ] ] [ [ P 2 ] ] b ;
( i i )
[ [ P i ] ] b and a = b [ [ P j ] ] [ [ Q ] ] ;
( i i i )
[ [ P i ] ] [ [ P j ] ] b and a = b [ [ Q ] ] ;
( i v )
[ [ P i ] ] [ [ Q ] ] a and a = a [ [ P j ] ] , where { i , j } = [ 2 ] .
According to Proposition 2, [ [ P ] ] = [ [ P i ] ] [ [ P j ] ] . In case ( i ) , condition 2 holds by taking b = b . In case ( i i ) , we have [ [ P ] ] b [ [ P j ] ] . Then, condition 1 holds by taking b = b [ [ P j ] ] . In case ( i i i ) , condition 1 holds by taking b = b .
In case ( i v ) , by induction, we distinguish two sub-cases:
( a )
[ [ P i ] ] b and a = b [ [ Q ] ] ;
( b )
[ [ Q ] ] b and a = [ [ P i ] ] b .
For ( a ) , we obtain [ [ P ] ] b [ [ P j ] ] , and condition 1 holds for b = b [ [ P j ] ] . For  ( b ) , condition 2 holds for b = b . In both sub-cases, some action commutations are required; they are possible according to Proposition 2.
If P is a definition def w t P 1 in P 2 , then we may assume without losing generality that w fn ( Q ) . By Lemma 4, w surf ( [ [ Q ] ] ) . According to Proposition 2, we have ν · ( w ) ( [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] [ [ Q ] ] ) a . By Lemma 2, [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] [ [ Q ] ] a and a = ν · ( w ) a . Since def w ( t ) [ [ P 1 ] ] , it follows from Lemma 2 that one of the following cases remains possible:
( i )
[ [ P 2 ] ] b and a = b def w ( t ) [ [ P 1 ] ] [ [ Q ] ] ;
( i i )
[ [ Q ] ] b and a = [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] b ;
( i i i )
[ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] b and a = b [ [ Q ] ] ;
( i v )
[ [ P 2 ] ] [ [ Q ] ] a and a = a def w ( t ) [ [ P 1 ] ] .
In case ( i ) , condition 1 holds for b = ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) .
In case ( i i ) , by Lemma 2, there exists b such that surf ( b ) surf ( [ [ Q ] ] ) and b = b ; condition 2 holds for this b. In case ( i i i ) , condition 1 holds for b = ν · ( w ) b .
In case ( i v ) , we distinguish two sub-cases:
( a )
[ [ P 2 ] ] b and a = b [ [ Q ] ] ;
( b )
[ [ Q ] ] b and a = [ [ P 2 ] ] b .
For ( a ) , condition 1 holds for b = ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) . For ( b ) , there exists b such that surf ( b ) surf ( [ [ Q ] ] ) and b = b (by Lemma 2); condition 2 holds for this b. Proposition 2 is used in all cases and sub-cases.    □
Lemma 8.
[ [ P ] ] def u ( y ) [ [ Q ] ] a    iff    one of the following conditions holds:
1.
[ [ P ] ] b and a = b def u ( y ) [ [ Q ] ] ;
2.
P R u v and a = [ [ R { v / y } Q ] ] def u ( y ) [ [ Q ] ] ;
3.
P def v 1 t 1 R 1 in def v 2 t 2 R 2 in . . . def v n t n R n in ( R u v n ) , and
a = ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] ν · ( v 2 ) ( def v 2 ( t 2 ) [ [ R 2 ] ] ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R { v n / y } Q ] ] def u ( y ) [ [ Q ] ] ) . . . ) ) ,
where v i fn ( Q ) { u } for every i [ n ] .
Proof. 
( ) If condition 1 holds, then the implication follows as a consequence of the fact that the reaction is closed under tensorial product and equality. If condition 2 holds, then we have
[ [ P ] ] def u ( y ) [ [ Q ] ] =                      by Proposition 5
= [ [ R ] ] v · out u def u ( y ) [ [ Q ] ] by   Lemma   2 [ [ R ] ] [ v / y ] [ [ Q ] ] def u ( y ) [ [ Q ] ] by   Lemma   5 = a .
If condition 3 holds, it follows by Lemma 2 and Lemma 4 that v i surf ( def u ( y ) [ [ Q ] ] ) for every i [ n ] . Then,
[ [ P ] ] def u ( y ) [ [ Q ] ] =                                   by Propositions 5 and 2
= ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] by   Lemma   2 ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R ] ] v n · out u def u ( y ) [ [ Q ] ] ) )
ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] by   Lemma   5 ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R ] ] [ v n / y ] [ [ Q ] ] def u ( y ) [ [ Q ] ] ) ) = a .
( ) Induction on the structure of P.
–  If P is the empty process 0 or a message w v with w u , then [ [ P ] ] def u ( y ) [ [ Q ] ] . The statement of the lemma is obviously true as its premise is not satisfied. On the other hand, if P is a message u v , then
[ [ P ] ] def u ( y ) [ [ Q ] ]             by Lemma 2
[ v / y ] [ [ Q ] ] def u ( y ) [ [ Q ] ] a by   Lemma   5 = 0 { v / y } Q def u ( y ) [ [ Q ] ] .
Furthermore, P 0 u v . Consequently, condition 2 holds.
–  If P is a parallel composition P 1 P 2 , then [ [ P 1 ] ] [ [ P 2 ] ] def u ( y ) [ [ Q ] ] a . Since def u ( y ) [ [ Q ] ] , it follows from Lemma 2 that one of the following cases remains possible:
( i )
[ [ P i ] ] b and a = b [ [ P j ] ] def u ( y ) [ [ Q ] ] ,
( i i )
[ [ P i ] ] [ [ P j ] ] b and a = b def u ( y ) [ [ Q ] ] ,
( i i i )
[ [ P i ] ] def u ( y ) [ [ Q ] ] a and a = a [ [ P j ] ] , where { i , j } = [ 2 ] .
According to Proposition 2, we obtain [ [ P ] ] = [ [ P i ] ] [ [ P j ] ] . In case  ( i ) , we obtain [ [ P ] ] b [ [ P j ] ] , and condition 1 holds for b = b [ [ P j ] ] . In case ( i i ) , condition 1 holds for b = b . In case ( i i i ) , we distinguish three sub-cases:
( a )
[ [ P i ] ] b and a = b def u ( y ) [ [ Q ] ] ;
( b )
P i R u v and a = [ [ R { v / y } Q ] ] def u ( y ) [ [ Q ] ] ;
( c )
P i def v 1 t 1 R 1 in def v n t n R n in ( R u v n ) and
a = ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R { v n / y } Q ] ] def u ( y ) [ [ Q ] ] ) ) , where v k fn ( Q ) { u } for every k [ n ] .
In sub-case ( a ) , we obtain [ [ P ] ] b [ [ P j ] ] . Therefore, condition 1 holds for b = b [ [ P j ] ] . For ( b ) , we have P R P j u v . By Proposition 2, a = [ [ R P j { v / y } Q ] ] def u ( y ) [ [ Q ] ] . Thus, condition 2 holds. For sub-case ( c ) , we may assume (without losing generality) that v k fn ( P j ) for every k [ n ] . By Lemma 4, it follows that v k surf ( [ [ P j ] ] ) for every k [ n ] . Then P def v 1 t 1 R 1 in def v n t n R n in ( R P j u v n ) , and
a =                                                    by Proposition 2
= ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R P j { v n / y } Q ] ] def u ( y ) [ [ Q ] ] ) ) .
Thus, condition 3 holds.
–  If P is a definition def w t P 1 in P 2 , then we can assume without losing generality that w fn ( Q ) { u } . By Lemma 4 and Lemma 2, w surf ( def u ( y ) [ [ Q ] ] ) . It follows from Proposition 2 that [ [ P ] ] def u ( y ) [ [ Q ] ] = ν · ( w ) ( [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ]   def u ( y ) [ [ Q ] ] ) a . By Lemma 2, [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] def u ( y ) [ [ Q ] ] a and a = ν · ( w ) a . Since def w ( t ) [ [ P 1 ] ] and def u ( y ) [ [ Q ] ] , then def u ( y ) [ [ Q ] ] def w ( t ) [ [ P 1 ] ] (according to Lemma 2). It follows that one of the following cases remains possible:
( i )
[ [ P 2 ] ] b and a = b def w ( t ) [ [ P 1 ] ] def u ( y ) [ [ Q ] ] ;
( i i )
[ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] b and a = b def u ( y ) [ [ Q ] ] ;
( i i i )
[ [ P 2 ] ] def u ( y ) [ [ Q ] ] a and a = a def w ( t ) [ [ P 1 ] ] .
In case ( i ) , condition 1 holds for b = ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) . In case ( i i ) , condition 1 holds for b = ν · ( w ) b . In case ( i i i ) , by induction, we distinguish three sub-cases:
( a )
[ [ P 2 ] ] b and a = b def u ( y ) [ [ Q ] ] ,
( b )
P 2 R u v and a = [ [ R { v / y } Q ] ] def u ( y ) [ [ Q ] ] ,
( c )
P 2 def v 1 t 1 R 1 in def v n t n R n in ( R u v n ) and
a = ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R { v n / y } Q ] ] def u ( y ) [ [ Q ] ] ) ) , where v k fn ( Q ) { u } for every k [ n ] .
In sub-case ( a ) , condition 1 holds for b = ν · ( w ) ( b def w ( t ) [ [ P 1 ] ] ) . In sub-case ( b ) , we have P def w t P 1 in ( R u v ) . We distinguish two situations:
v w . Then P def w t P 1 in R u v . It is easy to see that surf ( [ [ { v / y } Q ] ] ) { v } surf ( [ [ Q ] ] ) , and so w surf ( [ [ { v / y } Q ] ] ) . By Proposition 2, a = [ [ def w t P 1 in R { v / y } Q ] ] def u ( y ) [ [ Q ] ] . Thus, condition 2 holds.
v = w . Then P def v t P 1 in ( R u v ) . Moreover, a = ν · ( v ) ( def v ( t ) [ [ P 1 ] ] [ [ R { v / y } Q ] ] def u ( y ) [ [ Q ] ] ) . Thus, condition 3 holds.
In sub-case ( c ) , P def w t P 1 in def v 1 t 1 R 1 in def v n t n R n in ( R u v n ) . Using Proposition 2, we obtain
a = ν · ( w ) ( def w ( t ) [ [ P 1 ] ] ν · ( v 1 ) ( def v 1 ( t 1 ) [ [ R 1 ] ] ν · ( v n ) ( def v n ( t n ) [ [ R n ] ] [ [ R { v n / y } Q ] ] def u ( y ) [ [ Q ] ] ) ) ) .
Thus, condition 3 holds.    □
Theorem 2.
If [ [ P ] ] a , then there exists a process Q such that P Q and [ [ Q ] ] = a .
Proof. 
Induction on the structure of P.
–  If P is the empty process or a message, then [ [ P ] ] . Therefore, the statement of the theorem is obviously true because the premise is not satisfied.
–  If P is a parallel composition P 1 P 2 , then [ [ P 1 ] ] [ [ P 2 ] ] a . By Lemma 7, one of the following cases holds:
(1)
[ [ P 1 ] ] a 1 and a = a 1 [ [ P 2 ] ] ;
(2)
[ [ P 2 ] ] a 2 and a = [ [ P 1 ] ] a 2 .
It is sufficient to consider the case ( 1 ) , the other one being similar (symmetric).
By induction, we have P 1 Q 1 and a 1 = [ [ Q 1 ] ] . According to Proposition 1, P Q 1 P 2 and a = [ [ Q 1 ] ] [ [ P 2 ] ] . Thus, the result of the theorem holds for Q = Q 1 P 2 .
–  If P is a definition def w t P 1 in P 2 , then ν · ( w ) ( [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] a . It follows from Lemma 2 that [ [ P 2 ] ] def w ( t ) [ [ P 1 ] ] a and a = ν · ( w ) a . By Lemma 8, only one of the following cases holds:
(i)
[ [ P 2 ] ] b and a = b def w ( t ) [ [ P 1 ] ] ;
(ii)
P 2 R w v and a = [ [ R { v / t } P 1 ] ] def w ( t ) [ [ P 1 ] ] ;
(iii)
P 2 def w 1 t 1 R 1 in def w n t n R n in ( R w w n ) and
    a = ν · ( w 1 ) ( def w 1 ( t 1 ) [ [ R 1 ] ] ν · ( w n ) ( def w n ( t n ) [ [ R n ] ] [ [ R { w n / t } P 1 ] ] def w ( t ) [ [ P 1 ] ] ) . . . ) ,
    where w i fn ( P 1 ) { w } for every i [ n ] .
In case ( i ) , by the induction hypothesis, P 2 Q 2 and b = [ [ Q 2 ] ] . It follows that P def w t P 1 in Q 2 and a = ν · ( w ) ( [ [ Q 2 ] ] def w ( t ) [ [ P 1 ] ] ) Thus, the result of the theorem holds for Q = def w t P 1 in Q 2 .
In case ( i i ) , we have P def w t P 1 in ( R { v / t } P 1 ) and a = ν · ( w ) ( [ [ R { v / t } P 1 ] ] def w ( t ) [ [ P 1 ] ] ) = [ [ Q ] ] . Thus, the result of the theorem holds for Q = def w t P 1 in ( R { v / t } P 1 ) .
In case ( i i i ) , it follows that w i surf ( def w ( t ) [ [ P 1 ] ] ) for any i [ n ] (Lemmas 2 and 4).
P def w t P 1 in def w 1 t 1 R 1 in . . . def w n t n R n in ( R w w n )
Q def w t P 1 in def w 1 t 1 R 1 in def w n t n R n in ( R { w n / t } P 1 )
a = ν · ( w ) ( by   Proposition   2 ν · ( w 1 ) ( def w 1 ( t 1 ) [ [ R 1 ] ] ν · ( w n ) ( def w n ( t n ) [ [ R n ] ] [ [ R { w n / t } P 1 ] ] def w ( t ) [ [ P 1 ] ] ) ) ) = ν · ( w ) ( def w ( t ) [ [ P 1 ] ] ν · ( w 1 ) ( def w 1 ( t 1 ) [ [ R 1 ] ] ν · ( w n ) ( def w n ( t n ) [ [ R n ] ] [ [ R { w n / t } P 1 ] ] ) ) ) = [ [ Q ] ] .
   □

6. Describing Communication Patterns by Using the Hypergraph Model

In the Unix operating system, interprocess communications based on message queues allow exchange of information between processes. The processes exchange information by accessing a common message queue. Essentially, one process produces a message queue (via a message-passing module) that other processes may access; often a server places a message onto a queue which can be read by multiple clients. The sending process may specify its type when placing the message in a queue such that the reading processes can select the appropriate message; thus, message queues provide a way of multiplexing information from one producer to more consumers.
As example, we consider a simple system in which only one channel is used to exchange messages between the server and clients, and any message at the input of any client must appear at the output of all the clients (this is a requirement for several social networks including a chat messaging system). A type associated to each message allows a client to access the (unique) message queue for selectively reading only specific messages (in a first-in–first-out manner). We simplify the system, and consider a process S working as a server and two clients A and B. The channels idA and idB are used to indicate the type of messages from S to A and B, respectively; a channel idS indicates the type of messages from the clients to the server. Client A uses an input channel inA and an output channel outA; client B uses channels inB and outB). For a message m sent along the input channel inA, the pattern calculus process corresponding to this system is:
C o m m S y s t = def q x i d S y q x i d A _ q x i d B _ q x i d A y o u t A x q x i d B y o u t B x i n A x q x i d S _ i n B x q x i d S _ in i n A m .
Using the hypergraph model, in Figure 3 is presented the net corresponding to this process.
Except the root hyperedge, the structure of this net does not change during the evolution. Therefore, the evolution of the system could be described graphically focusing only on the root hyperedge; this evolution is depicted in Figure 4.
In Figure 4 it is not difficult to check visually the requirement that a message appearing at the input of a client appears also at the output of all the clients. In our case, the message m on the input channel inA (the initial step) appears at the output channels outA and outB in the final step described in Figure 4.

7. Conclusions and Related Work

In this paper we introduce a hypergraph model (given by the pattern nets) for the communication patterns. These nets provide a fully abstract model for the pattern calculus. In this way, a new sound graphical model for concurrency is introduced. We present a semantic interpretation of the pattern calculus in the framework of control structures, creating a graphical representation for the pattern calculus given by a new hypergraph model given by the pattern nets. By introducing a mapping from the control structure of pattern calculus into a set of hypergraphs, we provide a graphical model for communication patterns. It is also proved that the hypergraph model preserves the operational reductions of processes from pattern calculus and of the actions from the control structures. As an example, simple interprocess communications based on message queues inspired by the social networks are described by using our pattern nets. This example could be a first step towards more realistic scenarios in which the proposed model can be used to identify control structures supporting specific communication patterns. Future work will investigate realistic autonomic networking, mobility management, multiaccess selection, wireless and mobile networks (as they are presented in [12], for instance).
Graphical representations for process calculi highlight a new perception, providing a visual approach of concurrency and networks. According to our knowledge, just a few papers are devoted to the graphical presentations of the process calculi. We mention our previous attempts, namely the faithful π -nets [13], a graphical representation of the π -calculus machine [14], and a related approach by using jc-nets [15]. There exist also the graphical representations introduced by Robin Milner, namely action graphs and π -nets. Action graphs [16] are the graphical presentation of action calculi; they are very general, and so they are not able to describe specific features of certain action calculi. In the graphical presentation of the π -calculus given by the π -nets [6], channels are represented as rather complicated nodes called torpedos together with boxes representing guards, and messages are represented as directed arcs. The boxes obscure the internal nodes representing channels; to ensure access to the hidden channels, a rather complex additional mechanism of links is used. To avoid such a mechanism, in [13,14] the channels are represented by nodes, messages are represented by boxes of arcs and guards are represented by arcs between boxes. This approach simplified the graphical representation of the π -calculus; unfortunately, it provided identical representations for processes with different behaviours. Fortunately, this deficiency was overtaken in the pattern calculus hypergraph model: processes with different behaviours are not mapped to the same hypergraph. The hypergraph model is presented in the same formal framework used for the π -nets (it is worth noting that hypergraph model avoids certain irrelevant aspects of π -nets). It is simpler than the π -nets, preserving much of their expressive power (according to [2], the join calculus has the same expressive power as the π -calculus). Compared with all of them, the pattern nets represent a simple but sound graphical model for concurrency, providing a fully abstract model for the pattern calculus.

Funding

This research received no external funding.

Acknowledgments

Many thanks to Mihai Rotaru for his contributions in our past collaboration.

Conflicts of Interest

The author declares no conflict of interest.

References

  1. Resnik, M.D. Mathematics as a Science of Patterns; Oxford University Press: Oxford, UK, 1999. [Google Scholar]
  2. Fournet, C.; Gonthier, G. The reflexive CHAM and the join calculus. In Proceedings of the 23rd ACM Symposium on Principles of Programming Languages (POPL’96), St. Petersburg, FL, USA, 21–24 January 1996; Association for Computing Machinery: New York, NY, USA, 1996; pp. 372–385. [Google Scholar] [CrossRef]
  3. Levy, J.J. Some results in the join calculus. Lect. Notes Comput. Sci. 1997, 1281, 233–249. [Google Scholar]
  4. Milner, R. Communicating and Mobile Systems: The π-Calculus; Cambridge University Press: Cambridge, UK, 1999. [Google Scholar]
  5. Reisig, W. Understanding Petri Nets; Springer: Berlin, Germany, 2013. [Google Scholar]
  6. Milner, R. π-nets: A graphical form of π-calculus. Lect. Notes Comput. Sci. 1994, 788, 26–42. [Google Scholar]
  7. Schmidt, G.; Strohlein, T. Relations and Graphs; EATCS Monographs on Theor. Comput. Sci.; Springer: Berlin, Germany, 1993. [Google Scholar]
  8. Milner, R. Action calculi for syntactic action structures. Lect. Notes Comput. Sci. 1993, 711, 105–121. [Google Scholar]
  9. Mifsud, A.; Milner, R.; Power, J. Control structures. In Proceedings of the 10th IEEE Symposium on Logic in Computer Science (LICS’95), San Diego, CA, USA, 26–29 June 1995. [Google Scholar]
  10. Asperti, A.; Longo, G. Categories, Types and Structures; MIT Press: Cambridge, MA, USA, 1996. [Google Scholar]
  11. Milner, R. Fully abstract models of typed λ-calculi. Theor. Comput. Sci. 1977, 4, 1–22. [Google Scholar] [CrossRef] [Green Version]
  12. Pentikousis, K.; Blume, O.; Aguero, R.; Papavassiliou, S. Mobile Networks and Management; Springer: Berlin, Germany, 2010. [Google Scholar]
  13. Ciobanu, G.; Rotaru, M. Faithful π-nets. A graphical representation of the asynchronous π-calculus. Electron. Notes Theor. Comput. Sci. 1998, 18, 24–45. [Google Scholar] [CrossRef] [Green Version]
  14. Ciobanu, G.; Rotaru, M. A π-calculus machine. J. Univers. Comput. Sci. 2000, 6, 39–59. [Google Scholar]
  15. Ciobanu, G.; Rotaru, M. JC-nets. Lect. Notes Comput. Sci. 2001, 2055, 190–201. [Google Scholar]
  16. Milner, R. Calculi for interaction. Acta Inform. 1996, 33, 707–737. [Google Scholar] [CrossRef]
Figure 1. Graphical representations of a hypergraph.
Figure 1. Graphical representations of a hypergraph.
Axioms 11 00008 g001
Figure 2. A contraction on vertices (left), and a contraction on hyperedges (right).
Figure 2. A contraction on vertices (left), and a contraction on hyperedges (right).
Axioms 11 00008 g002
Figure 3. The net of a simple communication system described previously in pattern calculus.
Figure 3. The net of a simple communication system described previously in pattern calculus.
Axioms 11 00008 g003
Figure 4. The evolution of the system (as it appears in the root hyperedge).
Figure 4. The evolution of the system (as it appears in the root hyperedge).
Axioms 11 00008 g004
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Ciobanu, G. A Hypergraph Model for Communication Patterns. Axioms 2022, 11, 8. https://doi.org/10.3390/axioms11010008

AMA Style

Ciobanu G. A Hypergraph Model for Communication Patterns. Axioms. 2022; 11(1):8. https://doi.org/10.3390/axioms11010008

Chicago/Turabian Style

Ciobanu, Gabriel. 2022. "A Hypergraph Model for Communication Patterns" Axioms 11, no. 1: 8. https://doi.org/10.3390/axioms11010008

APA Style

Ciobanu, G. (2022). A Hypergraph Model for Communication Patterns. Axioms, 11(1), 8. https://doi.org/10.3390/axioms11010008

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop