Modeling and Analysis of Communicating Systems Lecture 5: Sequential Processes Jeroen Keiren and Mohammad Mousavi j.j.a.keiren@vu.nl and m.r.mousavi@hh.se Halmstad University March 2015
Outline Motivation Actions Multi-Actions Alternative and Sequential Composition Deadlock Conditional and Sum Operators 2 / 22
From Processes to Their Algebra Motivation in practice graphical representation is monstrously big Example 3 / 22
From Processes to Their Algebra Motivation in practice graphical representation is monstrously big manipulating and analyzing the graphical representation is virtually impossible Example 3 / 22
From Processes to Their Algebra Motivation in practice graphical representation is monstrously big manipulating and analyzing the graphical representation is virtually impossible Solution Use a compact textual presentation and algebraic rules for manipulating them 3 / 22
Outline Motivation Actions Multi-Actions Alternative and Sequential Composition Deadlock Conditional and Sum Operators 4 / 22
Actions Atomic building blocks of processes May represent: internal activities sending messages receiving messages the result of a synchronization May take parameters, typically denoted by a(d) (natural number, boolean, or any other Abstract Data Type) 5 / 22
Actions Examples act rcv coin: Euro; 6 / 22
Actions Examples act rcv coin: Euro; act snd number,rcv number: (instance: snd number(1)) Nat; 6 / 22
Actions Examples act rcv coin: Euro; act snd number,rcv number: Nat; (instance: snd number(1)) act ack number: Bool # Nat; 6 / 22
Actions Examples act rcv coin: Euro; act snd number,rcv number: Nat; (instance: snd number(1)) act ack number: Bool # Nat; Note actions are not functions (or procedures, in the programming languages sense) 6 / 22
Outline Motivation Actions Multi-Actions Alternative and Sequential Composition Deadlock Conditional and Sum Operators 7 / 22
Multi-Actions A number of actions happening at the same time Syntax: α ::= τ a a( d) α β, τ is the internal (invisible) action Auxiliary operators: Removal of multi-actions α \ β Inclusion between multi-action α β Stripping data off α 8 / 22
Multi-Actions Axioms (Part I: Basic axioms) MA1 α β = β α MA2 (α β) γ = α (β γ) MA3 α τ = α 9 / 22
Multi-Actions Axioms (Part II: Removal of multi-actions α \ β) MD1 τ \ α = τ MD2 α \ τ = α MD3 α \ (β γ) = (α \ β) \ γ MD4 (a(d) α) \ a(d) = α MD5 (a(d) α) \ b(e) = a(d) (α \ b(e)) if a b or d e 10 / 22
Multi-Actions Axioms (Part III: Inclusion between multi-action α β) MS1 τ α = true MS2 a τ = false MS3 a(d) α a(d) β = α β MS4 a(d) α b(e) β = a(d) (α \ b(e)) β if a b or d e 11 / 22
Multi-Actions Axioms (Part IV: Stripping data off α) MAN1 MAN2 MAN3 τ = τ a(d) = a α β = α β 12 / 22
Outline Motivation Actions Multi-Actions Alternative and Sequential Composition Deadlock Conditional and Sum Operators 13 / 22
Alternative composition Syntax: p + q Intuition: the process behaves as either p or q 14 / 22
Alternative composition Syntax: p + q Intuition: the process behaves as either p or q Axioms A1 A2 A3 x + y = y + x x + (y + z) = (x + y) + z x + x = x 14 / 22
Alternative composition Syntax: p + q Intuition: the process behaves as either p or q Axioms A1 A2 A3 x + y = y + x x + (y + z) = (x + y) + z x + x = x Write x y for x + y = y. 14 / 22
Sequential composition Syntax: p q Intuition: the process behaves as p and upon termination of p, as q. 15 / 22
Sequential composition Syntax: p q Intuition: the process behaves as p and upon termination of p, as q. Axioms A4 A5 (x + y) z = x z + y z (x y) z = x (y z) 15 / 22
Outline Motivation Actions Multi-Actions Alternative and Sequential Composition Deadlock Conditional and Sum Operators 16 / 22
(Delayable) Deadlock Syntax: δ Intuition: a process that cannot do anything but let time pass 17 / 22
(Delayable) Deadlock Syntax: δ Intuition: a process that cannot do anything but let time pass Axioms A6 A7 x + δ = x δ x = δ 17 / 22
Outline Motivation Actions Multi-Actions Alternative and Sequential Composition Deadlock Conditional and Sum Operators 18 / 22
Conditional operator Syntax: c p q, where c is of type Bool Intuition: behave as p if c is true, or otherwise, behave as q 19 / 22
Conditional operator Syntax: c p q, where c is of type Bool Intuition: behave as p if c is true, or otherwise, behave as q Axioms Cond1 Cond2 THEN true x y = x false x y = y c x = c x δ 19 / 22
Sum operator Syntax: d:d p(d) Intuition: generalization of alternative composition (may behave as p(d), for each value d of type D) 20 / 22
Sum operator Syntax: d:d p(d) Intuition: generalization of alternative composition (may behave as p(d), for each value d of type D) Axioms SUM1 SUM3 SUM4 SUM5 d:d x = x d:d X (d) = X(e) + d:d X (d) d:d (X (d) + Y (d)) = d:d X (d) + d:d Y (d) ( d:d X (d)) y = d:d X (d) y 20 / 22
Recursion Define set of equations with variables as left hand side: P = x where x a process, that can refer to variables such as P allows definition of infinite processes can store data in parameters 21 / 22
Summary & Exercises Sequential processes: (Multi-)actions Sequential composition Alternative composition Conditions Alternative quantification Recursion Exercises: 4.2.3, 4.3.1-4.3.2, 4.4.1, 4.5.1-4.5.2, 4.6.1, 4.7.1-4.7.2, 4.8.1 22 / 22