Process Algebr CSP A Technique to Model Concurrent Progrms Jnury 15, 2002 Hui Shi
1 Contents CSP-Processes Opertionl Semntics Trnsition systems nd stte mchines Bisimultion Firing rules for CSP Model-Checker FDR Denottionl Semntics Specifiction nd Refinement
2 Semntic pproches to CSP Opertionl semntics inteprets CSP processes s trnsition digrms, with visible nd invisivle ctions for moving between vrious progrm sttes. Denottionl semntics mps CSP into some bstrct models: trces, filures nd filures/divergences. Algebric semntics is defined by set of lgebric lws, from which process equivlence between CSP processes cn be derived.
Opertionl Semntics
Opertionl Semntics 4 Trnsition systems nd stte mchines Lbelled Trnsition System (LTD) set of nodes s process sttes strting node n 0 for ech Σ,, reltion between nodes, where Σ, = Σ {, } Σ is the lphbet of ll communictions of process
Opertionl Semntics 5 A b B D C E Exmple 1 (A lbelled trnsition system)
Opertionl Semntics 6 Strong bisimultion Definition 1 (Strong Bisimultion) IF S is n LTS, the reltion R on the set of nodes S of S is sid to be strong bisimultion if, nd only if, both the following hold: n 1, n 2, m 1 S. x Σ,. n 1 Rn 2 n 1 x m1 m 2 S.n 2 x m2 m 1 Rm 2 n 1, n 2, m 2 S. x Σ,. n 1 Rn 2 n 2 x m2 m 1 S.n 1 x m1 m 1 Rm 2 Two nodes in S re sid to be bisimilr if there is ny bisimultion which reltes them.
Opertionl Semntics 7 A X B C Y E D G Z F Exmple 2 (Bisimultion equivlence)
Opertionl Semntics 8 Firing rules for CSP Foundmentl opertors Skip Ω Ω denotes ny terminted process e P where, subs(,e,p) ( comms(e)) comms(e) is the set of communiction described by e subs(, e, P) is the result of substituting the prt of for ech identifier in P bound by e P Q P P Q Q
Opertionl Semntics 9 µ p.p P[µ p.p/p] P P Q P P Q Q P Q Q P Q P P P Q P ( ) Q Q P Q Q ( ) Exmple 3 ( P b Q nd P b Q)
Opertionl Semntics 10 Prllel opertors P P P Q P Q X X Q Q P Q P X X Q P P P Q P Q ( Σ\X ) Q Q P Q P Q ( Σ\X ) X X X X P P Q P Q P X X Q Q ( X ) P X P Q P Ω Q X P X Q Q P Ω Q X Ω Ω Ω X Exercise: Derive the trnsitions of the process SVAR(0) {red,write} (USER(1) USER(2))
Opertionl Semntics 11 Hiding nd renming P P\B x P x P \B (x B { }) P P P\B Ω P P\B P P \B ( B) P P P[ R ] P [ R ] P P[ R ] Ω P P P b ( R b) P[ R ] P [ R ] Sequentil composition P x P P; Q x P ; Q (x ) P.P P P; Q Q Time-out P P P Q P Q P P P Q P ( ) P Q Q
Opertionl Semntics 12 P b b b b Q P Q Exmple 4 (P Q nd (P Stop) Q ) P = P Q = b Q
Opertionl Semntics 13 Exercise: Derive the trnsitions of the following process: COPY >> COPY = (COPY [ right/mid ] COPY [ left/mid ]) \ {mid} {mid} where COPY = µ p.left?x right.x p
Opertionl Semntics 14 The Model-Checker FDR The bsic concept of FDR FDR (Filures-Divergence-Refinemen) is model-checking tool for lbelled trnsition systems with foundtions in CSP bsed minly on explict model-checking techniques. Explict model-checking techniques: the check proceeds by recursive induction which fully expnds the rechble stte-spce of the two systems nd visits ech pir of supposedly corresponding stte in turn.
Opertionl Semntics 15 The bsic opertion of FDR Clculte the opertionl semntics using firing rules. Normlise the specifiction process into LTS in which ll sttes re semnticlly distinct bsed minly on the strong bisimultion. Checke process properties in terms of refinemen reltions.
Opertionl Semntics 16 Exmple 5 (Model-checking) A concurrent system is dedlocked if no component cn mke ny progress, generlly becuse ech is witing for communiction with others. A concurrent system cn livelock, when network communictes infinitely internlly without ny component communicting externlly. Some exmples Five dining philosophers (dedlock check) Producer-consumer system with hiding (livelock check) Buffer (refinement check)