Process calculus
In computer science, the process calculi 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. Leading examples of process calculi include CSP, CCS, ACP, and LOTOS. 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, there are several features that all process calculi have in common:- Representing interactions between independent processes as communication, rather than as modification of shared variables.
- Describing processes and systems using a small collection of primitives, and operators for combining those primitives.
- Defining algebraic laws for the process operators, which allow process expressions to be manipulated using equational reasoning.
Mathematics of processes
- parallel composition of processes
- specification of which channels to use for sending and receiving data
- sequentialization of interactions
- hiding of interaction points
- recursion or process replication
Parallel composition
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 channels themselves can be sent in messages through 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 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 and an output operator, both of which name an interaction point 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, this data is. 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, 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 and then send that data on . 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 will wait for an input on. Only when this input has occurred will the process be activated, with the received data through substituted for identifier.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:The interpretation to this reduction rule is:
- The process sends a message, here, along the channel. Dually, the process receives that message on channel.
- Once the message has been sent, becomes the process, while becomes the process, which is with the place-holder substituted by, the data received on.
Hiding
Processes do not limit the number of connections that can be made at a given interaction point. But interaction points allow interference. 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 composing
agents in parallel. Hiding can be denoted in a variety of ways. For example, in the π-calculus the hiding of a name in can be expressed as, while in CSP it might be written as.
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 can be understood as abbreviating the parallel composition of a countably infinite number of processes:Null process
Process calculi generally also include a null process 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.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 during the period from 1973 to 1980. C.A.R. Hoare's Communicating Sequential Processes 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, and introduced the term process algebra to describe their work. 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.- Developing new process calculi for better modeling of computational phenomena.
- Finding well-behaved subcalculi of a given process calculus. This is valuable because most calculi are fairly wild in the sense that they are rather general and not much can be said about arbitrary processes; and computational applications rarely exhaust the whole of a calculus. Rather they use only processes that are very constrained in form. Constraining the shape of processes is mostly studied by way of type systems.
- Logics for processes that allow one to reason about arbitrary properties of processes, following the ideas of Hoare logic.
- Behavioural theory: what does it mean for two processes to be the same? How can we decide whether two processes are different or not? Can we find representatives for equivalence classes of processes? Generally, processes are considered to be the same if no context, that is other processes running in parallel, can detect a difference. Unfortunately, making this intuition precise is subtle and mostly yields unwieldy characterisations of equality. Bisimulations are a technical tool that aids reasoning about process equivalences.
- Expressivity of calculi. Programming experience shows that certain problems are easier to solve in some languages than in others. This phenomenon calls for a more precise characterisation of the expressivity of calculi modeling computation than that afforded by the Church-Turing thesis. One way of doing this is to consider encodings between two formalisms and see what properties encodings can potentially preserve. The more properties can be preserved, the more expressive the target of the encoding is said to be. For process calculi, the celebrated results are that the synchronous π-calculus is more expressive than its asynchronous variant, has the same expressive power as the higher-order π-calculus, but is less than the ambient calculus.
- Using process calculus to model biological systems. It is thought by some that the compositionality offered by process-theoretic tools can help biologists to organise their knowledge more formally.
Software implementations
- CADP
-
Relationship to other models of concurrency
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. 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.