computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, the process calculi (or process algebras) are a diverse family of related approaches for formally modelling
concurrent system
Concurrency refers to the ability of a system to execute multiple tasks through simultaneous execution or time-sharing (context switching), sharing resources and managing interactions. Concurrency improves responsiveness, throughput, and scalabi ...
s. 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
algebra
Algebra is a branch of mathematics that deals with abstract systems, known as algebraic structures, and the manipulation of expressions within those systems. It is a generalization of arithmetic that introduces variables and algebraic ope ...
ic laws that allow process descriptions to be manipulated and analyzed, and permit formal reasoning about equivalences between processes (e.g., using
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 ...
). Leading examples of process calculi include CSP, CCS, ACP, and LOTOS. More recent additions to the family include the
Ï€-calculus
In theoretical computer science, the -calculus (or pi-calculus) is a process calculus. The -calculus allows channel names to be communicated along the channels themselves, and in this matter, it is able to describe concurrent computations whose ...
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 pr ...
.
Essential features
While the variety of existing process calculi is very large (including variants that incorporate
stochastic Stochastic (; ) is the property of being well-described by a random probability distribution. ''Stochasticity'' and ''randomness'' are technically distinct concepts: the former refers to a modeling approach, while the latter describes phenomena; i ...
behaviour, timing information, and specializations for studying molecular interactions), there are several features that all process calculi have in common:
* Representing interactions between independent processes as communication ( message-passing), 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
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:
* 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
Parallel composition of two processes and , usually written , is the key primitive distinguishing the process calculi from sequential models of computation. Parallel composition allows computation in and to proceed simultaneously and independently. But it also allows interaction, that is synchronisation and flow of information from to (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
In theoretical computer science, the -calculus (or pi-calculus) is a process calculus. The -calculus allows channel names to be communicated along the channels themselves, and in this matter, it is able to describe concurrent computations whose ...
) 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.'' ) and an output operator (''e.g.'' ), both of which name an interaction point (here ) 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
In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a variable may be said to be either free or bound. Some older books use the terms real variable and apparent variable for f ...
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