Process calculus explained

In computer science, the process calculi (or process algebras) are a diverse family of related approaches for formally modelling concurrent systems. Process calculi provide a tool for the high-level description of interactions, communications, and synchronizations between a collection of independent agents or processes. They also provide algebraic laws that allow process descriptions to be manipulated and analyzed, and permit formal reasoning about equivalences between processes (e.g., using bisimulation). Leading examples of process calculi include CSP, CCS, ACP, and LOTOS.[1] More recent additions to the family include the π-calculus, the ambient calculus, PEPA, the fusion calculus and the join-calculus.

Essential features

While the variety of existing process calculi is very large (including variants that incorporate stochastic behaviour, timing information, and specializations for studying molecular interactions), there are several features that all process calculi have in common:[2]

Mathematics of processes

To define a process calculus, one starts with a set of names (or channels) whose purpose is to provide means of communication. In many implementations, channels have rich internal structure to improve efficiency, but this is abstracted away in most theoretic models. In addition to names, one needs a means to form new processes from old ones. The basic operators, always present in some form or other, allow:[3]

Parallel composition

Parallel composition of two processes

P

and

Q

, usually written

P\vertQ

, is the key primitive distinguishing the process calculi from sequential models of computation. Parallel composition allows computation in

P

and

Q

to proceed simultaneously and independently. But it also allows interaction, that is synchronisation and flow of information from

P

to

Q

(or vice versa) on a channel shared by both. Crucially, an agent or process can be connected to more than one channel at a time.

Channels may be synchronous or asynchronous. In the case of a synchronous channel, the agent sending a message waits until another agent has received the message. Asynchronous channels do not require any such synchronization. In some process calculi (notably the π-calculus) channels themselves can be sent in messages through (other) channels, allowing the topology of process interconnections to change. Some process calculi also allow channels to be created during the execution of a computation.

Communication

Interaction can be (but isn't always) a directed flow of information. That is, input and output can be distinguished as dual interaction primitives. Process calculi that make such distinctions typically define an input operator (e.g.

x(v)

) and an output operator (e.g.

x\langley\rangle

), both of which name an interaction point (here

x

) that is used to synchronise with a dual interaction primitive.

Should information be exchanged, it will flow from the outputting to the inputting process. The output primitive will specify the data to be sent. In

x\langley\rangle

, this data is

y

. Similarly, if an input expects to receive data, one or more bound variables will act as place-holders to be substituted by data, when it arrives. In

x(v)

,

v

plays that role. The choice of the kind of data that can be exchanged in an interaction is one of the key features that distinguishes different process calculi.

Sequential composition

Sometimes interactions must be temporally ordered. For example, it might be desirable to specify algorithms such as: first receive some data on

x

and then send that data on

y

. Sequential composition can be used for such purposes. It is well known from other models of computation. In process calculi, the sequentialisation operator is usually integrated with input or output, or both. For example, the process

x(v)P

will wait for an input on

x

. Only when this input has occurred will the process

P

be activated, with the received data through

x

substituted for identifier

v

.

Reduction semantics

The key operational reduction rule, containing the computational essence of process calculi, can be given solely in terms of parallel composition, sequentialization, input, and output. The details of this reduction vary among the calculi, but the essence remains roughly the same. The reduction rule is:

x\langley\rangleP\vertx(v)Q\longrightarrowP\vert

y/
Q[
v]

The interpretation to this reduction rule is:

  1. The process

x\langley\rangleP

sends a message, here

y

, along the channel

x

. Dually, the process

x(v)Q

receives that message on channel

x

.
  1. Once the message has been sent,

x\langley\rangleP

becomes the process

P

, while

x(v)Q

becomes the process
y/
Q[
v]
, which is

Q

with the place-holder

v

substituted by

y

, the data received on

x

.The class of processes that

P

is allowed to range over as the continuation of the output operation substantially influences the properties of the calculus.

Hiding

Processes do not limit the number of connections that can be made at a given interaction point. But interaction points allow interference (i.e. interaction). For thesynthesis of compact, minimal and compositional systems, the ability to restrict interference is crucial. Hiding operations allow control of the connections made between interaction points when composingagents in parallel. Hiding can be denoted in a variety of ways. For example, in the π-calculus the hiding of a name

x

in

P

can be expressed as

(\nux)P

, while in CSP it might be written as

P\setminus\{x\}

.

Recursion and replication

The operations presented so far describe only finite interaction and are consequently insufficient for full computability, which includes non-terminating behaviour. Recursion and replication are operations that allow finite descriptions of infinite behaviour. Recursion is well known from the sequential world. Replication

!P

can be understood as abbreviating the parallel composition of a countably infinite number of

P

processes:

!P=P\mid!P

Null process

Process calculi generally also include a null process (variously denoted as

nil

,

0

,

STOP

,

\delta

, or some other appropriate symbol) which has no interaction points. It is utterly inactive and its sole purpose is to act as the inductive anchor on top of which more interesting processes can be generated.

Discrete and continuous process algebra

Process algebra has been studied for discrete time and continuous time (real time or dense time).[4]

History

In the first half of the 20th century, various formalisms were proposed to capture the informal concept of a computable function, with μ-recursive functions, Turing machines and the lambda calculus possibly being the best-known examples today. The surprising fact that they are essentially equivalent, in the sense that they are all encodable into each other, supports the Church-Turing thesis. Another shared feature is more rarely commented on: they all are most readily understood as models of sequential computation. The subsequent consolidation of computer science required a more subtle formulation of the notion of computation, in particular explicit representations of concurrency and communication. Models of concurrency such as the process calculi, Petri nets in 1962, and the actor model in 1973 emerged from this line of inquiry.

Research on process calculi began in earnest with Robin Milner's seminal work on the Calculus of Communicating Systems (CCS) during the period from 1973 to 1980. C.A.R. Hoare's Communicating Sequential Processes (CSP) first appeared in 1978, and was subsequently developed into a full-fledged process calculus during the early 1980s. There was much cross-fertilization of ideas between CCS and CSP as they developed. In 1982 Jan Bergstra and Jan Willem Klop began work on what came to be known as the Algebra of Communicating Processes (ACP), and introduced the term process algebra to describe their work.[1] CCS, CSP, and ACP constitute the three major branches of the process calculi family: the majority of the other process calculi can trace their roots to one of these three calculi.

Current research

Various process calculi have been studied and not all of them fit the paradigm sketched here. The most prominent example may be the ambient calculus. This is to be expected as process calculi are an active field of study. Currently research on process calculi focuses on the following problems.

Software implementations

The ideas behind process algebra have given rise to several tools including:

Relationship to other models of concurrency

The history monoid is the free object that is generically able to represent the histories of individual communicating processes. A process calculus is then a formal language imposed on a history monoid in a consistent fashion.[6] That is, a history monoid can only record a sequence of events, with synchronization, but does not specify the allowed state transitions. Thus, a process calculus is to a history monoid what a formal language is to a free monoid (a formal language is a subset of the set of all possible finite-length strings of an alphabet generated by the Kleene star).

The use of channels for communication is one of the features distinguishing the process calculi from other models of concurrency, such as Petri nets and the actor model (see Actor model and process calculi). One of the fundamental motivations for including channels in the process calculi was to enable certain algebraic techniques, thereby making it easier to reason about processes algebraically.

See also

Further reading

Notes and References

  1. J.C.M. . Baeten. A brief history of process algebra . Rapport CSR 04-02 . Vakgroep Informatica, Technische Universiteit Eindhoven . 2004 .
  2. Book: Pierce, Benjamin . Benjamin C. Pierce . Foundational Calculi for Programming Languages . The Computer Science and Engineering Handbook . 2190–2207 . CRC Press . 0-8493-2909-4 . 1996-12-21 .
  3. Baeten . J.C.M. . M. . Bravetti . A Generic Process Algebra . Algebraic Process Calculi: The First Twenty Five Years and Beyond (BRICS Notes Series NS-05-3) . BRICS, Department of Computer Science, University of Aarhus . August 2005 . Bertinoro, Forlì, Italy. 2007-12-29.
  4. Process algebra with timing: Real time and discrete time . 10.1.1.42.729 . J. C. M. . Baeten . C. A. . Middelburg . 2000 . 627–684 .
  5. Book: Sangiorgi, Davide. TAPSOFT'93: Theory and Practice of Software Development . From π-calculus to higher-order π-calculus — and back . 1993. Gaudel. M. -C.. Jouannaud. J. -P.. 668. Lecture Notes in Computer Science. en. Springer Berlin Heidelberg. 151–166. 10.1007/3-540-56610-4_62. 9783540475989. free.
  6. Book: Mazurkiewicz, Antoni . http://www.ipipan.waw.pl/~amaz/papers.htm/trbook.ps . PostScript . Introduction to Trace Theory . 3–41 . The Book of Traces . V. . Diekert . G. . Rozenberg . 1995 . World Scientific . Singapore . 981-02-2058-8 . 2009-04-29 . 2011-06-13 . https://web.archive.org/web/20110613105701/http://www.ipipan.waw.pl/~amaz/papers.htm/trbook.ps . dead .