HOME

TheInfoList



OR:

In
theoretical computer science computer science (TCS) is a subset of general computer science and mathematics that focuses on mathematical aspects of computer science such as the theory of computation, lambda calculus, and type theory. It is difficult to circumscribe the ...
, the -calculus (or pi-calculus) is a process calculus. The -calculus allows channel names to be communicated along the channels themselves, and in this way it is able to describe concurrent computations whose network configuration may change during the computation. The -calculus has few terms and is a small, yet expressive language (see ). Functional programs can be encoded into the -calculus, and the encoding emphasises the dialogue nature of computation, drawing connections with
game semantics Game semantics (german: dialogische Logik, translated as '' dialogical logic'') is an approach to formal semantics that grounds the concepts of truth or validity on game-theoretic concepts, such as the existence of a winning strategy for a play ...
. Extensions of the -calculus, such as the spi calculus and applied , have been successful in reasoning about
cryptographic protocol A security protocol (cryptographic protocol or encryption protocol) is an abstract or concrete protocol that performs a security-related function and applies cryptographic methods, often as sequences of cryptographic primitives. A protocol descri ...
s. Beside the original use in describing concurrent systems, the -calculus has also been used to reason about
business process A business process, business method or business function is a collection of related, structured activities or tasks by people or equipment in which a specific sequence produces a service or product (serves a particular business goal) for a parti ...
esOMG Specification (2011)
"Business Process Model and Notation (BPMN) Version 2.0"
'' Object Management Group''. p.21
and
molecular biology Molecular biology is the branch of biology that seeks to understand the molecular basis of biological activity in and between cells, including biomolecular synthesis, modification, mechanisms, and interactions. The study of chemical and phys ...
.


Informal definition

The -calculus belongs to the family of process calculi, mathematical formalisms for describing and analyzing properties of concurrent computation. In fact, the -calculus, like the λ-calculus, is so minimal that it does not contain primitives such as numbers, booleans, data structures, variables, functions, or even the usual control flow statements (such as if-then-else, while).


Process constructs

Central to the -calculus is the notion of ''name''. The simplicity of the calculus lies in the dual role that names play as ''communication channels'' and ''variables''. The process constructs available in the calculus are the following (a precise definition is given in the following section): * ''concurrency'', written P \mid Q, where P and Q are two processes or threads executed concurrently. * ''communication'', where ** ''input prefixing'' c\left(x\right).P is a process waiting for a message that was sent on a communication channel named c before proceeding as binding the name received to the name Typically, this models either a process expecting a communication from the network or a label c usable only once by a goto c operation. ** ''output prefixing'' \overline \langle y \rangle.P describes that the name y is emitted on channel c before proceeding as Typically, this models either sending a message on the network or a goto c operation. * ''replication'', written !\,P, which may be seen as a process which can always create a new copy of Typically, this models either a network service or a label c waiting for any number of goto c operations. * ''creation of a new name'', written \left(\nu x\right)P, which may be seen as a process allocating a new constant within The constants of are defined by their names only and are always communication channels. Creation of a new name in a process is also called ''restriction''. * the nil process, written 0, is a process whose execution is complete and has stopped. Although the minimalism of the -calculus prevents us from writing programs in the normal sense, it is easy to extend the calculus. In particular, it is easy to define both control structures such as recursion, loops and sequential composition and datatypes such as first-order functions,
truth value In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth, which in classical logic has only two possible values ('' true'' or '' false''). Computing In some pro ...
s, lists and integers. Moreover, extensions of the have been proposed which take into account distribution or public-key cryptography. The ''applied '' due to Abadi and Fourne

put these various extensions on a formal footing by extending the with arbitrary datatypes.


A small example

Below is a tiny example of a process which consists of three parallel components. The channel name is only known by the first two components. : \begin (\nu x) & \; ( \; \overline \langle z \rangle . \; 0 \\ & \; , \; x(y) . \; \overline\langle x \rangle . \; x(y) . \; 0 \; ) \\ & \; , \; z(v) . \; \overline\langle v \rangle . 0 \end The first two components are able to communicate on the channel , and the name becomes bound to . The next step in the process is therefore : \begin (\nu x) & \; ( \; 0 \\ & \; , \; \overline \langle x \rangle . \; x(y). \; 0 \; ) \\ & \; , \; z(v). \; \overline\langle v \rangle . \; 0 \end Note that the remaining is not affected because it is defined in an inner scope. The second and third parallel components can now communicate on the channel name , and the name becomes bound to . The next step in the process is now : \begin (\nu x) & \; ( \; 0 \\ & \; , \; x(y). \; 0 \\ & \; , \; \overline\langle x \rangle . \; 0 \; ) \end Note that since the local name has been output, the scope of is extended to cover the third component as well. Finally, the channel can be used for sending the name . After that all concurrently executing processes have stopped : \begin (\nu x) & \; ( \; 0 \\ & \; , \; 0 \\ & \; , \; 0 \; ) \end


Formal definition


Syntax

Let Χ be a set of objects called ''names''. The abstract syntax for the -calculus is built from the following BNF grammar (where ''x'' and ''y'' are any names from Χ): : \begin P, Q ::= & \; x(y).P \,\,\, \, \, & \textx\texty\textP \\ & \; , \; \overline \langle y \rangle.P \,\,\, \, \, &\texty\textx\textP \\ & \; , \; P, Q \,\,\, \, \, \, \, \, \, &\textP\textQ\text \\ & \; , \; (\nu x)P \,\,\, &\textx\textP \\ & \; , \; !P \,\,\, &\textP \\ & \; , \; 0 & \text \end In the concrete syntax below, the prefixes bind more tightly than the parallel composition (, ), and parentheses are used to disambiguate. Names are bound by the restriction and input prefix constructs. Formally, the set of free names of a process in –calculus are defined inductively by the table below. The set of bound names of a process are defined as the names of a process that are not in the set of free names.


Structural congruence

Central to both the reduction semantics and the labelled transition semantics is the notion of structural congruence. Two processes are structurally congruent, if they are identical up to structure. In particular, parallel composition is commutative and associative. More precisely, structural congruence is defined as the least equivalence relation preserved by the process constructs and satisfying: ''Alpha-conversion'': :* P \equiv Q if Q can be obtained from P by renaming one or more bound names in P. ''Axioms for parallel composition'': :* P, Q \equiv Q, P :* (P, Q), R \equiv P, (Q, R) :*P , 0 \equiv P ''Axioms for restriction'': :* (\nu x)(\nu y)P \equiv (\nu y)(\nu x)P :* (\nu x)0 \equiv 0 ''Axiom for replication'': :* !P \equiv P, !P ''Axiom relating restriction and parallel'': :* (\nu x)(P , Q) \equiv (\nu x)P , Q if is not a free name of Q. This last axiom is known as the "scope extension" axiom. This axiom is central, since it describes how a bound name may be extruded by an output action, causing the scope of to be extended. In cases where is a free name of Q, alpha-conversion may be used to allow extension to proceed.


Reduction semantics

We write P \rightarrow P' if P can perform a computation step, following which it is now P'. This ''reduction relation'' \rightarrow is defined as the least relation closed under a set of reduction rules. The main reduction rule which captures the ability of processes to communicate through channels is the following: * \overline\langle z \rangle.P , x(y).Q \rightarrow P , Q /y : where Q /y/math> denotes the process Q in which the free name z has been ''substituted'' for the free occurrences of y. If a free occurrence of y occurs in a location where z would not be free, alpha-conversion may be required. There are three additional rules: * If P \rightarrow Q then also P, R \rightarrow Q, R. : This rule says that parallel composition does not inhibit computation. * If P \rightarrow Q, then also (\nu x)P \rightarrow (\nu x)Q. : This rule ensures that computation can proceed underneath a restriction. * If P \equiv P' and P' \rightarrow Q' and Q' \equiv Q, then also P \rightarrow Q. The latter rule states that processes that are structurally congruent have the same reductions.


The example revisited

Consider again the process : (\nu x)(\overline \langle z \rangle.0 , x(y). \overline\langle x \rangle . x(y).0 ) , z(v) . \overline\langle v \rangle. 0 Applying the definition of the reduction semantics, we get the reduction : (\nu x)(\overline \langle z \rangle.0 , x(y). \overline\langle x \rangle . x(y).0 ) , z(v) . \overline\langle v \rangle. 0 \rightarrow (\nu x)(0, \overline\langle x \rangle . x(y). 0 ) , z(v). \overline\langle v \rangle .0 Note how, applying the reduction substitution axiom, free occurrences of y are now labeled as z. Next, we get the reduction : (\nu x)(0, \overline\langle x \rangle . x(y). 0 ) , z(v). \overline\langle v \rangle .0 \rightarrow (\nu x)(0, x(y). 0 , \overline\langle x \rangle .0) Note that since the local name has been output, the scope of is extended to cover the third component as well. This was captured using the scope extension axiom. Next, using the reduction substitution axiom, we get : (\nu x)(0 , 0 , 0) Finally, using the axioms for parallel composition and restriction, we get : 0


Labelled semantics

Alternatively, one may give the pi-calculus a labelled transition semantics (as has been done with the Calculus of Communicating Systems).
In this semantics, a transition from a state P to some other state P' after an action \alpha is notated as: *P\,\xrightarrow P' Where states P and P' represent processes and \alpha is either an ''input action'' a(x), an ''output action'' ''\overline\langle x \rangle'', or a ''silent action'' . A standard result about the labelled semantics is that it agrees with the reduction semantics up to structural congruence, in the sense that P \rightarrow P' if and only if P\,\xrightarrow\equiv P'


Extensions and variants

The syntax given above is a minimal one. However, the syntax may be modified in various ways. A ''nondeterministic choice operator'' P + Q can be added to the syntax. A test for ''name equality'' =y can be added to the syntax. This ''match operator'' can proceed as P if and only if and y are the same name. Similarly, one may add a ''mismatch operator'' for name inequality. Practical programs which can pass names (URLs or pointers) often use such functionality: for directly modeling such functionality inside the calculus, this and related extensions are often useful. The ''asynchronous -calculus'' allows only outputs with no suffix, i.e. output atoms of the form \overline\langle y \rangle, yielding a smaller calculus. However, any process in the original calculus can be represented by the smaller asynchronous -calculus using an extra channel to simulate explicit acknowledgement from the receiving process. Since a continuation-free output can model a message-in-transit, this fragment shows that the original -calculus, which is intuitively based on synchronous communication, has an expressive asynchronous communication model inside its syntax. However, the nondeterministic choice operator defined above cannot be expressed in this way, as an unguarded choice would be converted into a guarded one; this fact has been used to demonstrate that the asynchronous calculus is strictly less expressive than the synchronous one (with the choice operator). The ''polyadic -calculus'' allows communicating more than one name in a single action: \overline\langle z_1,...,z_n\rangle.P ''(polyadic output)'' and x(z_1,...,z_n).P ''(polyadic input)''. This polyadic extension, which is useful especially when studying types for name passing processes, can be encoded in the monadic calculus by passing the name of a private channel through which the multiple arguments are then passed in sequence. The encoding is defined recursively by the clauses \overline\langle y_1,\cdots,y_n\rangle.P is encoded as (\nu w) \overline\langle w \rangle.\overline\langle y_1\rangle.\cdots.\overline\langle y_n\rangle. /math> x(y_1,\cdots,y_n).P is encoded as x(w).w(y_1).\cdots.w(y_n). /math> All other process constructs are left unchanged by the encoding. In the above, /math> denotes the encoding of all prefixes in the continuation P in the same way. The full power of replication !P is not needed. Often, one only considers ''replicated input'' ! x(y).P, whose structural congruence axiom is ! x(y).P \equiv x(y).P , !x(y).P. Replicated input process such as !x(y).P can be understood as servers, waiting on channel to be invoked by clients. Invocation of a server spawns a new copy of the process P /y/math>, where a is the name passed by the client to the server, during the latter's invocation. A ''higher order -calculus'' can be defined where not only names but processes are sent through channels. The key reduction rule for the higher order case is \overline\langle R \rangle.P , x(Y).Q \rightarrow P , Q /Y Here, Y denotes a ''process variable'' which can be instantiated by a process term. Sangiorgi established that the ability to pass processes does not increase the expressivity of the -calculus: passing a process ''P'' can be simulated by just passing a name that points to ''P'' instead.


Properties


Turing completeness

The -calculus is a universal model of computation. This was first observed by Milner in his paper "Functions as Processes", in which he presents two encodings of the
lambda-calculus Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation ...
in the -calculus. One encoding simulates the eager (call-by-value) evaluation strategy, the other encoding simulates the normal-order (call-by-name) strategy. In both of these, the crucial insight is the modeling of environment bindings – for instance, " is bound to term M" – as replicating agents that respond to requests for their bindings by sending back a connection to the term M. The features of the -calculus that make these encodings possible are name-passing and replication (or, equivalently, recursively defined agents). In the absence of replication/recursion, the -calculus ceases to be Turing-complete. This can be seen by the fact that
bisimulation In theoretical computer science a bisimulation is a binary relation between state transition systems, associating systems that behave in the same way in that one system simulates the other and vice versa. Intuitively two systems are bisimilar if ...
equivalence becomes decidable for the recursion-free calculus and even for the finite-control -calculus where the number of parallel components in any process is bounded by a constant.


Bisimulations in the -calculus

As for process calculi, the -calculus allows for a definition of bisimulation equivalence. In the -calculus, the definition of bisimulation equivalence (also known as bisimilarity) may be based on either the reduction semantics or on the labelled transition semantics. There are (at least) three different ways of defining ''labelled bisimulation equivalence'' in the -calculus: Early, late and open bisimilarity. This stems from the fact that the -calculus is a value-passing process calculus. In the remainder of this section, we let p and q denote processes and R denote binary relations over processes.


Early and late bisimilarity

Early and late bisimilarity were both formulated by Milner, Parrow and Walker in their original paper on the -calculus. A binary relation R over processes is an ''early bisimulation'' if for every pair of processes (p, q) \in R, * whenever p \,\xrightarrow\,p' then for every name y there exists some q' such that q \,\xrightarrow\,q' and (p' /xq' /x \in R; * for any non-input action \alpha, if then there exists some q' such that q \xrightarrow q' and (p',q') \in R; * and symmetric requirements with p and q interchanged. Processes p and q are said to be early bisimilar, written p \sim_e q if the pair (p,q) \in R for some early bisimulation R. In late bisimilarity, the transition match must be independent of the name being transmitted. A binary relation R over processes is a ''late bisimulation'' if for every pair of processes (p, q) \in R, * whenever p \xrightarrow p' then for some q' it holds that q \xrightarrow q' and (p' /xq' /x \in R ''for every name y''; *for any non-input action \alpha, if p \xrightarrow p' implies that there exists some q' such that q \xrightarrow q' and (p',q') \in R; * and symmetric requirements with p and q interchanged. Processes p and q are said to be late bisimilar, written p \sim_l q if the pair (p,q) \in R for some late bisimulation R. Both \sim_e and \sim_l suffer from the problem that they are not ''congruence relations'' in the sense that they are not preserved by all process constructs. More precisely, there exist processes p and q such that p \sim_e q but a(x).p \not \sim_e a(x).q. One may remedy this problem by considering the maximal congruence relations included in \sim_e and \sim_l, known as ''early congruence'' and ''late congruence'', respectively.


Open bisimilarity

Fortunately, a third definition is possible, which avoids this problem, namely that of ''open bisimilarity'', due to Sangiorgi. A binary relation R over processes is an ''open bisimulation'' if for every pair of elements (p, q) \in R and for every name substitution \sigma and every action \alpha, whenever p\sigma \xrightarrow p' then there exists some q' such that q\sigma \xrightarrow q' and (p',q') \in R. Processes p and q are said to be open bisimilar, written p \sim_o q if the pair (p,q) \in R for some open bisimulation R.


Early, late and open bisimilarity are distinct

Early, late and open bisimilarity are distinct. The containments are proper, so \sim_o \subsetneq \sim_l \subsetneq \sim_e. In certain subcalculi such as the asynchronous pi-calculus, late, early and open bisimilarity are known to coincide. However, in this setting a more appropriate notion is that of ''asynchronous bisimilarity''. In the literature, the term ''open bisimulation'' usually refers to a more sophisticated notion, where processes and relations are indexed by distinction relations; details are in Sangiorgi's paper cited above.


Barbed equivalence

Alternatively, one may define bisimulation equivalence directly from the reduction semantics. We write p \Downarrow a if process p immediately allows an input or an output on name a. A binary relation R over processes is a ''barbed bisimulation'' if it is a symmetric relation which satisfies that for every pair of elements (p, q) \in R we have that :(1) p \Downarrow a if and only if q \Downarrow a for every name a and :(2) for every reduction p \rightarrow p' there exists a reduction q \rightarrow q' such that (p',q') \in R. We say that p and q are ''barbed bisimilar'' if there exists a barbed bisimulation R where (p,q) \in R. Defining a context as a term with a hole [] we say that two processes P and Q are ''barbed congruent'', written P \sim_b Q\,\!, if for every context C[] we have that C /math> and C /math> are barbed bisimilar. It turns out that barbed congruence coincides with the congruence induced by early bisimilarity.


Applications

The -calculus has been used to describe many different kinds of concurrent systems. In fact, some of the most recent applications lie outside the realm of traditional computer science. In 1997, Martin Abadi and Andrew Gordon proposed an extension of the -calculus, the Spi-calculus, as a formal notation for describing and reasoning about cryptographic protocols. The spi-calculus extends the -calculus with primitives for encryption and decryption. In 2001, Martin Abadi and Cedric Fournet generalised the handling of cryptographic protocols to produce the applied calculus. There is now a large body of work devoted to variants of the applied calculus, including a number of experimental verification tools. One example is the tool
ProVerif ProVerif is a software tool for automated reasoning about the security properties found in cryptographic protocols. The tool has been developed by Bruno Blanchet. Support is provided for cryptographic primitives including: symmetric & asymmetric ...
br>
due to Bruno Blanchet, based on a translation of the applied -calculus into Blanchet's logic programming framework. Another example is Crypty

due to Andrew Gordon and Alan Jeffrey, which uses Woo and Lam's method of correspondence assertions as the basis for type systems that can check for authentication properties of cryptographic protocols. Around 2002, Howard Smith and Peter Fingar became interested that -calculus would become a description tool for modeling business processes. By July 2006, there is discussion in the community about how useful this would be. Most recently, the -calculus has formed the theoretical basis of Business Process Modeling Language (BPML), and of Microsoft's XLANG. The -calculus has also attracted interest in molecular biology. In 1999,
Aviv Regev Aviv Regev (born July 11, 1971) is a computational biologist and systems biologist and Executive Vice President and Head of Genentech Research and Early Development in Genentech/Roche. She is a core member (on leave) at the Broad Institute of MIT ...
and
Ehud Shapiro Ehud Shapiro ( he, אהוד שפירא; born 1955) is a multi-disciplinary scientist, artist, entrepreneur and Professor of Computer Science and Biology at the Weizmann Institute of Science. With international reputation, he made fundamental co ...
showed that one can describe a cellular signaling pathway (the so-called RTK/
MAPK A mitogen-activated protein kinase (MAPK or MAP kinase) is a type of protein kinase that is specific to the amino acids serine and threonine (i.e., a serine/threonine-specific protein kinase). MAPKs are involved in directing cellular responses to ...
cascade) and in particular the molecular "lego" which implements these tasks of communication in an extension of the -calculus. Following this seminal paper, other authors described the whole metabolic network of a minimal cell. In 2009, Anthony Nash and
Sara Kalvala Sara may refer to: Arts, media and entertainment Film and television * ''Sara'' (1992 film), 1992 Iranian film by Dariush Merhjui * ''Sara'' (1997 film), 1997 Polish film starring Bogusław Linda * ''Sara'' (2010 film), 2010 Sri Lankan Sinhal ...
proposed a -calculus framework to model the signal transduction that directs ''Dictyostelium discoideum'' aggregation.


History

The -calculus was originally developed by Robin Milner, Joachim Parrow and David Walker in 1992, based on ideas by Uffe Engberg and Mogens Nielsen. It can be seen as a continuation of Milner's work on the process calculus CCS ( Calculus of Communicating Systems). In his Turing lecture, Milner describes the development of the -calculus as an attempt to capture the uniformity of values and processes in actors.


Implementations

The following programming languages implement the -calculus or one of its variants: * Business Process Modeling Language (BPML) *
occam-π In computer science, occam-π (or occam-pi) is the name of a variant of the programming language occam developed by the Kent Retargetable occam Compiler (KRoC) team at the University of Kent. The name reflects the introduction of elements of π ...
* Pict *
JoCaml JoCaml is an experimental functional programming language derived from OCaml. It integrates the primitives of the join-calculus to enable flexible, type-checked concurrent and distributed programming. The current version of JoCaml is a re-imple ...
(based on the
Join-calculus The join-calculus is a process calculus developed at INRIA. The join-calculus was developed to provide a formal basis for the design of distributed programming languages, and therefore intentionally avoids communications constructs found in other ...
) * RhoLang


Notes


References

* * * {{DEFAULTSORT:Pi Calculus Process calculi Theoretical computer science