180 likes | 420 Views
CSP. Communicating Sequential Processes. History. Communicating Sequential Processes, 1985 Prentice Hall A formal language Describe patterns of interaction in concurrent systems First described in a 1978 paper by C. A. R. Hoare as a concurrent programming language
E N D
CSP Communicating Sequential Processes
History • Communicating Sequential Processes, 1985 Prentice Hall • A formal language • Describe patterns of interaction in concurrent systems • First described in a 1978 paper by C. A. R. Hoare as a concurrent programming language • Influenced Occam, Limbo and Go
C. A. R. Hoare • Tony Hoare, bornFeb 11, 1934 • British computer scientist • 1980Turing Award • Quicksort
Primitives • Event • Process
Example : Vending Machine • Event : coin : insertion of a coin in the slot of a vending machine choc : extraction of a chocolate • Process : VMS αVMS= { coin , choc }
Prefix (x → P) x event P process First engages in the event x then behaves as described by P
Example : Vending Machine VMS = (coin → (choc → STOPαVMS))
Recursion µX : A • F (X) Xprocess name Aalphabet of X F expression containing the process name X which begins with a prefix
Example : Vending Machine VMS = µX : {coin, choc} • (coin → (choc → X)))
Choice (x → P | y → Q ) x, ydiferent events P, Qprocesses
Example : Vending Machine αVMS = { in2 in1 out1 choc } VMS = (in1 → (choc → VMS) | in2 → (out1 → choc → VMS))
Mutual Recursion αDD = αO = αL = {set.oset.l o l} DD = (set.o→ O | set.l→ L) O = (o → O | set.l→ L | set.o→ O) L = (l → O | set.o→ O | set.l→ L)
Trace • A finite sequence of symbols recording the events in which the process has engaged up to some moment in time • <coin, choc, coin, choc>
Interaction α(P || Q ) = αP = αQ VMS = (in1 →choc→VMS |in2 →STOP) FOOLCUST = ( in2 → choc → FOOLCUST | in1 → choc → FOOLCUST ) (FOOLCUST || VMS) = µX • (in1 → choc → X | in2 → STOP)
Concurrency α(P || Q ) = αP ∪ αQ NOISYVM = (coin → clink → choc → clunk → NOISYVM ) CUST = (coin → (toffee → CUST | curse → choc → CUST)) (NOISYVM || CUST) = µX • (coin → (clink → curse → choc → clunk → X | curse → clink → choc → clunk → X ))
Implementation prefix(c, P) = λ x • if x = c then P else "BLEEP