linear temporal logic critical sections and promela
play

Linear Temporal Logic, Critical Sections and Promela Modelling Dr. - PowerPoint PPT Presentation

Linear Temporal Logic Promela Critical Sections Linear Temporal Logic, Critical Sections and Promela Modelling Dr. Liam OConnor University of Edinburgh LFCS (and UNSW) Term 2 2020 1 Linear Temporal Logic Promela Critical Sections Where


  1. Linear Temporal Logic Promela Critical Sections Linear Temporal Logic, Critical Sections and Promela Modelling Dr. Liam O’Connor University of Edinburgh LFCS (and UNSW) Term 2 2020 1

  2. Linear Temporal Logic Promela Critical Sections Where are we? Last Lecture We saw how to treat the semantics of concurrent programs and the properties they should satisfy. This Lecture We will give a syntactic way to specify properties (Temporal Logic) and introduce one of two methods we will cover to show properties hold (Model Checking) using the famous Critical Section problem. 2

  3. Linear Temporal Logic Promela Critical Sections Logic We typically state our requirements with a logic. 3

  4. Linear Temporal Logic Promela Critical Sections Logic We typically state our requirements with a logic. Definition A logic is a formal language designed to express logical reasoning. Like any formal language, logics have a syntax and semantics. 4

  5. Linear Temporal Logic Promela Critical Sections Logic We typically state our requirements with a logic. Definition A logic is a formal language designed to express logical reasoning. Like any formal language, logics have a syntax and semantics. Example (Propositional Logic Syntax) A set of atomic propositions P = { a , b , c , . . . } An inductively defined set of formulae: Each p ∈ P is a formula. If P and Q are formulae, then P ∧ Q is a formula. If P is a formula, then ¬ P is a formula. (Other connectives are just sugar for these, so we omit them) 5

  6. Linear Temporal Logic Promela Critical Sections Semantics 6

  7. Linear Temporal Logic Promela Critical Sections Semantics Semantics are a mathematical representation of the meaning of a piece of syntax. There are many ways of giving a logic semantics, but we will use models. 7

  8. Linear Temporal Logic Promela Critical Sections Semantics Semantics are a mathematical representation of the meaning of a piece of syntax. There are many ways of giving a logic semantics, but we will use models. Example (Propositional Logic Semantics) A model for propositional logic is a valuation V ⊆ P , a set of “true” atomic propositions. We can extend a valuation over an entire formula, giving us a satisfaction relation: V | = p ⇔ p ∈ V V | = ϕ ∧ ψ ⇔ V | = ϕ and V | = ψ V | = ¬ ϕ ⇔ V �| = ϕ We read V | = ϕ as V “satisfies” ϕ . 8

  9. Linear Temporal Logic Promela Critical Sections LTL Linear temporal logic (LTL) is a logic designed to describe linear time properties. Linear temporal logic syntax We have normal propositional operators: p ∈ P is an LTL formula. If ϕ, ψ are LTL formulae, then ϕ ∧ ψ is an LTL formula. If ϕ is an LTL formula, ¬ ϕ is an LTL formula. 9

  10. Linear Temporal Logic Promela Critical Sections LTL Linear temporal logic (LTL) is a logic designed to describe linear time properties. Linear temporal logic syntax We have normal propositional operators: p ∈ P is an LTL formula. If ϕ, ψ are LTL formulae, then ϕ ∧ ψ is an LTL formula. If ϕ is an LTL formula, ¬ ϕ is an LTL formula. We also have modal or temporal operators: If ϕ is an LTL formula, then ◦ ϕ is an LTL formula. If ϕ , ψ are LTL formulae, then ϕ U ψ is an LTL formula. 10

  11. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ 11

  12. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • 12

  13. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ◦ ¬ • ◦• ◦• ◦• ◦ ¬ • ?? 13

  14. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 14

  15. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 15

  16. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 16

  17. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 17

  18. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 18

  19. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 19

  20. Linear Temporal Logic Promela Critical Sections LTL Semantics in Pictures σ { • } { • } { • } { • } { • } ∅ ¬ • , ¬ • ¬ • , • • , ¬ • • , ¬ • • , ¬ • ¬ • , • ¬ ( φ U ψ ) φ U ψ φ U ψ φ U ψ φ U ψ φ U ψ 20

  21. Linear Temporal Logic Promela Critical Sections LTL Semantics Let σ = σ 0 σ 1 σ 2 σ 3 σ 4 σ 5 . . . be a behaviour. Then define notation: σ | 0 = σ σ | 1 = σ 1 σ 2 σ 3 σ 4 σ 5 . . . σ | n +1 = ( σ | 1 ) | n 21

  22. Linear Temporal Logic Promela Critical Sections LTL Semantics Let σ = σ 0 σ 1 σ 2 σ 3 σ 4 σ 5 . . . be a behaviour. Then define notation: σ | 0 = σ σ | 1 = σ 1 σ 2 σ 3 σ 4 σ 5 . . . σ | n +1 = ( σ | 1 ) | n Semantics The models of LTL are behaviours. For atomic propositions, we just look at the first state. We often identify states with the set of atomic propositions they satisfy. σ | ⇔ p ∈ σ 0 = p 22

  23. Linear Temporal Logic Promela Critical Sections LTL Semantics Let σ = σ 0 σ 1 σ 2 σ 3 σ 4 σ 5 . . . be a behaviour. Then define notation: σ | 0 = σ σ | 1 = σ 1 σ 2 σ 3 σ 4 σ 5 . . . σ | n +1 = ( σ | 1 ) | n Semantics The models of LTL are behaviours. For atomic propositions, we just look at the first state. We often identify states with the set of atomic propositions they satisfy. σ | ⇔ p ∈ σ 0 = p σ | = ϕ ∧ ψ ⇔ σ | = ϕ and σ | = ψ σ | = ¬ ϕ ⇔ σ �| = ϕ 23

  24. Linear Temporal Logic Promela Critical Sections LTL Semantics Let σ = σ 0 σ 1 σ 2 σ 3 σ 4 σ 5 . . . be a behaviour. Then define notation: σ | 0 = σ σ | 1 = σ 1 σ 2 σ 3 σ 4 σ 5 . . . σ | n +1 = ( σ | 1 ) | n Semantics The models of LTL are behaviours. For atomic propositions, we just look at the first state. We often identify states with the set of atomic propositions they satisfy. σ | ⇔ p ∈ σ 0 = p σ | = ϕ ∧ ψ ⇔ σ | = ϕ and σ | = ψ σ | = ¬ ϕ ⇔ σ �| = ϕ = ◦ ϕ σ | ⇔ σ | 1 | = ϕ 24

  25. Linear Temporal Logic Promela Critical Sections LTL Semantics Let σ = σ 0 σ 1 σ 2 σ 3 σ 4 σ 5 . . . be a behaviour. Then define notation: σ | 0 = σ σ | 1 = σ 1 σ 2 σ 3 σ 4 σ 5 . . . σ | n +1 = ( σ | 1 ) | n Semantics The models of LTL are behaviours. For atomic propositions, we just look at the first state. We often identify states with the set of atomic propositions they satisfy. σ | ⇔ p ∈ σ 0 = p σ | = ϕ ∧ ψ ⇔ σ | = ϕ and σ | = ψ σ | = ¬ ϕ ⇔ σ �| = ϕ = ◦ ϕ σ | ⇔ σ | 1 | = ϕ σ | = ϕ U ψ ⇔ There exists an i such that σ | i | = ψ and for all j < i , σ | j | = ϕ We say P | = ϕ iff ∀ σ ∈ � P � . σ | = ϕ . 25

  26. Linear Temporal Logic Promela Critical Sections Derived Operators The operator � ϕ (“finally” or “eventually”) says that ϕ will be true at some point. The operator � ϕ (“globally” or “always”) says that ϕ is always true from now on. Exercise Give the semantics of � and � . Define � and � in terms of other operators. 26

  27. Linear Temporal Logic Promela Critical Sections More Exercises Let ρ be this behaviour: • • • •• •• •• · · · = • ? ρ |

  28. Linear Temporal Logic Promela Critical Sections More Exercises Let ρ be this behaviour: • • • •• •• •• · · · = • ? ρ | = • ? ρ |

  29. Linear Temporal Logic Promela Critical Sections More Exercises Let ρ be this behaviour: • • • •• •• •• · · · = • ? ρ | = • ? ρ | = ◦ • ? ρ |

  30. Linear Temporal Logic Promela Critical Sections More Exercises Let ρ be this behaviour: • • • •• •• •• · · · = • ? ρ | = • ? ρ | = ◦ • ? ρ | = � • ? ρ |

  31. Linear Temporal Logic Promela Critical Sections More Exercises Let ρ be this behaviour: • • • •• •• •• · · · = • ? ρ | = • ? ρ | = ◦ • ? ρ | = � • ? ρ | = � ( • ∧ ¬ • )? ρ | 3 |

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