Communicating Sequential Processes
   HOME

TheInfoList



OR:

In
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, ...
, communicating sequential processes (CSP) is a
formal language In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet". The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
for describing
pattern A pattern is a regularity in the world, in human-made design, or in abstract ideas. As such, the elements of a pattern repeat in a predictable manner. A geometric pattern is a kind of pattern formed of geometric shapes and typically repeated l ...
s of interaction in concurrent systems. It is a member of the family of mathematical theories of concurrency known as process algebras, or process calculi, based on
message passing In computer science, message passing is a technique for invoking behavior (i.e., running a program) on a computer. The invoking program sends a message to a process (which may be an actor or object) and relies on that process and its supporting ...
via channels. CSP was highly influential in the design of the occam programming language and also influenced the design of programming languages such as
Limbo The unofficial term Limbo (, or , referring to the edge of Hell) is the afterlife condition in medieval Catholic theology, of those who die in original sin without being assigned to the Hell of the Damned. However, it has become the gene ...
, RaftLib, Erlang, Go,
Crystal A crystal or crystalline solid is a solid material whose constituents (such as atoms, molecules, or ions) are arranged in a highly ordered microscopic structure, forming a crystal lattice that extends in all directions. In addition, macros ...
, and
Clojure Clojure (, like ''closure'') is a dynamic programming language, dynamic and functional programming, functional dialect (computing), dialect of the programming language Lisp (programming language), Lisp on the Java (software platform), Java platfo ...
's core.async. CSP was first described by
Tony Hoare Sir Charles Antony Richard Hoare (; born 11 January 1934), also known as C. A. R. Hoare, is a British computer scientist who has made foundational contributions to programming languages, algorithms, operating systems, formal verification, and ...
in a 1978 article, and has since evolved substantially. CSP has been practically applied in industry as a tool for specifying and verifying the concurrent aspects of a variety of different systems, such as the T9000
Transputer The transputer is a series of pioneering microprocessors from the 1980s, intended for parallel computing. To support this, each transputer had its own integrated memory and serial communication links to exchange data with other transputers. ...
, as well as a secure
e-commerce E-commerce (electronic commerce) refers to commercial activities including the electronic buying or selling products and services which are conducted on online platforms or over the Internet. E-commerce draws on technologies such as mobile co ...
system. The theory of CSP itself is also still the subject of active research, including work to increase its range of practical applicability (e.g., increasing the scale of the systems that can be tractably analyzed).


History


Original version

The version of CSP presented in Hoare's original 1978 article was essentially a concurrent programming language rather than a
process calculus 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 ...
. It had a substantially different
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
than later versions of CSP, did not possess mathematically defined semantics, and was unable to represent
unbounded nondeterminism In computer science, unbounded nondeterminism or unbounded indeterminacy refers to a behavior in concurrency (multiple tasks running at once) where a process may face unpredictable delays due to competition for shared resources—such as a print ...
. Programs in the original CSP were written as a parallel composition of a fixed number of sequential processes communicating with each other strictly through synchronous message-passing. In contrast to later versions of CSP, each process was assigned an explicit name, and the source or destination of a message was defined by specifying the name of the intended sending or receiving process. For example, the process COPY = * :character; west?c → east!c repeatedly receives a character from the process named west and sends that character to process named east. The parallel composition , X::COPY , , east::ASSEMBLE assigns the names west to the DISASSEMBLE process, X to the COPY process, and east to the ASSEMBLE process, and executes these three processes concurrently.


Development into process algebra

Following the publication of the original version of CSP, Hoare, Stephen Brookes, and A. W. Roscoe developed and refined the ''theory'' of CSP into its modern, process algebraic form. The approach taken in developing CSP into a process algebra was influenced by
Robin Milner Arthur John Robin Gorell Milner (13 January 1934 – 20 March 2010) was a British computer scientist, and a Turing Award winner.Calculus of Communicating Systems The calculus of communicating systems (CCS) is a process calculus introduced by Robin Milner around 1980 and the title of a book describing the calculus. Its actions model indivisible communications between exactly two participants. The formal lang ...
(CCS) and conversely. The theoretical version of CSP was initially presented in a 1984 article by Brookes, Hoare, and Roscoe, and later in Hoare's book ''Communicating Sequential Processes'', which was published in 1985. In September 2006, that book was still th
third-most cited
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, ...
reference of all time according to
Citeseer CiteSeerX (formerly called CiteSeer) is a public search engine and digital library for scientific and academic papers, primarily in the fields of computer and information science. CiteSeer's goal is to improve the dissemination and access of a ...
(albeit an unreliable source due to the nature of its sampling). The theory of CSP has undergone a few minor changes since the publication of Hoare's book. Most of these changes were motivated by the advent of automated tools for CSP process analysis and verification. Roscoe's ''The Theory and Practice of Concurrency'' describes this newer version of CSP.


Applications

An early and important application of CSP was its use for specification and verification of elements of the INMOS T9000
Transputer The transputer is a series of pioneering microprocessors from the 1980s, intended for parallel computing. To support this, each transputer had its own integrated memory and serial communication links to exchange data with other transputers. ...
, a complex superscalar pipelined processor designed to support large-scale multiprocessing. CSP was employed in verifying the correctness of both the processor pipeline and the Virtual Channel Processor, which managed off-chip communications for the processor. Industrial application of CSP to software design has usually focused on dependable and safety-critical systems. For example, the Bremen Institute for Safe Systems and Daimler-Benz Aerospace modeled a fault-management system and avionics interface (consisting of about 23,000 lines of code) intended for use on the International Space Station in CSP, and analyzed the model to confirm that their design was free of
deadlock Deadlock commonly refers to: * Deadlock (computer science), a situation where two processes are each waiting for the other to finish * Deadlock (locksmithing) or deadbolt, a physical door locking mechanism * Political deadlock or gridlock, a si ...
and
livelock In concurrent computing, deadlock is any situation in which no member of some group of entities can proceed because each waits for another member, including itself, to take action, such as sending a message or, more commonly, releasing a lock. ...
. The modeling and analysis process was able to uncover a number of errors that would have been difficult to detect using testing alone. Similarly, Praxis High Integrity Systems applied CSP modeling and analysis during the development of software (approximately 100,000 lines of code) for a secure smart-card certification authority to verify that their design was secure and free of deadlock. Praxis claims that the system has a much lower defect rate than comparable systems. Since CSP is well-suited to modeling and analyzing systems that incorporate complex message exchanges, it has also been applied to the verification of communications and security protocols. A prominent example of this sort of application is Lowe's use of CSP and the FDR refinement-checker to discover a previously unknown attack on the Needham–Schroeder public-key authentication protocol, and then to develop a corrected protocol able to defeat the attack.


Informal description

As its name suggests, CSP allows the description of systems in terms of component processes that operate independently, and interact with each other solely through message-passing communication. However, the ''"Sequential"'' part of the CSP name is now something of a misnomer, since modern CSP allows component processes to be defined both as sequential processes, and as the parallel composition of more primitive processes. The relationships between different processes, and the way each process communicates with its environment, are described using various process algebraic operators. Using this algebraic approach, quite complex process descriptions can be easily constructed from a few primitive elements.


Primitives

CSP provides two classes of primitives in its process algebra: events and primitive processes. ;Events Events represent communications or interactions. They are assumed to be instantaneous, and their communication is all that an external ‘environment’ can know about processes. An event is communicated only if the environment allows it. If a process does offer an event and the environment allows it, then that event ''must'' be communicated. Events may be atomic names (e.g. , ), compound names (e.g. , ), or input/output events (e.g. , ). The set of all events is denoted \Sigma. ;Primitive processes Primitive processes represent fundamental behaviors: examples include \mathrm (the process that immediately deadlocks), and \mathrm (the process that immediately terminates successfully).


Algebraic operators

CSP has a wide range of algebraic operators. The principal ones are informally given as follows. ; Prefix The prefix operator combines an event and a process to produce a new process. For example, a \to P is the process that is willing to communicate event a with its environment and, after a, behaves like the process P. ; Recursion Processes can be defined using recursion. Where F(P) is any CSP term involving P, the process \mu P. F(P) defines a recursive process given by the equation P = F(P). Recursions can also be defined mutually, such as \begin & P_u = up \to P_d\\ & P_d = down \to P_u\\ \end which defines a pair of mutually recursive processes that alternate between communcating up and down. ; Deterministic choice The deterministic (or external) choice operator allows the future evolution of a process to be defined as a choice between two component processes and allows the environment to resolve the choice by communicating an initial event for one of the processes. For example, (a \to P)\ \Box\ (b \to Q) is the process that is willing to communicate the initial events a and b and subsequently behaves as either P or Q, depending on which initial event the environment chooses to communicate. ; Nondeterministic choice The nondeterministic (or internal) choice operator allows the future evolution of a process to be defined as a choice between two component processes, but does not allow the environment any control over which one of the component processes will be selected. For example, (a \to P) \sqcap (b \to Q) can behave like either a \to P or b \to Q. It can refuse to accept a or b and is only obliged to communicate if the environment offers both a and b. Nondeterminism can be inadvertently introduced into an ostensibly deterministic choice if the initial events of both sides of the choice are identical. So, for example, (a \to a \to \mathrm)\ \Box\ (a \to b \to \mathrm) and a \to \big((a \to \mathrm) \sqcap (b \to \mathrm)\big) are equivalent. ; Interleaving The interleaving operator represents completely independent concurrent activity. The process P \;, , , \; Q behaves as both P and Q simultaneously. The events from both processes are arbitrarily interleaved in time. Interleaving can introduce nondeterminism even if P and Q are both deterministic: if P and Q can both communicate the same event, then P \;, , , \; Q nondeterministically chooses which of the two processes communicated that event. ; Interface parallel The interface parallel (or generalized parallel) operator represents concurrent activity that requires synchronization between the component processes: for P \;, \; Q, any event in the interface set X \subseteq \Sigma can only occur when both P and Q are able to engage in that event. For example, the process P \;, \; Q requires that P and Q must both be able to perform event a before that event can occur. So, the process (a \to P) \;, \; (a \to Q) is equivalent to a \to (P \;, \; Q), while (a \to P ) \;, \; (b \to Q) is equivalent to \mathrm (i.e. the process deadlocks). ; Hiding The hiding operator provides a way to abstract processes by making some events unobservable by the environment. P \setminus X is the process P with the event set X hidden. A trivial example of hiding is (a \to P) \setminus \ which, assuming that the event a doesn't appear in P, simply reduces to P. Hidden events are internalized as ''τ actions'', which are invisible to and uncontrollable by the environment. The existence of hiding introduces an additional behaviour called
divergence In vector calculus, divergence is a vector operator that operates on a vector field, producing a scalar field giving the rate that the vector field alters the volume in an infinitesimal neighborhood of each point. (In 2D this "volume" refers to ...
, where an infinite sequence of τ actions is performed. This is captured by the process \mathbf, whose behaviour is solely to perform τ actions forever. For example, (\mu P. a \to P) \setminus \ is equivalent to \mathbf.


Examples

One of the archetypal CSP examples is an abstract representation of a chocolate vending machine and its interactions with a person wishing to buy some chocolate. This vending machine might be able to carry out two different events, “coin” and “choc” which represent the insertion of payment and the delivery of a chocolate respectively. A machine which demands payment (only in cash) before offering a chocolate can be written as: \mathrm = \mathrm \rightarrow \mathrm \rightarrow \mathrm A person who might choose to use a coin or card to make payments could be modelled as: \mathrm = (\mathrm \rightarrow \mathrm)\; \Box\; (\mathrm \rightarrow \mathrm) These two processes can be put in parallel, so that they can interact with each other. The behaviour of the composite process depends on the events that the two component processes must synchronise on. Thus, \mathrm \left\vert\left left\\rightright\vert \mathrm \equiv \mathrm \rightarrow \mathrm \rightarrow \mathrm whereas if synchronization was only required on “coin”, we would obtain \mathrm \left\vert\left left\\rightright\vert \mathrm \equiv \left (\mathrm \rightarrow \mathrm \rightarrow \mathrm\right ) \Box \left (\mathrm \rightarrow \mathrm\right ) If we abstract this latter composite process by hiding the “coin” and “card” events, i.e. \left (\left (\mathrm \rightarrow \mathrm \rightarrow \mathrm\right ) \Box \left (\mathrm \rightarrow \mathrm\right )\right ) \setminus \left\ we get the nondeterministic process \left (\mathrm \rightarrow \mathrm\right ) \sqcap \mathrm This is a process which either offers a “choc” event and then stops, or just stops. In other words, if we treat the abstraction as an external view of the system (e.g., someone who does not see the decision reached by the person), nondeterminism has been introduced.


Formal definition


Syntax

The syntax of CSP defines the “legal” ways in which processes and events may be combined. Let be an event, and be a set of events. Then the basic
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
of CSP can be defined as: \begin & ::= & \mathrm & \; \\ &, & \mathrm & \; \\ &, & e \rightarrow & (\text)\\ &, & \;\Box\; & (\text \; \text)\\ &, & \;\sqcap\; & (\text \; \text)\\ &, & \;\vert\vert\vert\; & (\text) \\ &, & \;, \ \; & (\text \; \text)\\ &, & \setminus X & (\text)\\ &, & ; & (\text \; \text)\\ &, & \mathrm \; b \; \mathrm \; \; \mathrm\; Proc & (\text \; \text)\\ &, & \;\triangleright\; & (\text)\\ &, & \;\triangle\; & (\text) \end Note that, in the interests of brevity, the syntax presented above omits the \mathbf process, which represents
divergence In vector calculus, divergence is a vector operator that operates on a vector field, producing a scalar field giving the rate that the vector field alters the volume in an infinitesimal neighborhood of each point. (In 2D this "volume" refers to ...
, as well as various operators such as alphabetized parallel, piping, and indexed choices.


Formal semantics

CSP has been imbued with several different formal semantics, which define the ''meaning'' of syntactically correct CSP expressions. The theory of CSP includes mutually consistent
denotational semantics In computer science, denotational semantics (initially known as mathematical semantics or Scott–Strachey semantics) is an approach of formalizing the meanings of programming languages by constructing mathematical objects (called ''denotations'' ...
, algebraic semantics, and
operational semantics Operational semantics is a category of formal programming language semantics in which certain desired properties of a program, such as correctness, safety or security, are verified by constructing proofs from logical statements about its exec ...
.


Denotational semantics

The three major denotational models of CSP are the ''traces'' model, the ''stable failures'' model, and the ''failures/divergences'' model. Semantic mappings from process expressions to each of these three models provide the denotational semantics for CSP. Denotational semantics allows several definitions of a
partial order In mathematics, especially order theory, a partial order on a set is an arrangement such that, for certain pairs of elements, one precedes the other. The word ''partial'' is used to indicate that not every pair of elements needs to be comparable ...
of ''refinement'' on processes, which in turn can be used to elegantly represent several properties on processes. Generally, P \sqsubseteq Q denotes Q ''refines'' P.


Traces model

The ''traces model'' defines the meaning of a process expression as the set of sequences of events (traces) that the process can be observed to perform. For example, * \mathrm\left(\mathrm\right) = \left\ since \mathrm performs no events * \mathrm\left(a\rightarrow b \rightarrow \mathrm\right) = \left\ since the process (a\rightarrow b \rightarrow \mathrm) can be observed to have performed no events, the event , or the sequence of events followed by More formally, the traces model \mathcal T is defined as the set of non-empty prefix-closed subsets of \Sigma^. The meaning of a process in the traces model is defined as \mathrm\left(P\right) \subseteq \Sigma^ such that: # \langle\rangle \in \mathrm\left(P\right) (i.e. \mathrm\left(P\right) contains the empty sequence) # s_1 \smallfrown s_2 \in \mathrm\left(P\right) \implies s_1 \in \mathrm\left(P\right) (i.e. \mathrm\left(P\right) is prefix-closed) where \Sigma^ is the set of all possible finite sequences of events. A process P is said to ''trace-refine'' another Q if and only if \mathrm(P) \supseteq \mathrm(Q). P ''trace-refines'' Q is denoted Q \sqsubseteq_ P.


Stable failures model

The ''stable failures model'' \mathcal F extends the traces model with refusal sets, which are sets of events X \subseteq \Sigma that a process can refuse to perform. A ''failure'' is a pair \left(s,X\right), consisting of a trace , and a refusal set which identifies the events that a process may refuse once it has executed the trace . The observed behavior of a process in the stable failures model is described by the pair \left(\mathrm\left(P\right), \mathrm\left(P\right)\right). For example, \mathrm\left(\left(a \rightarrow \mathrm\right) \Box \left(b \rightarrow \mathrm\right)\right) = \left\ \mathrm\left(\left(a \rightarrow \mathrm\right) \sqcap \left(b \rightarrow \mathrm\right)\right) = \left\ A process P ''stable-failures-refines'' Q if and only if \mathrm(P) \supseteq \mathrm(Q) \land \mathrm(P) \supseteq \mathrm(Q). P ''stable-failures-refines'' Q is denoted Q \sqsubseteq_ P.


Failures/divergences model

The ''failures/divergence model'' \mathcal N further extends the failures model to handle
divergence In vector calculus, divergence is a vector operator that operates on a vector field, producing a scalar field giving the rate that the vector field alters the volume in an infinitesimal neighborhood of each point. (In 2D this "volume" refers to ...
. The semantics of a process in the failures/divergences model is a pair \left(\mathrm_\perp\left(P\right), \mathrm\left(P\right)\right) where \mathrm\left(P\right) is defined as the extension-closure of the set of all traces after which the process can immediately diverge, and \mathrm_\perp\left(P\right) = \mathrm\left(P\right) \cup \left\, which is the extension of \mathrm(P) with all divergent traces. A process P ''failures-divergences-refines'' Q if and only if \mathrm_\bot(P) \supseteq \mathrm_\bot(Q) \land \mathrm(P) \supseteq \mathrm(Q). P ''failures-divergences refines'' Q is denoted Q \sqsubseteq_ P.


Unique fixed points

One of the most important principles in CSP is the ''unique fixed points'' (UFP) rule. Generally, it states that a process which satisfies certain nice properties has a single semantic interpretation. It can be used to conclude algebraic proofs that two processes are equal in a model of CSP. A version for single recursions in the traces model is outlined here. Consider processes as their trace sets. The operator \downarrow is defined for all processes P, all n \in \mathbb N so that P \downarrow n = \, where \#s denotes the length of string s: the set of traces in P of length at most n. This allows a
metric Metric or metrical may refer to: Measuring * Metric system, an internationally adopted decimal system of measurement * An adjective indicating relation to measurement in general, or a noun describing a specific type of measurement Mathematics ...
to be defined on \mathcal T. For each P, Q, let d(P, Q) = \mathrm\. Informally, a process which agrees on traces with another up to some length is ‘more distant’ from it than one which agrees with it up to a greater length. It can be shown that this forms a
complete metric space In mathematical analysis, a metric space is called complete (or a Cauchy space) if every Cauchy sequence of points in has a limit that is also in . Intuitively, a space is complete if there are no "points missing" from it (inside or at the bou ...
. A function on trace sets F : \mathcal T \rightarrow \mathcal T is called ''constructive'' if and only if for all processes P, Q, all n \in \mathbb N, if P \downarrow n = Q \downarrow n then F(P) \downarrow (n + 1) = F(Q) \downarrow (n + 1). This means that a function is constructive if and only if it is a
contraction mapping In mathematics, a contraction mapping, or contraction or contractor, on a metric space (''M'', ''d'') is a function ''f'' from ''M'' to itself, with the property that there is some real number 0 \leq k < 1 such that for all ''x'' and ...
with respect to the metric on trace sets. By the
Banach fixed-point theorem In mathematics, the Banach fixed-point theorem (also known as the contraction mapping theorem or contractive mapping theorem or Banach–Caccioppoli theorem) is an important tool in the theory of metric spaces; it guarantees the existence and uniqu ...
, if F is a constructive function, it has a unique fixed point. This means that if X and Y are processes defined recursively as X = F(X) and Y = F(Y), then they are equivalent in the traces model. UFP can also be extended to mutual recursions (by using vectors of processes) and other models of CSP (e.g. in \mathcal F by defining the metric as in \mathcal T, with respect to the trace parts of a process's trace-failure pair). It can be derived using UFP (and Tarski's fixed point theorem), that for
monotonic In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of ord ...
F, a recursive term defined as X = F(X) has the semantic interpretation \sqcap_^\infty F^n(\bot), where \bot is the least element of the model. In the traces, stable failures and failures/divergences models, \bot = \mathbf (equivalent to \mathrm in the traces model).


Tools

Over the years, a number of tools for analyzing and understanding systems described using CSP have been produced. Early tool implementations used a variety of machine-readable syntaxes for CSP, making input files written for different tools incompatible. However, most CSP tools have now standardized on the machine-readable dialect of CSP devised by Bryan Scattergood, sometimes referred to as CSP''M''. The CSP''M'' dialect of CSP possesses a formally defined
operational semantics Operational semantics is a category of formal programming language semantics in which certain desired properties of a program, such as correctness, safety or security, are verified by constructing proofs from logical statements about its exec ...
, which includes an embedded
functional programming language In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map ...
.


FDR

The most well-known CSP tool is probably '' Failures-Divergences Refinement'', which is a commercial product originally developed by Formal Systems (Europe) Ltd. FDR is often described as a
model checker In computer science, model checking or property checking is a method for checking whether a finite-state model of a system meets a given specification (also known as correctness). This is typically associated with hardware or software system ...
, but is technically a ''refinement'' checker, in that it converts two CSP process expressions into
labelled transition system In theoretical computer science, a transition system is a concept used in the study of computation. It is used to describe the potential behavior of discrete systems. It consists of states and transitions between states, which may be labeled wi ...
s (LTSs), and then determines whether one of the processes is a refinement of the other within some specified semantic model (traces, failures, or failures/divergence). FDR applies various state-space compression algorithms to the process LTSs in order to reduce the size of the state-space that must be explored during a refinement check. FDR was succeeded by FDR2, FDR3 and FDR4.


ARC

The ''Adelaide Refinement Checker'' (''ARC'') is a CSP refinement checker developed by the Formal Modelling and Verification Group at
The University of Adelaide The University of Adelaide is a public university, public research university based in Adelaide, South Australia. Established in 1874, it is the third-oldest university in Australia. Its main campus in the Adelaide city centre includes many Sa ...
. ARC differs from FDR2 in that it internally represents CSP processes as ordered binary decision diagrams (OBDDs), which alleviates the state explosion problem of explicit LTS representations without requiring the use of state-space compression algorithms such as those used in FDR2.


ProB

The ''ProB'' project, which is hosted by the Institut für Informatik, Heinrich-Heine-Universität Düsseldorf, was originally created to support analysis of specifications constructed in the B method. However, it also includes support for analysis of CSP processes both through refinement checking, and LTL model-checking. ProB can also be used to verify properties of combined CSP and B specifications. A ProBE CSP Animator is integrated in FDR3.


PAT

The ''Process Analysis Toolkit'' (PAT) is a CSP analysis tool developed in the School of Computing at the
National University of Singapore The National University of Singapore (NUS) is a national university, national Public university, public research university in Singapore. It was officially established in 1980 by the merging of the University of Singapore and Nanyang University ...
. PAT is able to perform refinement checking, LTL model-checking, and simulation of CSP and Timed CSP processes. The PAT process language extends CSP with support for mutable shared variables, asynchronous message passing, and a variety of fairness and quantitative time related process constructs such as deadline and waituntil. The underlying design principle of the PAT process language is to combine a high-level specification language with procedural programs (e.g. an event in PAT may be a sequential program or even an external C# library call) for greater expressiveness. Mutable shared variables and asynchronous channels provide a convenient
syntactic sugar In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an ...
for well-known process modelling patterns used in standard CSP. The PAT syntax is similar, but not identical, to CSP''M''. The principal differences between the PAT syntax and standard CSP''M'' are the use of semicolons to terminate process expressions, the inclusion of syntactic sugar for variables and assignments, and the use of slightly different syntax for internal choice and parallel composition.


Others

''VisualNets'' produces animated visualisations of CSP systems from specifications, and supports timed CSP. ''CSPsim'' is a lazy simulator. It does not model check CSP, but is useful for exploring very large (potentially infinite) systems.
SyncStitch
is a CSP refinement checker with interactive modeling and analyzing environment. It has a graphical state-transition diagram editor. The user can model the behavior of processes as not only CSP expressions but also state-transition diagrams. The result of checking are also reported graphically as computation-trees and can be analyzed interactively with peripheral inspecting tools. In addition to refinement checks, It can perform deadlock check and livelock check.


Related formalisms

Several other specification languages and formalisms have been derived from, or inspired by, the classic untimed CSP, including:
Timed CSP
which incorporates timing information for reasoning about real-time systems
Receptive Process Theory
a specialization of CSP that assumes an asynchronous (i.e. nonblocking) send operation
CSPP

HCSP


an integration of Timed CSP and Object Z
Circus
an integration of CSP and Z based on the Unifying Theories of Programming
CML
(COMPASS Modelling Language), a combination o
Circus
and VDM developed for the modelling of Systems of Systems (SoS)
CspCASL
an extension of CASL that integrates CSP * LOTOS, an international standard that incorporates features of CSP and CCS.
PALPS
a probabilistic extension with locations for ecological models developed by Anna Philippou and Mauricio Toro Bermúdez


Comparison with the actor model

In as much as it is concerned with concurrent processes that exchange messages, the
actor model The actor model in computer science is a mathematical model of concurrent computation that treats an ''actor'' as the basic building block of concurrent computation. In response to a message it receives, an actor can: make local decisions, create ...
is broadly similar to CSP. However, the two models make some fundamentally different choices with regard to the primitives they provide: * CSP processes are anonymous, while actors have identities. * CSP uses explicit channels for message passing, whereas actor systems transmit messages to named destination actors. These approaches may be considered duals of each other, in the sense that processes receiving through a single channel effectively have an identity corresponding to that channel, while the name-based coupling between actors may be broken by constructing actors that behave as channels. * CSP message-passing fundamentally involves a rendezvous between the processes involved in sending and receiving the message, i.e. the sender cannot transmit a message until the receiver is ready to accept it. In contrast, message-passing in actor systems is fundamentally asynchronous, i.e. message transmission and reception do not have to happen at the same time, and senders may transmit messages before receivers are ready to accept them. These approaches may also be considered duals of each other, in the sense that rendezvous-based systems can be used to construct buffered communications that behave as asynchronous messaging systems, while asynchronous systems can be used to construct rendezvous-style communications by using a message/acknowledgement protocol to synchronize senders and receivers. Note that the aforementioned properties do not necessarily refer to the original CSP paper by Hoare, but rather the modern incarnation of the idea as seen in implementations such as Go and Clojure's core.async. In the original paper, channels were not a central part of the specification, and the sender and receiver processes actually identify each other by name.


Award

In 1990, “A
Queen Queen most commonly refers to: * Queen regnant, a female monarch of a kingdom * Queen consort, the wife of a reigning king * Queen (band), a British rock band Queen or QUEEN may also refer to: Monarchy * Queen dowager, the widow of a king * Q ...
’s Award for Technological Achievement asconferred ... on xford UniversityComputing Laboratory. The award recognises a successful collaboration between the laboratory and
Inmos Inmos International plc (trademark INMOS) and two operating subsidiaries, Inmos Limited (UK) and Inmos Corporation (US), was a British semiconductor company founded by Iann Barron, Richard Petritz, and Paul Schroeder in July 1978. Inmos Limited ...
Ltd. … Inmos’ flagship product is the ‘
transputer The transputer is a series of pioneering microprocessors from the 1980s, intended for parallel computing. To support this, each transputer had its own integrated memory and serial communication links to exchange data with other transputers. ...
’, a
microprocessor A microprocessor is a computer processor (computing), processor for which the data processing logic and control is included on a single integrated circuit (IC), or a small number of ICs. The microprocessor contains the arithmetic, logic, a ...
with many of the parts that would normally be needed in addition built into the same single
component Component may refer to: In engineering, science, and technology Generic systems *System components, an entity with discrete structure, such as an assembly or software module, within a system considered at a particular level of analysis * Lumped e ...
.” According to Tony Hoare, “The INMOS Transputer was as embodiment of the ideas … of building microprocessors that could communicate with each other along wires that would stretch between their terminals. The founder had the vision that the CSP ideas were ripe for industrial exploitation, and he made that the basis of the language for programming Transputers, which was called Occam. … The company estimated it enabled them to deliver the hardware one year earlier than would otherwise have happened. They applied for and won a Queen’s award for technological achievement, in conjunction with Oxford University Computing Laboratory.”


See also

* Trace theory, the general theory of traces. *
Trace monoid In computer science, a trace is an equivalence class of strings, wherein certain letters in the string are allowed to commute, but others are not. Traces generalize the concept of strings by relaxing the requirement for all the letters to have a d ...
and
history monoid In mathematics and computer science, a history monoid is a way of representing the histories of concurrently running computer processes as a collection of strings, each string representing the individual history of a process. The history monoid pr ...
* Ease programming language * XC programming language * VerilogCSP is a set of macros added to Verilog HDL to support communicating sequential processes channel communications. * Joyce is a programming language based on the principles of CSP, developed by Brinch Hansen around 1989. *
SuperPascal SuperPascal is an imperative, concurrent computing programming language developed by Per Brinch Hansen. It was designed as a ''publication language'': a thinking tool to enable the clear and concise expression of concepts in parallel programmin ...
is a programming language also developed by Brinch Hansen, influenced by CSP and his earlier work with Joyce. * Ada implements features of CSP such as the rendezvous. *
DirectShow DirectShow (sometimes abbreviated as DS or DShow), codename Quartz, is a multimedia framework and API produced by Microsoft for software developers to perform various operations with media files or streams. It is the replacement for Microsoft's ea ...
is the video framework inside
DirectX Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct" ...
, it uses the CSP concepts to implement the audio and video filters. * OpenComRTOS is a formally developed network-centric distributed
RTOS A real-time operating system (RTOS) is an operating system (OS) for real-time computing applications that processes data and events that have critically defined time constraints. A RTOS is distinct from a time-sharing operating system, such as Unix ...
based on a pragmatic superset of CSP. * Input/output automaton *
Parallel programming model In computing, a parallel programming model is an abstraction of parallel computer architecture, with which it is convenient to express algorithms and their composition in programs. The value of a programming model can be judged on its ''generalit ...
*
TLA+ TLA+ is a formal specification language developed by Leslie Lamport. It is used for designing, modelling, documentation, and verification of programs, especially concurrent systems and distributed systems. TLA+ is considered to be exhaustively-te ...
is another formal language for modelling and verifying concurrent systems.


References


Further reading

* ** This book has been updated by Jim Davies at the Oxford University Computing Laboratory and the new edition is available for download as a PDF file at th
''Using CSP''
website. * ** Some links relating to this book are availabl
here
The full text is available for download as
PS
o
PDF
file from Bill Roscoe'

of academic publications.


External links


A PDF version of Hoare's CSP book
– copyright restriction apply, see the page text before downloading.
''The Annotation of CSP'' (Chinese version)
non-profit translation and annotation work based on Prentice-Hall book (1985), Chaochen Zhou's Chinese version (1988), and Jim Davies's online version (2015).
WoTUG
a user group for CSP and occam style systems, contains some information about CSP and useful links.
"CSP Citations" from ''CiteSeer''
{{DEFAULTSORT:Communicating sequential processes Computer-related introductions in 1978 1978 in computing Process calculi Concurrent computing