algebraic frameworks for probabilistic and concurrent
play

Algebraic Frameworks for Probabilistic and Concurrent Systems - PowerPoint PPT Presentation

Algebraic Frameworks for Probabilistic and Concurrent Systems Tahiry Rabehaja Supervisor: A/Prof Annabelle McIver Department of Computing Macquarie University June 13, 2012 Why algebra? Formal modelling: understanding how to design


  1. Algebraic Frameworks for Probabilistic and Concurrent Systems Tahiry Rabehaja Supervisor: A/Prof Annabelle McIver Department of Computing Macquarie University June 13, 2012

  2. Why algebra? ◮ Formal modelling: understanding how to design correct computer systems. ◮ Formal verification: prove correctness mathematically.

  3. Why algebra? ◮ Formal modelling: understanding how to design correct computer systems. ◮ Formal verification: prove correctness mathematically. ◮ Algebra of programs: programs are mathematical object with their own theory. ◮ Algebras abstract complex interaction: more centred on structural properties. ◮ Algebras have simple and elegant proof systems. ◮ Model of executions in a first-order system: automated correctness proofs. → Study the algebras of probabilistic and concurrent systems.

  4. � � � � � A Simple Example Assume a Probabilistic Vending Machine M : accept a coin flip a fair coin � � � enable coffee if tail enable tea if head � � � � � � � � � � � � Assume a user U who wants tea : insert a coin choose tea (if enabled)

  5. A Simple Example The system: U run “concurrently” with M . The property: U drinks tea with “probability at least” 1 / 2. Goal: Show that the system satisfies the property using algebras .

  6. A Simple Example The system: U run “concurrently” with M . The property: U drinks tea with “probability at least” 1 / 2. Goal: Show that the system satisfies the property using algebras . Tools (algebraic): ◮ probabilistic Kleene algebra: No concurrency . ◮ concurrent Kleene algebra: No probability . Algebra that captures probability and concurrency?

  7. Nondeterminism ◮ Nondeterminism +: ◮ unpredictable and “unquantifiable” choice, ◮ can be used to model conditional in presence of guards . ◮ ex: τ h · tea + τ t · coffee - where · is sequential execution, - and τ h and τ t are internal actions and act as guards.

  8. Nondeterminism: Algebraic Properties ◮ Usual properties of choice operator: ◮ idempotence: x + x = x , ◮ commutativity: x + y = y + x , ◮ associativity: x + ( y + z ) = ( x + y ) + z , ◮ . . . ◮ Interaction with other operators: ◮ distribution of sequential: ◮ x · ( y + z ) = x · y + x · z ◮ ( x + y ) · z = x · z + y · z

  9. Probability Probabilistic choice: unpredictable but quantifiable choice. ◮ Explicit: From a state s do an action a and go to a distribution of states: a � 1 2 δ s 1 + 1 s 2 δ s 2 ◮ Implicit: From a state s do a probabilistic action: flip 1 � s 1 2 s ◮ ex: 2 · ( τ h · tea + τ t · coffee ) flip 1

  10. Probability: Algebraic Properties Algebraic properties of p ⊕ : ◮ Explicit: ◮ quasi-commutativity: x p ⊕ y = y 1 − p ⊕ x , ◮ distributivity: x p ⊕ ( y + z ) = x p ⊕ y + x p ⊕ z , ◮ . . . ◮ Implicit: ◮ sub-distributivity: x · y + x · z ≤ x · ( y + z ) where x ≤ y x + y = y . iff The inequality is strict if x contains probability.

  11. Concurrency ◮ True-Concurrency: ◮ Concurrency is realised from independent and non-conflicting events. ◮ Interleaving: ◮ Concurrency is reduced to nondeterminism over all possible sequentialisations. → Concentrate on the Interleaving approach in the model. ◮ ex: the Probabilistic Vending Machine and User are M = coin · flip 1 2 · ( τ h · tea + τ t · coffee ) and U = coin · tea The system is M A � U where A = { coin , tea , coffee } .

  12. � � � � � � � � Concurrency: Algebraic Properties Algebraic properties of � (frame set A is left implicit). ◮ Self restriction: ◮ commutativity: x � y = y � x , ◮ associativity: x � ( y � z ) = ( x � y ) � z , ◮ . . . ◮ Interactions with other operators: ◮ distributivity: x � ( y + z ) = x � y + x � z , ◮ exchange law: ( x � u ) · ( y � v ) ≤ ( x · y ) � ( u · v ), � u x x u � � � � � � � � � � � � � � � � � � v � � y � y � v

  13. Proving M � U Satisfies the Specification Algebraic properties of the system: ◮ Synchronisation: a � a = a for a ∈ { coin , tea , coffee } , ◮ When a chosen action is not enabled, go away: tea � coffee = 1 where 1 is the ineffectual process ( Skip ). Theorem We have coin · flip 1 2 · ( τ h · tea + τ t ) ≤ M � U. Proof. Key ingredient: exchange law and monotonicity. → Use automated tools (Prover9, Isabelle/HOL,. . . ) In the left hand side, tea is enabled with probability at least 1 / 2.

  14. The Algebra Finite iteration: Kleene star ◮ is a (left) fixed point: x ∗ = 1 + x · x ∗ , ◮ is the least one: 1 + x · y = y ⇒ x ∗ ≤ y . weak concurrent Kleene algebra: ◮ Signature: ( K , + , · , � , ∗ , 0 , 1) ◮ 1 ineffectual process 1 · x = x · 1 = 1, ◮ 0 is the most deterministic process: 0 + x = x , → Probability is implicit! ◮ Axiom system: specific set of axioms derived from probabilistic and concurrent Kleene algebras.

  15. Other Applications ◮ Hoare Calculus: p { x } q ⇔ p · x ≤ q where p , q are pre/post-computation. ex: p { x } q ∧ q { y } q ′ p { x · y } q ′ ◮ Rely/Guarantee Calculus: pr { x } gq ⇔ p { r � x } q ∧ x ≤ g where r , g are invariants. ex: pr { x } gq ∧ p ′ r ′ { x ′ } g ′ q ′ ∧ g ′ ≤ r ∧ g ≤ r ′ ( p ⊓ p ′ )( r ⊓ r ′ ) { x � x ′ } ( g � g ′ )( q ⊓ q ′ ) provided that q ⊓ q ′ exists.

  16. Models and Soundness How do we ensure that the axiom system is consistent i.e. we will not derive any contradiction from the axiom system?

  17. � � Models and Soundness How do we ensure that the axiom system is consistent i.e. we will not derive any contradiction from the axiom system? Build mathematical models: ◮ Set of automata: ( P , − → , i , F ) ex: automaton that does an action flip p followed by b , with probability p , and c , with probability 1 − p , is b � s 3 s 2 � � τ p � � � � � flip p � s 1 � ⊲ s 0 � � � � � � τ 1 − p � � c � s 5 s 4

  18. � Models and Soundness Let P , Q be the sets of states of two automata. ◮ Rooted η -simulation equivalence: R ⊆ P × Q ◮ Initiality: ( i P , i Q ) ∈ R , ◮ Inductiveness: R � t s t 1 a s ′ t ′ ◮ Finality: ( s , t ) ∈ R ∧ s ∈ F P ⇒ t ∈ F Q , ◮ Rootedness: ( i P , t ) ∈ R ⇒ t = i Q .

  19. � � � � � � � � � � Models and Soundness Let P , Q be the sets of states of two automata. ◮ Rooted η -simulation equivalence: R ⊆ P × Q ◮ Initiality: ( i P , i Q ) ∈ R , ◮ Inductiveness: R R s t R R τ τ t 1 a a a R R � t ′ s ′ ◮ Finality: ( s , t ) ∈ R ∧ s ∈ F P ⇒ t ∈ F Q , ◮ Rootedness: ( i P , t ) ∈ R ⇒ t = i Q .

  20. Models and Soundness ◮ Programs are interpreted as (rooted and reachable) automata. ◮ x = y means there are simulations from x to y and y to x . Theorem (Soundness) The set of automata modulo rooted η -simulation equivalence forms a weak concurrent Kleene algebra. This model ◮ insures consistency, ◮ provides a specification language.

  21. Summary ◮ The algebra abstracts complex interactions into algebraic expressions: ◮ synchronisation/concurrency is resolved with exchange law and distributivity, ◮ existence of probabilities are abstracted. ◮ . . . ◮ Use of Automated Tools. ◮ The model insures consistency. ◮ The model can be used as a specification language (though probability is implicit).

  22. Summary ◮ The algebra abstracts complex interactions into algebraic expressions: ◮ synchronisation/concurrency is resolved with exchange law and distributivity, ◮ existence of probabilities are abstracted. ◮ . . . ◮ Use of Automated Tools. ◮ The model insures consistency. ◮ The model can be used as a specification language (though probability is implicit). ◮ Outlook: ◮ deeper understanding of the use of the algebra to Rely/Guarantee calculus. ◮ construction of fully probabilistic models. ◮ construction of “true-concurrency” models.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend