Structural Rewriting in the π -Calculus David Sabel Goethe-University, Frankfurt, Germany WPTE’14, Vienna, Austria 1
Introduction the π -calculus (R. Milner, J. Parrow & D. Walker, 1992) is a core language for mobile concurrent processes it is a minimalistic model for concurrent programming languages lot of applications and variants exist: Spi-calculus (cryptographic protocols) modelling of business processes, stochastic pi-calculus (biochemical processes), join-calculus (distributed programming) . . . all these applications need reasoning tools for process equivalence lot of process equivalence notions are based on the operational semantics of π -processes 2/19
Introduction (2) Evaluation of π -processes: Reduction semantics reduction relation on processes for interaction of processes closure by structural congruence used implicitly Structural congruence “natural” conversions, e.g. P 1 | | ( P 2 | | P 3 ) ≡ ( P 2 | | P 1 ) | | P 3 | | | | hard to automatize more freedom than necessary high complexity , decidability is unknown , at least EXPSPACE-hard 3/19
Goals of this Paper A new reduction strategy for the π -calculus: make structural congruence explicit by reduction rules only necessary rules are included Correctness: same equational semantics of processes coarsest sensible semantics: barbed may- and should-testing Advantages: new strategy is easier to automatize , since all transformations are explicit may be used in deduction system for proving correctness of process transformations (Rau, PhD-thesis, in progress) 4/19
Syntax of the Synchronous π -Calculus Processes: P ::= π.P (action) | P 1 | | P 2 (parallel composition) | | ! P (replication) | (silent process) 0 | νx.P (name restriction) Action prefixes: π ::= x ( y ) input | x � y � output where x, y are names Contexts: C ∈ C ::= [ · ] | π.C | C | | P | P | | C | ! C | νx.C . | | 5/19
Reduction Semantics (Classic Definition) Reduction rule for interaction : | x � v � .Q ia x ( y ) .P | − → P [ v/y ] | | Q | | Reduction contexts : D ∈ D ::= [ · ] | D | | P | P | | D | νx. D | | P ≡ P ′ ∧ P ′ D , ia → Q ′ ∧ Q ′ ≡ Q ia P − → Q − − − D ∈ D sr D , ia P − → Q − − − → D [ Q ] D [ P ] Closure w.r.t. reduction contexts Standard reduction ≡ is structural congruence (next slide) 6/19
Structural Congruence ≡ Smallest congruence on processes satisfying the following axioms P ≡ Q, if P = α Q ≡ P 1 | | | ( P 2 | | | P 3 ) ( P 1 | | | P 2 ) | | | P 3 P 1 | | P 2 ≡ P 2 | | P 1 | | P | | | 0 ≡ P νz.νw.P ≡ νw.νz.P νz. 0 ≡ 0 νz. ( P 1 | | P 2 ) ≡ P 1 | | νz.P 2 , if z �∈ fn ( P 1 ) | | ! P ≡ P | | ! P | Remark (see Engelfriet & Gelsema 2004, 2007, Khomenko & Meyer 2009, Schmidt-Schauß,S. & Rau 2013) The decision problem whether for two π -processes P ≡ Q holds is EXPSPACE -hard. Its decidability is still unknown . 7/19
Structural Congruence as Reduction | P 3 ) sca − − → ( P 1 | ( assocl ) P 1 | | | ( P 2 | | | | P 2 ) | | | P 3 sca ( assocr ) ( P 1 | | P 2 ) | | P 3 − − → P 1 | | ( P 2 | | P 3 ) | | | | sca ( commute ) P 1 | | P 2 − − → P 2 | | P 1 | | sca ( replunfold ) ! P − − → P | | ! P | D [ νz.P ] sca ( nuup ) − − → νz. D [ P ] , if z �∈ fn ( D ) , [ · ] � = D ∈ D νz. D [ P ] sca − − → D [ νz.P ] , if z �∈ fn ( D ) , [ · ] � = D ∈ D ( nudown ) sca ( nuintro ) P − − → νz.P if z �∈ fn ( P ) sca ( nurem ) νz.P − − → P if z �∈ fn ( P ) sca ( replfold ) P | | | ! P − − → ! P sca − − → 0 | ( intro0l ) P | | P sca ( intro0r ) P − − → P | | | 0 | 0 sca ( rem0r ) P | − − → P | sca Lemma P − − → Q where C ∈ C C ,sca, ∗ C ,sca − − − − → = ≡ − − − → C [ Q ] C [ P ] 8/19
New Definition: Structural Reduction instead of Congruence Restricted structural reduction: sc sca − → ⊂ − − → | P 3 ) sc ( assocl ) P 1 | | ( P 2 | − → ( P 1 | | P 2 ) | | P 3 | | | | sc ( assocr ) ( P 1 | | P 2 ) | | P 3 − → P 1 | | ( P 2 | | P 3 ) | | | | sc ( commute ) P 1 | | P 2 − → P 2 | | P 1 | | sc − → P | ( replunfold ) ! P | | ! P D [ νz.P ] sc ( nuup ) − → νz. D [ P ] , if z �∈ fn ( D ) , [ · ] � = D ∈ D D ,sc, ∗ → P ′ ∧ P ′ D , ia → Q ′ ∧ Q ′ D ,sc, ∗ sc − → Q − − − − − − − − − − − → Q P P D ∈ D D ,sc dsr − − → Q D [ P ] − − − → D [ Q ] P Structural standard reduction D -Standard Reduction 9/19
New Definition: Structural Reduction instead of Congruence Restricted structural reduction: sc sca − → ⊂ − − → | P 3 ) sc ( assocl ) P 1 | | ( P 2 | − → ( P 1 | | P 2 ) | | P 3 | | | | sc ( assocr ) ( P 1 | | P 2 ) | | P 3 − → P 1 | | ( P 2 | | P 3 ) | | | | sc ( commute ) P 1 | | P 2 − → P 2 | | P 1 | | sc − → P | ( replunfold ) ! P | | ! P D [ νz.P ] sc ( nuup ) − → νz. D [ P ] , if z �∈ fn ( D ) , [ · ] � = D ∈ D D ,sc, ∗ → P ′ ∧ P ′ D , ia → Q ′ ∧ Q ′ D ,sc, ∗ sc − → Q − − − − − − − − − − − → Q P P D ∈ D D ,sc dsr − − → Q D [ P ] − − − → D [ Q ] P Structural standard reduction D -Standard Reduction Goal : Show that dsr → induces the same semantics as sr − − − → 9/19
A Hierarchy of Process Equivalences (see Fournet & Gonthier 2005) fine full strong labelled bisimilarity ⊂ full (weak) labelled bisimilarity ⊆ barbed congruence ⊂ barbed may- and should-testing ⊂ barbed may-testing coarse 10/19
A Hierarchy of Process Equivalences (see Fournet & Gonthier 2005) fine full strong labelled bisimilarity ⊂ full (weak) labelled bisimilarity ⊆ very fine, e.g. choice P 1 ( choice P 2 P 3 ) barbed congruence �∼ choice ( choice P 1 P 2 ) P 3 ⊂ barbed may- and should-testing ⊂ barbed may-testing coarse 10/19
A Hierarchy of Process Equivalences (see Fournet & Gonthier 2005) fine full strong labelled bisimilarity ⊂ full (weak) labelled bisimilarity ⊆ very fine, e.g. choice P 1 ( choice P 2 P 3 ) barbed congruence �∼ choice ( choice P 1 P 2 ) P 3 ⊂ barbed may- and should-testing ⊂ too coarse, e.g. barbed may-testing coarse choice P 0 ∼ P 10/19
A Hierarchy of Process Equivalences (see Fournet & Gonthier 2005) fine full strong labelled bisimilarity ⊂ full (weak) labelled bisimilarity ⊆ very fine, e.g. choice P 1 ( choice P 2 P 3 ) barbed congruence �∼ choice ( choice P 1 P 2 ) P 3 ⊂ barbed may- and should-testing ⊂ too coarse, e.g. barbed may-testing coarse choice P 0 ∼ P 10/19
May- and Should-Testing Process P has a barb on x : P � x : P has an open input on x ( P = ν X . ( x ( y ) .P ′ | | P ′′ ) , x �∈ X ) | P � x : P has an open output on x ( P = ν X . ( x � y � .P ′ | | P ′′ ) , x �∈ X ) | 11/19
May- and Should-Testing Process P has a barb on x : P � x : P has an open input on x ( P = ν X . ( x ( y ) .P ′ | | P ′′ ) , x �∈ X ) | P � x : P has an open output on x ( P = ν X . ( x � y � .P ′ | | P ′′ ) , x �∈ X ) | May-barb and Should-barb : For µ ∈ { x, x } , sr, ∗ → Q ∧ Q ≡ Q ′ ∧ Q ′ � µ P may have a barb on µ : P ↓ µ iff ∃ Q : P − − sr, ∗ P should have a barb on µ : P ⇓ µ iff ∀ Q : P − − → Q = ⇒ Q ↓ µ . 11/19
May- and Should-Testing Process P has a barb on x : P � x : P has an open input on x ( P = ν X . ( x ( y ) .P ′ | | P ′′ ) , x �∈ X ) | P � x : P has an open output on x ( P = ν X . ( x � y � .P ′ | | P ′′ ) , x �∈ X ) | May-barb and Should-barb : For µ ∈ { x, x } , sr, ∗ → Q ∧ Q ≡ Q ′ ∧ Q ′ � µ P may have a barb on µ : P ↓ µ iff ∃ Q : P − − sr, ∗ P should have a barb on µ : P ⇓ µ iff ∀ Q : P − − → Q = ⇒ Q ↓ µ . Barbed May- and Should-Testing Equivalence P ∼ Q iff P � Q and Q � P where P � Q iff P � may Q and P � should Q P � may Q iff ∀ x ∈ N , µ ∈ { x, x } , C ∈ C : C [ P ] ↓ µ = ⇒ C [ Q ] ↓ µ P � should Q iff ∀ x ∈ N , µ ∈ { x, x } , C ∈ C : C [ P ] ⇓ µ = ⇒ C [ Q ] ⇓ µ 11/19
dsr − − → May- and Should-Testing w.r.t. dsr − − → Barbed May- and Should-Testing Equivalence w.r.t. P ∼ D Q iff P � D Q and Q � D P where P � D Q iff P � D , may Q and P � D , should Q iff ∀ x ∈ N , µ ∈ { x, x } , C ∈ C : C [ P ] ↓ D ,µ = ⇒ C [ Q ] ↓ D ,µ P � D , may Q P � D , should Q iff ∀ x ∈ N , µ ∈ { x, x } , C ∈ C : C [ P ] ⇓ D ,µ = ⇒ C [ Q ] ⇓ D ,µ May-barb and Should-barb w.r.t. dsr − − → : For µ ∈ { x, x } , dsr, ∗ D ,sc, ∗ → Q ′ ∧ Q ′ � µ May: P ↓ D ,µ iff ∃ Q : P − − − → Q ∧ Q − − − − dsr, ∗ Should: P ⇓ D ,µ iff ∀ Q : P − − − → Q = ⇒ Q ↓ D ,µ . 12/19
Main Result Theorem ∼ = ∼ D Proof: It suffices to show ↓ µ = ↓ D ,µ and ⇓ µ = ⇓ D ,µ . We only consider may-observation ↓ µ = ↓ D ,µ (should-observation works analogously) Trivial case: ↓ D ,µ ⊆ ↓ µ Remaining case: ↓ µ ⊆ ↓ D ,µ 13/19
Recommend
More recommend