concurrency theory
play

Concurrency Theory Winter Semester 2019/20 Lecture 8: The -Calculus - PowerPoint PPT Presentation

Concurrency Theory Winter Semester 2019/20 Lecture 8: The -Calculus Joost-Pieter Katoen and Thomas Noll Software Modeling and Verification Group RWTH Aachen University https://moves.rwth-aachen.de/teaching/ws-19-20/ct/ Recap: Modelling


  1. Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus Joost-Pieter Katoen and Thomas Noll Software Modeling and Verification Group RWTH Aachen University https://moves.rwth-aachen.de/teaching/ws-19-20/ct/

  2. Recap: Modelling Mutual Exclusion Algorithms Outline of Lecture 8 Recap: Modelling Mutual Exclusion Algorithms Recap: Value-Passing CCS Modelling Mobile Concurrent Systems Another Example: Mobile Clients Syntax of the Monadic π -Calculus Semantics of the Monadic π -Calculus 2 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  3. Recap: Modelling Mutual Exclusion Algorithms Modelling the Processes in CCS Assumption: P i cannot fail or terminate within critical section Peterson’s algorithm CCS representation P 1 = b1wt . kw2 . P 11 while true do “non-critical section” ; P 11 = b2rf . P 12 + b i := true ; b2rt . ( kr1 . P 12 + kr2 . P 11 ) k := j ; P 12 = enter1 . exit1 . b1wf . P 1 while b j ∧ k = j do skip end ; P 2 = b2wt . kw1 . P 21 “critical section” ; P 21 = b1rf . P 22 + b i := false ; b1rt . ( kr1 . P 21 + kr2 . P 22 ) end P 22 = enter2 . exit2 . b2wf . P 2 Peterson = ( P 1 � P 2 � B 1 f � B 2 f � K 1 ) \ L for L = { b1rf , b1rt , b1wf , b1wt , b2rf , b2rt , b2wf , b2wt , kr1 , kr2 , kw1 , kw2 } 3 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  4. Recap: Modelling Mutual Exclusion Algorithms Obtaining the LTS I 4 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  5. Recap: Modelling Mutual Exclusion Algorithms Obtaining the LTS II 5 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  6. Recap: Value-Passing CCS Outline of Lecture 8 Recap: Modelling Mutual Exclusion Algorithms Recap: Value-Passing CCS Modelling Mobile Concurrent Systems Another Example: Mobile Clients Syntax of the Monadic π -Calculus Semantics of the Monadic π -Calculus 6 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  7. Recap: Value-Passing CCS Syntax of Value-Passing CCS I Definition (Syntax of value-passing CCS) • Let A , A , Pid (ranked) as in Definition 2.1. • Let e and b be integer and Boolean expressions, resp., built from integer variables x , y , . . . • The set Prc + of value-passing process expressions is defined by: P ::= nil (inaction) | a ( x ) . P (input prefixing) | a ( e ) . P (output prefixing) | τ. P ( τ prefixing) | P 1 + P 2 (choice) | P 1 � P 2 (parallel composition) | P \ L (restriction) | P [ f ] (relabelling) | if b then P (conditional) | C ( e 1 , . . . , e n ) (process call) where a ∈ A , L ⊆ A , C ∈ Pid (of rank n ∈ N ), and f : A → A . 7 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  8. Recap: Value-Passing CCS Semantics of Value-Passing CCS I Definition (Semantics of value-passing CCS) A value-passing process definition ( C i ( x 1 , . . . , x n i ) = P i | 1 ≤ i ≤ k ) determines the LTS ( Prc + , Act , − → ) with Act := ( A ∪ A ) × Z ∪ { τ } whose transitions can be inferred from the following rules ( P , P ′ , Q , Q ′ ∈ Prc + , a ∈ A , x i integer variables, e i / b integer/Boolean expressions, z ∈ Z , α ∈ Act , λ ∈ ( A ∪ A ) × Z ): ( Out ) ( z value of e ) ( In ) ( Tau ) τ a ( z ) a ( z ) − → P τ. P a ( x ) . P − → P [ z / x ] a ( e ) . P − → P α α → Q ′ → P ′ − − Q P ( Sum 1 ) ( Sum 2 ) α α → P ′ → Q ′ P + Q − P + Q − α λ λ α → P ′ Q → Q ′ → Q ′ → P ′ − − − − Q ( Com ) P P ( Par 1 ) ( Par 2 ) → P ′ � Q → P ′ � Q ′ α α τ → P � Q ′ P � Q − P � Q − P � Q − 8 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  9. Recap: Value-Passing CCS Semantics of Value-Passing CCS II Definition (Semantics of value-passing CCS; continued) → P ′ ( α / α α ∈ ( L ∪ L ) × Z ) − → P ′ P − P ( Rel ) ( Res ) → P ′ \ L α f ( α ) P \ L − → P ′ [ f ] − P [ f ] α → P ′ P [ z 1 / x 1 , . . . , z n / x n ] − → P ′ ( b true ) α ( C ( x 1 , . . . , x n ) = P , z i value of e i ) − P ( If ) ( Call ) α α → P ′ → P ′ − − C ( e 1 , . . . , e n ) if b then P Remarks: • P [ z 1 / x 1 , . . . , z n / x n ] denotes the substitution of each free (i.e., unbound) occurrence of x i by z i (1 ≤ i ≤ n ) • Operations on actions ignore values: a ( z ) := a ( z ) a ( z ) := a ( z ) f ( a ( z )) := f ( a )( z ) f ( a ( z )) := f ( a )( z ) (and f ( τ ) := τ ) 9 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  10. Recap: Value-Passing CCS Translation of Value-Passing into Pure CCS II Definition (Translation of value-passing into pure CCS) For each P ∈ Prc + without free variables, its translated form � P ∈ Prc is given by � � τ. P := τ. � nil := nil P a ( x ) . P := � � z ∈ Z a z . � � a ( e ) . P := a z . � P [ z / x ] ( z value of e ) P � � P 1 + P 2 := � P 1 + � P 1 � P 2 := � P 1 � � P 2 P 2 � � P [ � ( � P \ L := � P [ f ] := � P \ { a z | a ∈ L , z ∈ Z } f ] f ( a z ) := f ( a ) z ) � � P if b true � � if b then P := C ( e 1 , . . . , e n ) := C z 1 ,..., z n ( z i value of e i ) nil otherwise Moreover, each defining equation C ( x 1 , . . . , x n ) = P of a process identifier is translated into the indexed collection of process definitions � � � P [ z 1 / x 1 , . . . , z n / x n ] | z 1 , . . . , z n ∈ Z C z 1 ,..., z n = 10 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  11. Modelling Mobile Concurrent Systems Outline of Lecture 8 Recap: Modelling Mutual Exclusion Algorithms Recap: Value-Passing CCS Modelling Mobile Concurrent Systems Another Example: Mobile Clients Syntax of the Monadic π -Calculus Semantics of the Monadic π -Calculus 11 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  12. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems I Observation: CCS imposes static communication structures: if P , Q ∈ Prc want to communicate, then both must syntactically refer to the same action name 12 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  13. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems I Observation: CCS imposes static communication structures: if P , Q ∈ Prc want to communicate, then both must syntactically refer to the same action name ⇒ every potential communication partner known beforehand, no dynamic passing of communication links 12 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  14. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems I Observation: CCS imposes static communication structures: if P , Q ∈ Prc want to communicate, then both must syntactically refer to the same action name ⇒ every potential communication partner known beforehand, no dynamic passing of communication links ⇒ lack of modelling capabilities for mobility 12 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  15. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems I Observation: CCS imposes static communication structures: if P , Q ∈ Prc want to communicate, then both must syntactically refer to the same action name ⇒ every potential communication partner known beforehand, no dynamic passing of communication links ⇒ lack of modelling capabilities for mobility Goal: develop calculus in the spirit of CCS which supports mobility ⇒ π -Calculus 12 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  16. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems II Example 8.1 (Dynamic access to resources) • Server S controls access to printer P • Client C wishes to use P 13 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  17. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems II Example 8.1 (Dynamic access to resources) • Server S controls access to printer P • Client C wishes to use P • In CCS: P and C must share some action name a ⇒ C could access P without being granted it by S 13 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  18. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems II Example 8.1 (Dynamic access to resources) • Server S controls access to printer P • Client C wishes to use P • In CCS: P and C must share some action name a ⇒ C could access P without being granted it by S • In π -Calculus: – initially only S has access to P (using link a ) – using another link b , C can request access to P 13 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

  19. Modelling Mobile Concurrent Systems Mobility in Concurrent Systems II Example 8.1 (Dynamic access to resources) • Server S controls access to printer P • Client C wishes to use P • In CCS: P and C must share some action name a ⇒ C could access P without being granted it by S • In π -Calculus: – initially only S has access to P (using link a ) – using another link b , C can request access to P • Formally: b � a � . S ′ � b ( c ) . c � d � . C ′ � a ( e ) . P ′ – a : link to P � �� � � �� � � �� � – b : link between S and C S C P – c : “placeholder” for a – d : data to be printed – e : “placeholder” for d 13 of 26 Concurrency Theory Winter Semester 2019/20 Lecture 8: The π -Calculus

Recommend


More recommend