+ All Categories
Home > Documents > O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio...

O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio...

Date post: 28-Mar-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
22
On Recursion, Replication and Scope Mechanisms in Process Calculi Jesús Aranda 1 , Cinzia Di Giusto 2 , Catuscia Palamidessi 3 , and Frank D. Valencia 4 1 Universidad del Valle Cali, Colombia and LIX École Polytechnique Paris , France [email protected] 2 Dip. Scienze dell’Informazione, Università di Bologna Bologna, Italy [email protected] 3 INRIA-LIX, École Polytechnique Paris, France [email protected] 4 CNRS - LIX École Polytechnique Paris, France [email protected] Abstract. In this paper we shall survey and discuss in detail the work on the relative expressiveness of recursion and replication in various process calculi. Namely, CCS, the π-calculus, the Ambient calculus, Concurrent Constraint Programming and calculi for Cryptographic Protocols. We shall give evidence that the ability of expressing recursive behaviour via replication often depends on the scoping mechanisms of the given calculus which compensate for the restriction of replication. 1 Introduction Process calculi such as CCS [Mil89], the π-calculus [Mil99] and Ambients [CG98] are among the most influential formal methods for modelling and analyzing the behaviour of concurrent systems; i.e. systems consisting of multiple computing agents, usually called processes, that interact with each other. A common fea- ture of these calculi is that they treat processes much like the λ-calculus treats computable functions. They provide a language in which the structure of terms represents the structure of processes together with an operational semantics to represent computational steps. Another common feature, also in the spirit of the λ-calculus, is that they pay special attention to economy. That is, there are few process constructors, each one with a distinct and fundamental role. The work of Jesús Aranda has been supported by COLCIENCIAS (Instituto Colom- biano para el Desarrollo de la Ciencia y la Tecnología "Francisco José de Caldas") and ÉGIDE (Centre francais pour l’accueil et les echanges internationaux). F.S. de Boer et al. (Eds.): FMCO 2006, LNCS 4709, pp. 185–206, 2007. c Springer-Verlag Berlin Heidelberg 2007
Transcript
Page 1: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and ScopeMechanisms in Process Calculi

Jesús Aranda1, Cinzia Di Giusto2, Catuscia Palamidessi3,and Frank D. Valencia4

1 Universidad del Valle Cali, Colombia and LIX École PolytechniqueParis!, France

[email protected] Dip. Scienze dell’Informazione, Università di Bologna

Bologna, [email protected]

3 INRIA-LIX, École PolytechniqueParis, France

[email protected] CNRS - LIX École Polytechnique

Paris, [email protected]

Abstract. In this paper we shall survey and discuss in detail the work onthe relative expressiveness of recursion and replication in various processcalculi. Namely, CCS, the !-calculus, the Ambient calculus, ConcurrentConstraint Programming and calculi for Cryptographic Protocols. Weshall give evidence that the ability of expressing recursive behaviour viareplication often depends on the scoping mechanisms of the given calculuswhich compensate for the restriction of replication.

1 Introduction

Process calculi such as CCS [Mil89], the π-calculus [Mil99] and Ambients [CG98]are among the most influential formal methods for modelling and analyzing thebehaviour of concurrent systems; i.e. systems consisting of multiple computingagents, usually called processes, that interact with each other. A common fea-ture of these calculi is that they treat processes much like the λ-calculus treatscomputable functions. They provide a language in which the structure of termsrepresents the structure of processes together with an operational semantics torepresent computational steps. Another common feature, also in the spirit of theλ-calculus, is that they pay special attention to economy. That is, there are fewprocess constructors, each one with a distinct and fundamental role.! The work of Jesús Aranda has been supported by COLCIENCIAS (Instituto Colom-

biano para el Desarrollo de la Ciencia y la Tecnología "Francisco José de Caldas")and ÉGIDE (Centre francais pour l’accueil et les echanges internationaux).

F.S. de Boer et al. (Eds.): FMCO 2006, LNCS 4709, pp. 185–206, 2007.c! Springer-Verlag Berlin Heidelberg 2007

Page 2: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

186 J. Aranda et al.

For example, a typical process term is the parallel composition P | Q, whichis built from the terms P and Q with the constructor | and it representsthe process that results from the parallel execution of the processes P and Q.Another typical term is the restriction (νx)P which represents a process P witha private resource x—e.g., a location, a link, or a name. An operational semanticsmay dictate that if P can reduce to (or evolve into) P ", written P !" P ", thenwe can also have the reductions P | Q !" P " | Q and (νx)P !" (νx)P ".

Infinite behaviour is ubiquitous in concurrent systems (e.g., browsers, searchengines, reservation systems). Hence, it ought to be represented by process terms.Two standard term representations of them are recursive process expressions andreplication.

Recursive process expressions are reminiscent of the recursive expressions usedin other areas of computer science, such as for example Functional Program-ming. They may come in the form µX.P where P may have occurrences of X .The process µX.P behaves as P with the (free) occurrences of X replaced byµX.P . Another presentation of recursion is by using parametric processes of theform A(y1, . . . , yn) each assumed to have a unique, possibly recursive, definitionA(x1, . . . , xn) def= P where the xi’s are pairwise distinct, and the intuition is thatA(y1, . . . , yn) behaves as its P with each yi replacing xi.

Replication, syntactically simpler than recursion, takes the form !P and it isreminiscent of Girard’s bang operator; an operator used to express unlimitednumber of copies of a given resource in linear-logic [Gir87]. Intuitively, !P meansP | P | · · · ; an unbounded number of copies of the process P .

Now, it is not uncommon that a given process calculus, originally presentedwith one form of defining infinite behavior, is later presented with the other.For example, the π-calculus was originally presented with recursive expressionsand later with replication [MPW92]. The Ambient calculus was originally pre-sented with replication and later with recursion [LS03]. This is reasonable as avariant may simplify the presentation of the calculus or be tailored to specificapplications.

From the above intuitive description it should be easy to see that µX.(P | X)expresses the unbounded parallel behaviour of !P . It is less clear, however,whether replication can be used to express the unbounded behaviour of µX.P .In particular, processes that allows for unboundedly many nested restrictions as,for example, in µX.(νx)(P | X) which behaves as (νx)(P | (νx)(P | (νx)(P |· · · ))). In fact, the ability of expressing recursive behaviours via replication de-pends on the particular process calculus under consideration. We shall see thattypically that scoping mechanisms such as restriction (or hiding) and name pass-ing play a key role in the recursion vs replication expressiveness question.

The above discussion raises the issue of expressiveness. What does it mean forone variant to be as expressive as another ? The answer to this question is definitein the realm of computability theory via the notion of language equivalence. Inconcurrency theory, however, this issue is not quite settled.

One approach to comparing expressiveness of two given process calculus vari-ants is by comparing them w.r.t. some standard process equivalence, say #. If

Page 3: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 187

for every process P in one variant there is a Q in the other variant such thatQ # P then we say that the latter variant is at least as expressive as the former.

Another approach consists in telling two variants apart by showing that inone variant one can solve some fundamental problem (e.g., leader election) whilein the other one cannot. It should be noticed that, unlike computability theory,the capability of two variants of simulating Turing Machines does not implyequality in their expressiveness. For example, [Pal97] shows that under somereasonable assumptions the asynchronous version of the π-calculus, which cancertainly encode Turing Machines, is strictly less expressive than the originalcalculus.

In this paper, we shall survey and discuss the work on the relative expressive-ness of recursion and replication in various process calculi. In particular, CCS,the π-calculus, and the Ambient calculus. We shall begin with the π-calculus,then CCS and then the Ambients calculus. For the simplicity of the presentationwe shall consider the polyadic variant of the π-calculus [Mil93]. Finally, we shallalso overview the work on this subject in related calculi such as tcc [SJG94]and calculi for Cryptographic Protocols [HS05]. This paper is the extended andrevised version of the survey in [PV05].

2 The Polyadic Pi Calculus: p!

One of the earliest discussions about the relative expressiveness between repli-cation and recursion was in the context of the polyadic π-calculus [Mil93]; oneof the main calculi for mobility. It turns out that in this calculus replication isjust as expressive as recursion. This result is rather surprising since replicationseems such an elementary construct without much control power.

In what follows we shall introduce the polyadic π-calculus and the variantsrelevant for this paper. The various CCS and Ambients variants will be presentedin the next sections as extension/restrictions of the polyadic π-calculus.

2.1 Finite Pi-Calculus

Names are the most primitive entities in the π-calculus. We presuppose a count-able set of (port, links or channel) names, ranged over by x, y, . . .. For eachname x, we assume a co-name x thought of as complementary, so we decree thatx = x. We shall use l, l", . . . to range over names and co-names. We use x todenote a finite sequence of names x1x2 · · · xn. The other entity in the π-calculusis a process. Process are built from names by the following syntax:

P, Q, . . . :=!

i#I

αi.Pi | (νx)P | P | Q (1)

α := xy | x(y)

where I is a finite set of indexes.Let us recall briefly some notions as well as the intuitive behaviour of the

various constructs.

Page 4: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

188 J. Aranda et al.

The construct"

i#I αi.Pi represents a process able to perform one–but onlyone–of its αi’s actions and then behave as the corresponding Pi. The actionsprefixing the Pi’s can be of two forms: An output xy and an input x(y). Inboth cases x is called the subject and y the object. The action xy represents thecapability of sending the names y on channel x. The action x(y), with no nameoccurring twice in y, represents the capability of receiving the names on channelx, say z, and replacing each yi with zi in its corresponding continuation.

Furthermore, in x(y).P the input actions binds the names y in P . The othername binder is the restriction (νx)P which declares a name x private to P , hencebound in P . Given Q we define in the standard way its bound names bn(Q) asthe set of variables with a bound occurrence in Q, and its free names fn(Q) asthe set of variables with a non-bound occurrence in Q.

Finally, the process P | Q denotes parallel composition; P and Q running inparallel.

Convention 1. We write the summation as 0 if |I| = 0, and drop the “"

i#I”if |I| = 1. Also we write α1.P1 + · · · + αn.Pn for

"i#{1,...,n} αi.Pi.

For simplicity, we omit “()” in processes of the form x().P as well as the“.0” in processes of the form x(y).0. We use (νx1x2 · · ·xn)P as an abbreviation(νx1)(νx2) · · · (νxn)P and

#i#I Pi, where I = {i1, . . . , in}, as an abbreviation

of Pi1 | · · · | Pin . Furthermore, Pσ, where σ = {z1/y1, . . . , zn/yn}, denotesthe process that results from the substitution in P of each zi for yi, applyingα-conversion wherever necessary to avoid captures.

Reduction Semantics of Finite Processes. The above intuition about proc-ess behaviour is made precise by the rules in Table 1. The reduction relation!" is the least binary relation on processes satisfying the rules in Table 1. Therules are easily seen to realize the above intuition.

We shall use !"$ to denote the reflexive, transitive closure of !". A re-duction P !" Q basically says that P can evolve, after some communicationbetween its subprocesses, into Q. The reductions are quotiented by the structuralcongruence relation $ which postulates some basic process equivalences.

Definition 1 (Structural Congruence). Let $ be the smallest congruenceover processes satisfying the following axioms:

1. P $ Q if P and Q differ only by a change of bound names (α-equivalence).2. P | 0 $ P, P | Q $ Q | P , P | (Q | R) $ (P | Q) | R.3. If x %& fn(P ) then (νx)(P | Q) $ P | (νx)Q.4. (νx)0 $ 0, (νx)(νy)P $ (νy)(νx)P .

2.2 Infinite Processes in the Polyadic Pi-Calculus

In the literature there are at least two alternatives to extend the above syntaxto express infinite behavior. We describe them next.

Page 5: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 189

Table 1. Reductions Rules

REACT:(· · · + xz1 · · · zn.P ) | (· · · + x(y1 · · · yn).Q) !" P | Q{z1/y1, . . . , zn/yn}

PAR: P !" P !

P | Q !" P ! | QRES: P !" P !

("x)P !" ("x)P !

STRUCT:P # P ! !" Q! # Q

P !" Q

Pi with Parametric Recursive Definitions: p!D

A typical way of specifying infinite behavior is by using parametric recursive def-initions [Mil99]. In this case we extend the syntax of finite processes (Equation 1)as follows:

P, Q, . . . := . . . | A(y1, . . . , yn) (2)

Here A(y1, . . . , yn) is an identifier (also call, or invocation) of arity n. Weassume that every such an identifier has a unique, possibly recursive, definitionA(x1, . . . , xn) def= P where the xi’s are pairwise distinct, and the intuition is thatA(y1, . . . , yn) behaves as its P with each yi replacing xi. We shall presupposefinitely many such definitions. Furthermore, for each A(x1, . . . , xn) def= P werequire

fn(P ) ' {x1, . . . , xn}. (3)

The reduction semantics of the extended processes is obtained simply by ex-tending the structural congruence $ in Definition 1 with the following axiom:

A(y1, . . . , yn) $ P [y1, . . . , yn/x1, . . . , xn] if A(x1, . . . , xn) def= P. (4)

As usual P [y1 . . . yn/x1 . . . xn] results from syntactically replacing every freeoccurrence of xi with yi and by applying name α-conversion, wherever neededto avoid capture.

We shall use pπD to denote the polyadic π-calculus with parametric recursivedefinitions with the above syntactic restrictions.

Pi with Replication: p!!

A simple way of expressing infinite behaviour in the π-calculus is by using repli-cation. We shall use pπ! to denote the polyadic π-calculus with replication.

In the pπ! case, the syntax of finite processes (Equation 1) is extended asfollows:

P, Q, . . . := . . . | !P. (5)

Page 6: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

190 J. Aranda et al.

Intuitively !P behaves as P | P | . . . | P | !P ; unboundedly many copiesof P .

The reduction semantics for pπ! is obtained simply by extending the structuralcongruence $ in Definition 1 with the following axiom:

!P $ P | !P. (6)

Barbed Bisimilarity

We shall often state expressiveness results by claiming the existence of a processin one calculus which is equivalent to some given process in another calculus.For this purpose, here we recall a standard way of comparing processes. We shalluse pπ! to denote the calculus with replication.

Let us begin by recalling a basic notion of observation for the π-calculus.Intuitively, given l = x (l = x) we say that (the barb) l can be observed at P ,written P (l, i! P can have an input (output) with subject x. Formally,

Definition 2 (Barbs). Define P (x iff )z, y, R : P $ (νz)(xy.Q | R)and x is not in z. Similarly, P (x iff )z, y, Q, R : P $ (νz)(x(y).Q | R) andx is not in z. Furthermore, P *l iff )Q : P !"$ Q (l .

Let us now recall the notion of barbed (weak) bisimilarity and congruence. Re-member that a process context C in a given calculus is an expression with a hole[·] such that placing a process in the hole produces a well-formed process termin the calculus. If C is a context and P a process, we write C[P ] for the processobtained by replacing the [·] in C by P .

For technical purposes, we shall use pπD+! as the calculus whose process syn-tax arises from extending the syntax of finite processes (Equation 1) with bothreplication and recursive definitions. The reduction semantics of pπD+! of theextended processes is obtained by extending the structural congruence $ in Def-inition 1 with the axioms in Equations 4 and 6.

Definition 3 (Barbed Bisimilarity). A (weak) barbed-simulation is a binaryrelation R satisfying the following: (P, Q) & R implies that:

1. if P !" P " then )Q" : Q !"$ Q" + (P ", Q") & R.2. if P (l then Q *l .

The relation R is a barbed bisimulation iff both R and its converse R%1 arebarbed -simulations. We say that P and Q are (weak) barbed bisimilar, writtenP # Q, iff (P, Q) & R for some barbed bisimulation R. Furthermore, we saythat P and Q are barbed congruent, written P , Q, iff for each context C inpπD+!, C[P ] # C[Q].

2.3 Recursive Definitions vs. Replication in Pi

Here we recall a result stating that the variants pπ! and pπD can be regarded asbeing equally expressive w.r.t (weak) barbed congruence , given in Definition 3.

Page 7: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 191

More precisely, the expressiveness criteria w.r.t barbed congruence we shall usein this section can be stated as follows.

Criteria 2. We say that a π-calculus variant is as expressive as another i! forevery process P in the second variant one can construct a process [[P ]] in thefirst variant such that [[P ]] is (weakly) barbed congruent to P .

All the results presented in this section are consequences of the expressivenessresults in [SW01].

From p!D to p!! and Back: Encodings

We shall now provide encodings from one variant into the other and state theircorrectness. We shall say that a map [[]] is a homomorphism for parallel com-position i! [[P | Q]] = [[P ]] | [[Q]]. The notion of homomorphism for the otheroperators is defined analogously.

Definition 4. Let [[·]]0 be the map from pπD processes and recursive definitionsinto pπ! processes given by:

[[Ai(xi)def= Pi]]0 = ! ai(xi).[[Pi]]0,

[[Ai(yi)]]0 = aiyi,

and for all other processes [[·]]0 is a homomorphism.Let P be an arbitrary pπD process with { A1(xi)

def= P1, . . . , An(xn) def= Pn }as the set of recursive definitions of its process identifiers. The encoding of P ,denoted [[P ]], is defined as

[[P ]] = (νa1 · · ·an)([[P ]]0 |$

i#{1,...,n}

[[Ai(xi)def= Pi]]0)

where a1, . . . , an %& fn(P ).

Intuitively, each A(y), with A(x) def= P , is translated into a particle ay whichexcites a copy of P (with y substituted for x) by interacting with a replicatedresource, a provider of instances of P , of the form ! a(x).[[P ]]. The correctness ofthe encoding is stated below.

Theorem 3. Let [[·]] be the encoding in Definition 4. For each P in pπD, P ,[[P ]].

Let us now give an encoding of pπ! into pπD. The idea is simple: Each !P istranslated into a process AP , recursively defined as AP (x) def= P | AP (x) whichcan provide an unbounded number of copies of P .

Definition 5. Let [[·]]0 be the map from pπ! processes into pπD processes givenby:

[[!P ]] = AP (x) where AP (x) def= P | AP (x) and fn(P ) ' {x}and for all other processes [[·]]0 is a homomorphism.

Page 8: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

192 J. Aranda et al.

We can now state the correctness with respect to barbed congruence.

Theorem 4. Let [[·]] be the encoding in Definition 5. For each P in pπ!, P ,[[P ]].

2.4 Recursion vs. Replication in the Private Pi Calculus

The Private π-calculus [SW01] is a sub-calculus with a restricted form of com-munication. The idea is that only bound-outputs are allowed; i.e, outputs of theform (νz)xz.P . Such bound-outputs are usually abbreviated as x(z) assumingthat no name occur more than once in z.

The above syntactic restriction results in a pleasant symmetry between inputsand outputs in that they both can be seen as binders. Moreover, the restrictionensures that α-conversion is the only kind of substitution required in the cal-culus. In fact, the rule REACT in Table 1, which applies a substitution to thecontinuation of the input, can be replaced by the following rule:

x(z).P | x(z).P !" (νz)(P | Q) (7)

Let us denote by Privpπ! the calculus that results from applying to pπ! thesyntactic restriction mentioned above. The PrivpπD calculus is analogously de-fined as a restriction on pπD except that we need an extra-condition to ensurethat α-conversion is the only substitution needed in the calculus: In every invo-cation A(z), no name may occur more than once in the vector z.

Now, if we wish an encoding [[·]] from Privpπ! into PrivpπD such that [[P ]] ,P , we can simply take that of Definition 5 restricted to the Privpπ! case. Asshown below, however, the above restriction makes impossible the existence ofan encoding from PrivpπD into Privpπ!.

Consider for example the process P = A(z0) where

A(x) def= x(z).A(z).

The process P , in parallel with a suitable R, can perform a sequence of actionswhere the object of an action is the subject of the next one. Sequences of thisform are called logical threads [SW01]. Moreover, P can perform the infinitelogical thread z0(z1).z1(z2). . . ..

Interestingly, as an application of the type theory for Privpπ!, the resultsin [SW01] state that no process in Privpπ! can exhibit an infinite logical thread.Together with P above, this property of Privpπ! can be used to prove the fol-lowing result.

Theorem 5. There is a process P in PrivpπD such that P %, Q for every Q inPrivpπ!.

Therefore, we cannot have an expressiveness result of the kind we have for pπDand pπ! in the previous section. I.e., there is no encoding [[·]] from PrivpπD proc-esses into Privpπ! processes such that [[P ]] , P.

Page 9: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 193

3 The Calculus of Communicating Systems (CCS)

Undoubtedly CCS [Mil89], a calculus for synchronous communication, remainsas a standard representative of process calculi. In fact, many foundational ideasin the theory of concurrency have sprung from this calculus. In the following weshall consider some variants of CCS without relabelling operations.

3.1 Finite CCS

The finite CCS processes can be obtained as a restriction of the finite processesof the Polyadic π-calculus by requiring all inputs and outputs to have emptysubjects only. Intuitively, this means that in CCS there is no sending/receivingof links but synchronization on them. (Notice that the ability of transmittingnames is used for the encoding of recursion into replication in Definition 4.)More, precisely, the syntax of finite CCS processes is obtained by replacing thesecond line of Equation (1) with

α := x | x | τ (8)

where τ represents a distinguished action; the silent action, with the decree thatτ = τ .

The (unlabelled) reduction relation !" for finite CCS processes can be ob-tained from that for the π-calculus given in the previous section. However, sinceα-conversion does not hold for one of the CCS variants we consider next, wefind it convenient to define !" in terms of labelled reduction of CCS given inTable 2. A transition P

!!" Q says that P can perform an action α and evolveinto Q. The reduction relation is then defined as !"def= "!".

3.2 Infinite CCS Processes

Both recursion and replication are found in the CCS literature in the forms wesaw for the polyadic π-calculus. Nevertheless, as recursion in CCS comes in otherforms. Some forms of recursion exhibit dynamic name scoping while others, asin the π-calculus, have static name scoping. By dynamic scoping we mean that,unlike the static case, the occurrence of a name can get dynamically (i.e., duringexecution) captured under a restriction. Surprisingly, this will have an impacton their relative expressiveness.

In the literature there are at least four alternatives to extend the above syntaxto express infinite behavior. We describe them next.

CCS with Parametric Definitions: CCSp

The processes of CCSp calculus are the finite CCS processes plus recursion usingparametric definition exactly as in pπD. So in particular we have the restriction

Page 10: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

194 J. Aranda et al.

Table 2. An operational semantics for finite CCS

SUM "i"I #i.Pi

αj!" Pj

if j $ I RESP

α!" P !

("x)P α!" ("x)P !if # %$ {x, x}

PAR1P

α!" P !

P | Qα!" P ! | Q

PAR2Q

α!" Q!

P | Qα!" P | Q! COM

Pα!" P ! Q

α!" Q!

P | Qτ!" P ! | Q!

REDP

τ!" Q

P !" Q

on parametric definitions in Equation 3. The calculus is the variant in [Mil99].The rules for CCSp are those in Table 2 plus the rule:

CALLPA[y1, . . . , yn/x1, . . . , xn] !!" P "

A(y1, . . . , yn) !!" P "if A(x1, . . . , xn) def= PA (9)

As usual P [y1 . . . yn/x1 . . . xn] results from syntactically replacing every free oc-currence of xi with yi renaming bound names, i.e., name α-conversion, whereverneeded to avoid capture. (Of course if n = 0, P [y1 . . . yn/x1 . . . xn] = P ).

As shown in [Mil99] in CCSp we can identify process expression di!ering onlyby renaming of bound names; i.e., name α-equivalence—hence (νx)P is the sameas (νy)P [y/x].

Constant Definitions: CCSk

We now consider the CCS alternative for infinite behavior given in [Mil89]. Werefer to identifiers with arity zero and their corresponding definitions as constantand constant (or parameterless) definitions, respectively. We omit the “( )” inA( ).

Given Adef= P , requiring all names in fn(P ) to be formal parameters, as we did

in pπD (Equation 3), would be too restrictive—P would not have visible actions.Consequently, let us drop the requirement to consider a fragment allowing onlyconstant definitions but with possible occurrence of free names in their bodies.The rules for this fragments are those of CCSp. We shall refer to this fragmentas CCSk. In this case Rule CALL, which for CCSk we prefer to call CONS, takesthe form

CONSP

!!" P "

A!!" P "

if Adef= P (10)

i.e., there is no α-conversion involved; thus allowing name captures. As illustratedin the next section, this causes scoping to be dynamic and α-equivalence not to

Page 11: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 195

hold. This is also the reason we cannot just take the reduction relation !" of theπ-calculus restricted to CCSk processes as such a relation assumes α-conversiondue to the structural rule.

Recursion Expressions: CCSµ

Hitherto we have seen process expressions whose recursive behavior is specifiedin an underlying set of definitions. It is often convenient, however, to have ex-pressions which can specify recursive behavior on their own. Let us now extendthe finite CCS processes to include such recursive expressions. The extendedsyntax is given by:

P, Q, . . . := . . . | X | µX.P (11)

Here µX.P binds the occurrences of the process variable X in P . As forbound and free names, the bound variables of P , bv(P ) are those with a boundoccurrence in P , and the free variables of P , fv(P ) are those with a non-boundoccurrence in P . An expression generated by the above syntax is said to be aprocess (expression) i! it is closed (i.e., it contains no free variables). The processµX.P behaves as P with the free occurrences of X replaced by µX.P . Apply-ing variable α-conversions wherever necessary to avoid captures. The semanticsµX.P is given by the rule:

RECP [µX.P/X ] !!" P "

µX.P!!" P " (12)

We call the resulting calculus CCSµ. From [EN86] it follows that in CCSµ wecan identify processes up-to name α-equivalence.

Remark 1 (Static and Dynamic Scope: Preservation of α-Equivalence).An interesting issue of the substitution [µX.P/X ] applied to P is whether italso requires the renaming of bound names in P to avoid captures (i.e., nameα-conversion). Such a requirement seems necessary should we want to identifyprocess up-to α-equivalence. In fact, the requirement gives CCSµ static scope ofnames. Let us illustrate this with an example.

Example 1. Consider µX.P with P = (x | (νx)(x̄.t | X)). First, let us assumewe perform name α-conversions to avoid captures. So, [µX.P/X ] in P renamesthe bound x by a fresh name, say z, thus avoiding the capture of P "s free x inthe replacement: I.e,

P [µX.P/X ] = (x | (νz)(z̄.t | µX.P )) = (x | (νz)(z̄.t | µX.(x | (νx)(x̄.t | X))))

The reader may care to verify (using the rules in Table 2 plus Rule REC) thatt will not be performed; i.e., there is no µX.P

!1!" P1!2!" . . . s.t. αi = t.

Now let us assume that the substitution makes no name α-conversion, thuscausing a free occurrence of x in P , shown in a box below, to get bound, dynam-ically in the scope of the outermost restriction: I.e.,

P [µX.P/X ] = (x | (νx)(x̄.t | µX.P )) = (x | (νx)(x̄.t | µX.( x | (νx)(x̄.t | X)))).

Page 12: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

196 J. Aranda et al.

The reader can verify that now t can eventually be performed. Such an executionof t cannot be performed by µX.Q where Q is (x | (νz)(z.t | X)) i.e, P withthe binding and bound occurrence of x syntactically replaced with z. This showsthat name α-equivalence does not hold in this dynamic scope case. -.

It should be pointed out that using recursive expressions with no name α-conversion is in fact equivalent to using instead constant definitions as in theprevious calculus CCSk. In fact, in presenting CCS, [Mil89] uses alternativelyboth kinds of constructions; using Rule REC, with no name α-conversion, forone and Rule CONS for the other. For example, by taking A

def= P with P asin Example 1 one can verify that in CCSk, A exhibits exactly the same dyna-mic scoping behavior illustrated in the above example. So, name α-equivalencedoes not hold in CCS. Notice that the above observations imply some semanticsdi!erences between CCS and the π-calculus. The former does not satisfy nameα-equivalence because of the dynamic nature of name scoping—see Example 1.The latter uses static scoping and satisfies α-equivalence. -.

Replication: CCS!

The processes of CCS! are those finite CCS processes plus replication exactlyas in pπ!. This variant is presented in [BGZ03]. In the context of CCS, thisoperators are studied in [BGZ03,BGZ04,GSV04].

The operational rules for CCS! are those in Table 2 plus the following rule:

REPP | !P !!" P "

!P !!" P " (13)

From [Mil99] we know that in CCS! one can identify processes up to nameα-equivalence.

3.3 Expressiveness Results for CCS

In this section we report results from [BGZ03, BGZ04, GSV04] on the expres-siveness for the CCS variants above.

The following theorem summarizes the expressiveness of the various calculiand it is an immediate consequence of the results in [BGZ03] and [GSV04]. Asfor the π-calculus we compare expressiveness w.r.t. barbed congruence with theobvious restriction to CCS contexts (see Criteria 2).

Theorem 6. The following holds for the CCS variants:

1. CCSk is exactly as expressive as CCSp w.r.t barbed congruence.2. CCSµ is exactly as expressive as CCS! w.r.t barbed congruence.3. The divergence problem (i.e., whether a given process P has an infinite se-

quence of !" reductions) is undecidable for the calculi in (1) but decidablefor those in (2).

Page 13: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 197

The results (1-3) are summarized in Figure 1. Let us now elaborate on thesignificance and implications of the above results. A noteworthy aspect of (1)is that any finite set of parametric (possibly mutually recursive) definitions canbe replaced by a set, finite as well, of parameterless definitions . This arisesas a result of the restricted nature of communication in CCS (e.g., absence ofmobility). Related to this result is that of [Mil89] which shows that, in thecontext of value-passing CCS, a parametric definition can be encoded using anset of constant definitions and infinite sums. However, this set is infinite.

Regarding (1) some readers may feel that given a process P with a parametricdefinition D, one could simply create as many constant definitions as permuta-tions of possible parameters w.r.t. the finite set of names in P and D. This wouldnot work for CCSp; the unfolding of call to D within a restriction may need α-conversions to avoid name captures, thus generating new names (i.e., names notin P nor D) during execution.

Regarding (2), we wish to recall the encoding [[·]] of CCSµ into CCS! whichresembles that of Definition 4 in the context of the π-calculus.

Definition 6. The encoding [[·]] of CCSµ processes into CCS! is homomorphicover all operators in the sub-calculus defining finite behavior and is otherwisedefined as follows:

[[Xi]] = x̄i

[[µXi.P ]] = (νxi)(!xi.[[P ]] | x̄i)

where the names xi’s are fresh.

The above encoding is correct w.r.t. barbed congruence, i.e., [[P ]] , P . It isimportant to notice that it would not be correct had we adopted dynamic scopingin the Rule REC for CCSk (see Remark 1). The µX.P in Example 1 actuallygives us a counter-example.

Another noteworthy aspect of the results mentioned above is the distinctionbetween static and dynamic name scoping for the calculi under consideration.Static scoping renders the calculus with recursion decidable, w.r.t. the diver-gence problem, and no more expressive than the calculus with replication. Incontrast, dynamic scoping renders the calculus with constant definitions unde-cidable and as expressive as that with parametric definitions. This is interestingsince as discussed in Section 3.2 the di!erence between the calculi with staticor dynamic scoping is very subtle. Using static scoping for recursive expressionswas discussed in the context of ECCS [EN86], an extension of CCS whose ideaslead to the design of the π-calculus [Mil99].

It should be noticed that preservation of divergence is not a requirementfor equality of expressiveness w.r.t barbed congruence since barbed congruencedoes not preserve divergence. Hence, although the results in [BGZ03] prove thatdivergence is decidable for CCS! (and undecidable for CCSp), it does not fol-low directly from the arrows in Figure 1 that it is also decidable for CCSµ.The decidability of the divergency problem for CCSµ is proven in [GSV04].

Finally, it is worth pointing out that, as exposed in [MP03], decidability ofdivergence does not imply lack of Turing expressiveness. In fact a remarkable

Page 14: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

198 J. Aranda et al.

Fig. 1. Classification of CCS variants. An arrow from X to Y indicates that for ev-ery P in Y one can construct a process [[P ]] in X which is barbed congruent to P .(Un)decidability is meant w.r.t. the existence of divergent computations.

result in [BGZ04] states that CCS! is Turing-complete. We shall discuss this atlength in the following section.

3.4 CCS! in the Chomsky Hierarchy

The work in [BGZ04] shows that CCS! is Turing powerful by encoding RandomAccess Machines (RAM) in CCS!. The encoding is said to be non-deterministic,or non-faithful because it may introduce non-terminating computations whichdo not correspond to the expected behaviour of the modeled machine. Further-more, the authors in [BGZ04] also show the non-existence of deterministic (orfaithful) encodings of Turing Machines–i.e., encodings which do not exhibit suchadditional non-terminating computations.

In [ADNV07] the authors study the expressiveness of CCS! w.r.t. the existenceof faithful encodings of models of computability strictly less expressive thanTuring Machines. Namely, (non-deterministic) Linear-bounded, Pushdown andFinite-State Automata.

In this section we shall single out the fundamental non-deterministic elementfor the Turing-expressiveness of CCS! shown in [BGZ04]. Following [ADNV07]we define a class CCS%#

! of those processes which do not exhibit such kind ofnon-determinism and discuss their expressiveness w.r.t the Chomsky Hierarchy.First we need a little notation.

Notation 7. Define s=/, with s = α1. . . .αn & L$, as

( "!")$ !1!" ( "!")$ . . . ( "!")$ !n!" ( "!")$.

For the empty sequence s = ε, s=/ is defined as ( "!")$.

We say that a process generates a sequence of non-silent actions s if it can per-forms the actions of s in a finite maximal sequence of transitions. More precisely:

Definition 7 (Sequence and language generation). The process P gener-ates a sequence s & L$ if and only if there exists Q such that P

s=/ Q and Q % !!"for any α & Act . Define the language of (or generated by) a process P , L(P ), asthe set of all sequences P generates.

Page 15: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 199

Strong non-termination plays a fundamental role in the expressiveness of CCS!.We borrow the following terminology from rewriting systems:

Definition 8 (Termination). We say that a process P is (weakly) terminating(or that it can terminate) if and only if there exists a sequence s such that Pgenerates s. We say that P is (strongly) non-terminating, or that it cannotterminate if and only if P cannot generate any sequence.

As previously mentioned, [BGZ04] provides an encoding [[·]] from Random Ac-cess Machines (RAM) into CCS!. The encoding is called non-deterministic in thesense that given a machine M , [[M ]] may evolve into states (processes) which donot correspond to any configuration of M . Nevertheless such states are guaran-teed to be strongly non-terminating. Therefore, they may be thought of as beingconfigurations which cannot lead to a halting configuration in a non-deterministicTuring machine M " that computes the same function as M .

Now rather than recalling the full encoding of RAMs from [BGZ04], let ususe a simpler example which illustrates the same non-deterministic technique.Below we encode a typical context sensitive language in CCS!.

Example 2. Consider the following processes:

P = (νk1, k2, k3, ub, uc)( k1 | k2 | Qa | Qb | Qc)Qa = !k1.a.(k1 | k3 | ub | uc)Qb = k1.!k3.k2.ub.b.k2

Qc = k2.(!uc.c | ub.DIV )

where DIV is the non-terminating process (νw)(w | !w.w). It can be verifiedthat L(P ) = {anbncn}.

Intuitively, in the process P above, Qa performs (a sequence of actions) an foran arbitrary number n (and also produces n ub’s). Then Qb performs bm for anarbitrary number m 0 n and each time it produces b it consumes a ub. Finally,Qc performs cn and diverges if m < n by checking if there are ub’s that were notconsumed. -.

The Power of Non-Termination. Let us underline the role of strong non-termination in Example 2. Consider a run

Panbm

=/ . . .

Observe that the name ub is used in Qc to test if m < n, by checking whethersome ub were left after generating bm. If m < n, the non-terminating processDIV is triggered and the extended run takes the form

Panbmcn

=/ "!" "!" . . .

Hence the sequence anbmcn arising from this run (with m < n) is therefore notincluded in L(P ).

Page 16: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

200 J. Aranda et al.

The tau move. It is crucial to observe that there is a τ transition arising fromthe moment in which k2 chooses to synchronize with Qc to start performing thec actions. One can verify that if m < n then the process just before that τ tran-sition is weakly terminating while the one just after is strongly non-terminating.

The non-deterministic technique of using non-terminating processes in com-puting illustrated above is essentially the same given in [BGZ04] for encodingRAM’s. Since we want to prevent the use of the above technique, we define a classwhich avoids moving with a τ transition from a terminating to a non-terminatingevolution.

Definition 9 (Weak Termination Preservation and CCS%#! ). A process

P is said to be (weakly) termination-preserving (after τ moves) if and only ifwhenever P

s=/ Q"!" R: if Q is weakly terminating then R is weakly terminat-

ing. Henceforth we use CCS%#! to denote the set of those CCS! processes which

are termination-preserving.

Let us now survey the expressiveness result w.r.t formal language generation (seeDefinition 7) of the above termination-preserving class of processes CCS%#

! .

Language expressiveness of CCS%#! . We assume that the reader is famil-

iar with the notions and notations of formal grammars. A grammar G can bespecified as a quad-tuple (Σ, N, S, P ) where Σ is the set of terminal symbols,N is the set of non-terminals symbols, S the initial symbol and P the set ofproduction rules. The language of (or generated by) a formal grammar G, de-noted as L(G), is defined as all those strings in Σ$ that can be generated bystarting with the start symbol S and then applying the production rules in Puntil no more non-terminal symbols are present. We recall also that in a strictlydecreasing expressive order, Types 0, 1, 2 and 3 in the Chomsky hierarchy corre-spond, respectively, to unrestricted-grammars (Turing Machines), Context Sen-sitive Grammars (Non-Deterministic Linear Bounded Automata), Context FreeGrammars (Non-Deterministic PushDown Automata), and Regular Grammars(Finite State Automata).

The following theorem illustrated in Figure 2 classifies the expressiveness ofCCS%#

! in the Chomsky Hierarchy.

Theorem 8. The following holds for the CCS%#! variant:

1. For every Type 3 Grammar G we can construct a CCS%#! process PG such

that L(G) = L(PG).2. There exists a Type 2 Grammar G such that for every CCS%#

! process PG

L(G) %= L(PG).3. For every CCS%#

! process PG there exists a Type 1 Grammar G such thatL(PG) = L(G).

Let us conclude this section by giving more details on the above classificationresults. The first point of Theorem 8 follows from a rather straightforward trans-lation from regular expressions.

Page 17: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 201

CSLCCS!!

!

REGCFL

Fig. 2. CCS#ω! in the Chomsky Hierarchy

The second one is based on a fundamental property of CCS%#! : If P & CCS%#

!can perform an action c after zero or more steps then it can always perform itafter a number of steps which depends on the size of P . With the help of thisproperty one can prove that the Type 2 language anbnc cannot be encoded inCCS%#

! .The last point follows from a CCS%#

! property on the number of τ movesneeded to generate any given sequence of size n: It is linearly bounded. Moreprecisely, for every P & CCS%#

! , there exists a constant k such that if s =α1 . . .αn & L(P ) then there must be a sequence

P ( "!")m0 !1!" ( "!")m1 . . . ( "!")mn!1 !n!" ( "!")mn !

with Σni=0mi 0 kn. Using the above property, given P , one can define a non-

deterministic machine that simulates the runs of P using as many cells as thetotal number of performed actions, silent or visible, multiplied by a constantassociated to P . Hence L(P ) is by definition a Type 1 language.

4 The Mobile Ambients Calculus

The calculus of Mobile Ambients is a formalism for the description of distributedand mobile systems in terms of ambients ; i.e. a named collection of active proc-esses and nested sub-ambients.

The work in [BZ04] studies the expressiveness of recursion versus replication inMobile Ambients. In particular, the authors of [BZ04] study the expressive powerof ambient mobility in the (Pure) Mobile Ambients variants with replication andrecursion.

4.1 Finite Processes of Ambients

The Pure Ambient Calculus focuses on ambient and processes interaction. Unlikethe π-calculus, it abstracts away from process communication.

Page 18: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

202 J. Aranda et al.

The syntax of the finite processes can be derived from those of the pπ-calculusby (1) introducing ambients, and the actions for ambient and processes inter-action, (2) eliminating the action for process communication and (3) restrictingsummations to have arity at most one. In summary, we obtain the followingsyntax:

P, Q, . . . := 0 | α.P | n[P ] | (νx)P | P | Q (14)

α := in x | out x | open x

The intuitive behaviour of the ambient n[P ] and α actions is better explainedafter presenting the reduction semantics of Ambients. The intuitive behaviourof the others constructs can be described exactly as in the π-calculus.

Reduction Semantics of Finite Processes. The reduction relation !" forAmbients can be obtained by adding the axiom (νn)(m[P ]) $ m[(νn)P ] if m %= nto the structural congruence in Definition 1 and the following rules for ambientsand process interaction to the rules of the pπ-calculus in Table 1 (without theREACT rule):

1. n[in m.P | Q] | m[R] !" m[n[P | Q] | R]2. m[n[out m.P | Q]|R] !" n[P | Q] | m[R]3. open n.P | n[Q] !" P | Q

4.P !" Q

n[P ] !" n[Q]

Rules (1-3) describe ambients and their actions and Rule (4) simply says thatreduction can occur underneath ambients. Rule (1) describes how, by using thein action, an ambient named n can enter another ambient named m. Similarly,Rule (2) describes how an ambient named n can exit another ambient named mby using the out action. Finally Rule (3) describes how a process can dissolvean ambient boundary to access its contents by performing the open action overthe name n of the ambient.

4.2 Infinite Process of Ambients

Infinite behaviour in Ambients can be represented by using replication as in pπ!or recursive expressions of the form µX.P .

The MA! Calculus

The calculus MA! extends the syntax of the finite Ambients processes with !P . Itsreduction semantics !" is obtained by adding the structural axiom !P $ P | !Pto the structural axioms of finite Ambients processes.

The MAr Calculus

The calculus MAr extends the syntax of the finite Ambients processes withrecursive expression of the form µX.P exactly as in CCSµ (Section 3.2). Its

Page 19: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 203

reduction semantics !" is obtained by adding the structural axiom µX.P $P [µX.P/X ] to the structural axioms of finite Ambients processes.

Notice that the issue of the substitution [µX.P/X ] applied to P we discussedin Section 3.2 arises again: Whether the substitution also requires the renamingof bound names in P to avoid captures (i.e., name α-conversion). Such a require-ment seems necessary should we want to identify process up-to α-equivalence–which is included in the structural congruence $ for Ambients. The CCS exam-ples in Section 3.2 (see Remark 1) can easily be adapted here to illustrate thatwe obtain dynamic scoping of names if we do not perform the α-conversion inthe substitution.

It should be noticed that the above has not been completely clarified in theliterature of Ambients. In fact, it raises a technical issue in the results on ex-pressiveness which we shall recall in the next section.

Expressiveness Results

To isolate the expressiveness of restriction and ambient actions in MA! andMAr, [BZ04] considers the following fragments of MAc with c & {!, r}: (1) MA%$

c ,the MAc calculus without the restriction constructor (νx)P , (2) MA%mv

c , theMAc calculus without the in and out actions, and finally (3) MA%mv,$

c , thecorresponding calculus with no in/out action nor restriction.

The separation results in [BZ04] among the various calculi are given in termsof the decidability of termination; i.e., the problem of whether given a processP does not have any infinite sequence of reductions. Obviously, if the questionis decidable in a given calculus then we know that there is no termination-preserving encoding of Turing Machines into the calculus. The results in [BZ04]are summarized in Figure 3.

Fig. 3. Hierarchy of Ambient Calculi

Remark 2. The undecidability of process termination for MA%mvr is obtained by

a reduction from termination of RAM machines, a Turing Equivalent formalism.

Page 20: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

204 J. Aranda et al.

First [BZ04] uses a CCS fragment with recursion and dynamic scope of namesto provide a termination-preserving encoding of RAMs. Then the CCS frag-ment is claimed to be a sub-calculus of MA%mv

r . The undecidability of processtermination for MA%mv

r follows immediately.Nevertheless, as illustrated in Section 3.2 Remark 1 such dynamic scope causes

α-equivalence not to be preserved. In principle, this may cause a technical prob-lem in the proof of the result since MA%mv

r requires α-equivalence to be pre-served; i.e., the CCS fragment used to simulate RAMs is not a sub-calculus ofMA%mv

r .One way to deal with the above problem is to use a more involved notion of

α-conversion in MA%mvr [BZ05]. Another way would be to consider parametric

recursion in MAr, as in CCSp or pπD, and then use CCSp as the sub-calculusof MA%mv

r to encode RAMs. Nevertheless, either way we will be changing theoriginal semantics of MA%mv

r given in [LS03] which treats α-conversion andrecursion as in CCSµ [San05].

5 Recursion vs. Replication in Other Calculi

Here, we shall briefly survey work studying the relative expressive power ofRecursion vs Replication in other process calculi.

In the context of calculi for security protocols, the work in [HS05] uses aprocess calculus to analyze the class of ping-pong protocols introduced by Dolevand Yao. The authors show that all nontrivial properties, in particular reach-ability, become undecidable for a very simple recursive variant of the calculus.The recursive variant is capable of an implicit description of the active intruder,including full analysis and synthesis of messages. The authors then show thatthe variant with replication renders reachability decidable.

In the context of calculi for Timed Reactive System, the work in [NPV02]studies the expressive power of some variants of Timed concurrent constraintprogramming (tcc). The tcc model is a process calculus introduced in [SJG94]aimed at specifying timed systems, following the paradigms of Synchronous Lan-guages [BG92]. The work states that: (1) recursive procedures with parameterscan be encoded into parameterless recursive procedures with dynamic scoping,and vice-versa. (2) replication can be encoded into parameterless recursive proce-dures with static scoping, and vice-versa. (3) the languages from (1) are strictlymore expressive than the languages from (2). Furthermore, it states that behav-ioral equivalence is undecidable for the languages from (1), but decidable for thelanguages from (2). The undecidability result holds even if the process variablestake values from a fixed finite domain.

The reader may have noticed the strong resemblance of the work on tcc andthat of CCS described in the previous section; e.g., static-dynamic scoping issuew.r.t recursion. In fact, [NPV02] had a great influence in the work we described inthis paper for CCS. In particular, in the discovery of the dynamic name scopingexhibited by the CCS presentation in [Mil89].

Page 21: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

On Recursion, Replication and Scope Mechanisms in Process Calculi 205

6 Final Remarks

The expressiveness di!erences between recursion and replication we have sur-veyed in this paper may look surprising to those acquainted with the π-calculuswhere recursion is a derived operation. Our interpretation of this di!erence isthat the link mobility of the π-calculus is a powerful mechanism which makesup for the weakness of replication.

The expressiveness of the replication !P arises from unbounded parallel be-haviour, which with recursion can be defined as µX.(P | X). The additionalexpressive power of recursion arises from the unbounded nested scope of µX.P asin R = µX.(νx)(P | X) which behaves as (νx)(P | (νx)(P | (νx)(P | · · · ))).This, in general, cannot be simulated with replication. However, suppose thatthe unfolding of recursion applies α-conversion to avoid captures as we saw inSection 3.2. For example for the process R above we will have the unfolding(νx1)(P [x1/x] | (νx2)(P [x2/x] | (νx3) · · · ))) and each xi will only occur inP [xi/x]. It is easy to see the replication !(νx)P captures the behaviour of R.Therefore, R does not really exhibit (significant) unbounded nesting of scope.

All in all, the ability of expressing recursive behaviours via replication in agiven process calculus may depend on the mechanisms of the calculus to compen-sate for the restriction of replication as well as on how meaningful the unboundednesting of the recursive expressions are.

References

[ADNV07] Aranda, J., Di Giusto, C., Nielsen, M., Valencia, F.: On the Expressive-ness of CCS with Replication. Technical Report, LIX Ecole Polytechnique(2007), URL www.cs.unibo.it/~digiusto/research/ccsrep.pdf

[BG92] Berry, G., Gonthier, G.: The Esterel synchronous programming lan-guage: design, semantics, implementation. Science of Computer Program-ming 19(2), 87–152 (1992)

[BCMS01] Burkart, O., Caucal, D., Moller, F., Ste!en, B.: Verification on infinitestructures. In: Handbook of process algebra, vol. 9, pp. 545–623. Elsevier,North-Holland (2001)

[BGZ03] Busi, N., Gabbrielli, M., Zavattaro, G.: Replication vs. recursive defini-tions in channel based calculi. In: Baeten, J.C.M., Lenstra, J.K., Parrow,J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, Springer, Hei-delberg (2003)

[BGZ04] Busi, N., Gabbrielli, M., Zavattaro, G.: Comparing recursion, replication,and iteration in process calculi. In: Díaz, J., Karhumäki, J., Lepistö, A.,Sannella, D. (eds.) ICALP 2004. LNCS, vol. 3142, Springer, Heidelberg(2004)

[BZ04] Busi, N., Zavattaro, G.: On the expressive power of movement and re-striction in pure mobile ambients. Theoretical Computer Science 322(3),477–515 (2004)

[BZ05] Busi, N., Zavattaro, G.: Personal Communication (May 2005)[CG98] Cardelli, L., Gordon, A.: Mobile Ambients. In: Nivat, M. (ed.) ETAPS

1998 and FOSSACS 1998. LNCS, vol. 1378, pp. 140–155. Springer, Hei-delberg (1998)

Page 22: O n R ecu rsio n , R ep lica tio n a n d S co p e M ech …fvalenci/papers/fmco07.pdfO n R ecu rsio n , R ep lica tio n a n d S co p e M ech a n ism s in P ro cess C a lcu li Jes s

206 J. Aranda et al.

[EN86] Engberg, U., Nielsen, M.: A calculus of communicating systems withlabel-passing. Technical report, University of Aarhus (1986)

[Gir87] Girard, J.-Y.: Linear logic. Theor. Comput. Sci. 50, 1–102 (1987)[GSV04] Giambiagi, P., Schneider, G., Valencia, F.: On the expressiveness of in-

finite behavior and name scoping in process calculi. In: Walukiewicz, I.(ed.) FOSSACS 2004. LNCS, vol. 2987, pp. 226–240. Springer, Heidel-berg (2004)

[Gre78] Greibach, S.A.: Remarks on Blind and Partially Blind One-Way Multi-counter Machines. Theor. Comput. Sci. 7, 311–324 (1978)

[HS05] Huttel, H., Srba, J.: Recursion vs. replication in simple cryptographicprotocols. In: Vojtá", P., Bieliková, M., Charron-Bost, B., S#kora, O.(eds.) SOFSEM 2005. LNCS, vol. 3381, pp. 175–184. Springer, Heidelberg(2005)

[LS03] Levi, F., Sangiorgi, D.: Mobile safe ambients. ACM Transactions on Pro-gramming Languages and Systems 25(1), 1–69 (2003)

[Mil89] Milner, R.: Communication and Concurrency. International Series inComputer Science. Prentice Hall, Englewood Cli!s (1989) (SU FisherResearch 511/24)

[Mil93] Milner, R.: The polyadic !-calculus: A tutorial. In: Bauer, F.L, Brauer,W., Schwichtenberg, H. (eds.) Logic and Algebra of Specification, pp.203–246. Springer, Berlin (1993)

[Mil99] Milner, R.: Communicating and Mobile Systems: the !-calculus. Cam-bridge University Press, Cambridge (1999)

[MP03] Ma!eis, S., Phillips, I.: On the computational strength of pure ambientcalculi. In: EXPRESS’03 (2003)

[MPW92] Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, PartI + II. Information and Computation 100(1), 1–77 (1992)

[NPV02] Nielsen, M., Palamidessi, C., Valencia, F.: On the expressive power ofconcurrent constraint programming languages. In: Proc. of the 4th In-ternational Conference on Principles and Practice of Declarative Pro-gramming (PPDP 2002), pp. 156–167. ACM Press, New York (2002)

[Pal97] Palamidessi, C.: Comparing the expressive power of the synchronous andthe asynchronous pi-calculus. In: POPL’97, pp. 256–265. ACM Press,New York (1997)

[PV05] Palamidessi, C., Valencia, F.: Recursion vs Replication in Process Calculi.In: Bulletin of the EATCS vol. 87, pp. 105–125 (2005)

[Pet81] Peterson, J.L.: Petri Net Theory and the Modeling of Systems. PrenticeHall PTR, Englewood Cli!s (1981)

[SJG94] Saraswat, V., Jagadeesan, R., Gupta, V.: Foundations of timed concur-rent constraint programming. In: Proc. of the Ninth Annual IEEE Sym-posium on Logic in Computer Science, July 4-7, 1994, pp. 71–80. IEEEComputer Society Press, Los Alamitos (1994)

[SW01] Sangiorgi, D., Walker, D.: The !!calculus: A Theory of Mobile Processes.Cambridge University Press, Cambridge (2001)

[San05] Sangiorgi, D.: Personal Communication (May 2005)


Recommended