mcgill university
play

McGill University 1 COMP 763 OVERVIEW In the context In - PowerPoint PPT Presentation

COMP 763 Eugene Syriani Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science McGill University 1 COMP 763 OVERVIEW In the context In Theory: Timed Automata The language: Definitions and


  1. COMP 763 Eugene Syriani Ph.D. Student in the Modelling, Simulation and Design Lab School of Computer Science McGill University 1

  2. COMP 763 OVERVIEW  In the context  In Theory: Timed Automata – The language: Definitions and Semantics – Model Checking and Implementation  In Practice: UPPAAL – Language Extensions – Simulation and Verification  Case Study  Conclusion on the tool and on the language 2

  3. COMP 763 IN THE CONTEXT sala University (Sweden) + borg University (Denmark) =============================== (SweDen) Paul Petterson Wang Yi Kim G. Larsen Uppsala Uppsala Aalborg 3

  4. COMP 763 IN THE CONTEXT • First released in 1995 • Power Tool: environment for modelling, simulation and verification of real-time systems • Types of System: non-deterministic processes with finite control structure and real-valued clocks • Typical Applications: real-time controllers and communication protocols, where time is critical 4

  5. COMP 763 IN THE CONTEXT The Technology • Efficient model-checker with on-the-fly searching technique • Efficient verification with symbolic technique manipulation and solving of constraints • Facilitate modelling and debugging with automatic generation of diagnostic traces explaining the satisfaction of a property • Visual (graphical) tracing through the simulator 5

  6. COMP 763 OVERVIEW  In the context  In Theory: Timed Automata – The language: Definitions and Semantics – Model Checking and Implementation  In Practice: UPPAAL – Language Extensions – Simulation and Verification  Case Study  Conclusion on the tool and on the language 6

  7. COMP 763 IN THEORY: TIMED AUTOMATA [1] • Theory for modeling and verification of real time systems • Other formalisms: – Timed Petri Nets [5] – Timed Process Algebras [6,7,8] – Real Time Logics [9,10] • Model checkers built with timed automata: – UPPAAL – Kronos [11] [1] R. Alur and D. L. Dill. A theory of timed automata. Journal of Theoretical Computer Science, 126(2):183 – 235, 1994. 7

  8. COMP 763 IN THEORY: TIMED AUTOMATA Evolution • Infinite alphabet • Büchi-accepting • Clock variables • Initial and accepting • Real-valued variables: • Local invariant conditions • Accept when invariant is states modelling clock • Accept execution if pass • Constraints on clock satisfied through accepting state variables and resets infinitely many times typedef TimedSafetyAutomata TimedAutomata [2] W. Thomas. Automata on infinite objects, in Van Leeuwen, Handbook of Theoretical Computer Science , pp. 133-164, Elsevier, 1990. 8

  9. COMP 763 IN THEORY: TIMED AUTOMATA Behaviour • Variables model logical clocks in the system – Initialized to 0 – Increase synchronously at the same rate • Taking transition (delay or action) – Necessary condition: clocks values satisfy guard on edge – Action: clocks may be reset to 0 9

  10. COMP 763 IN THEORY: TIMED AUTOMATA Formal Definition 𝑴 , 𝒎 𝟏 , 𝐅 , 𝐉 A timed automaton is a tuple where: 𝑴 is a finite set of locations • 𝒎 𝟏 ∈ 𝑴 is the initial location • 𝑭  𝑴 × 𝕮 𝑫 ×  × 𝟑 𝑫 × 𝑴 is the set of edges • • 𝑱 : 𝑴 → 𝕮 𝑫 is the function mapping locations to invariants on the clock elements 10

  11. COMP 763 IN THEORY: TIMED AUTOMATA Formal Semantics Operational Semantics of a timed automaton is: If 𝒗 , 𝒗 + 𝒆 ∈ 𝑱 𝒎 and 𝒆 ∈ ℝ + , • 𝒆 then 𝒎 , 𝒗 → 𝒎 , 𝒗 + 𝒆 𝝊 , 𝜷 , 𝒔 𝒎′ , 𝒗 ∈ 𝒉 , 𝒗 ′ = 𝒔 ↦ 𝟏 𝒗 and 𝒗′ ∈ 𝑱 𝒎 , If 𝒎 • 𝜷 then 𝒎 , 𝒗 → 𝒎′ , 𝒗′ 𝒎 , 𝒗 is a state • Notation: 𝜷 𝒎 , 𝒗 → 𝒎′ , 𝒗′ is a transition 11

  12. COMP 763 OVERVIEW  In the context  In Theory: Timed Automata – The language: Definitions and Semantics – Model Checking and Implementation  In Practice: UPPAAL – Language Extensions – Simulation and Verification  Case Study  Conclusion on the tool and on the language 12

  13. COMP 763 IN THEORY: TIMED AUTOMATA Model Checking • Reachability analysis: – Safety: “something bad never happens” – Liveness: “something good will eventually happen”  loop detection 13

  14. COMP 763 IN THEORY: TIMED AUTOMATA Model Checking • The state space of a timed model can be represented by a zone graph (efficient region graph) • A zone is the maximal set of clock assignment solution of clock constraints • Zone graphs can be infinite: widening operation • Zone graphs can be normalized to a canonical representation 14

  15. COMP 763 IN THEORY: TIMED AUTOMATA Model Checking and Implementations • Zones can be efficiently represented in memory as Difference Bound Matrices (DBM) [3] • DBM store clock constraints in canonical form Clock 𝒉 ∈ 𝕮 𝑫 constraint is • 𝒉 ∷ = 𝒚 ~ 𝒏 | 𝒚 − 𝒛 ~ 𝒐 | 𝒉 ∧ 𝒉 where 𝒚 , 𝒛 ∈ 𝑫 , 𝒏 , 𝒐 ∈ ℕ and ~ ∈ ≤ , <, =, >, ≥ [3] J. Bengtsson and W. Yi . Timed Automata: Semantics, Algorithms and Tools. In Lecture Notes on Concurrency and Petri Nets . W. Reisig and G. 15 Rozenberg (eds.), LNCS 3098, Springer-Verlag, 2004.

  16. COMP 763 IN THEORY: TIMED AUTOMATA Model Checking and Implementations • DBM will represent any clock constraint of a zone as:  If 𝒚 𝒋 − 𝒚 𝒌 ~ 𝒐 ∈ 𝑬 , then 𝑬 𝒋𝒌 = ~, 𝒐  If 𝒚 𝒋 − 𝒚 𝒌 is unbounded, then 𝑬 𝒋𝒌 = ∞  Add 𝑬 𝒋𝒋 = ≤ , 𝟏 and 𝑬 𝟏𝒋 = ≤ , 𝟏 16

  17. COMP 763 IN THEORY: TIMED AUTOMATA Model Checking and Implementations 𝑬 = 𝒚 − 𝟏 < 𝟑𝟏 ∧ 𝒛 − 𝟏 ≤ 𝟑𝟏 ∧ 𝒛 − 𝒚 ≤ 𝟐𝟏 ∧ 𝒚 − 𝒛 ≤ −𝟐𝟏 ∧ 𝟏 − 𝒜 < 𝟔 𝟏 , ≤ 𝟏 , ≤ 𝟏 , ≤ 𝟔 , < 𝟑𝟏 , ≤ 𝟏 , ≤ −𝟐𝟏 , ≤ ∞ 𝑵 𝑬 = 𝟑𝟏 , ≤ 𝟐𝟏 , ≤ 𝟏 , ≤ ∞ 𝟏 , ≤ ∞ ∞ ∞ 17

  18. COMP 763 IN THEORY: TIMED AUTOMATA Model Checking and Implementations • Operations on DBMs: 1. 𝒅𝒑𝒐𝒕𝒋𝒕𝒖𝒇𝒐𝒖 ( 𝑬 ) : checks if a DBM is consistent, a non-empty solution set. Used for removing inconsistent states from an exploration (negative cycles). 2. 𝒔𝒇𝒎𝒃𝒖𝒋𝒑𝒐 ( 𝑬 , 𝑬′ ) : checks if 𝑬 ⊆ 𝑬′ . Used for combined inclusion checking. 3. 𝒕𝒃𝒖𝒋𝒕𝒈𝒋𝒇𝒆 ( 𝑬 , 𝒚 𝒋 − 𝒚 𝒌 ≤ 𝒏 ) : checks if a zone satisfies a certain condition. 4. 𝒗𝒒 ( 𝑬 ) : computes the strongest post-condition of a zone. 5. 𝒆𝒑𝒙𝒐 ( 𝑬 ) : computes the weakest pre-condition of a zone. 6. 𝒃𝒐𝒆 ( 𝑬 , 𝒚 𝒋 − 𝒚 𝒌 ≤ 𝒏 ) : add a constraint to a zone. 7. 𝒈𝒔𝒇𝒇 ( 𝑬 , 𝒚 ) : remove all conditions on a clock in a zone. 8. 𝒔𝒇𝒕𝒇𝒖 ( 𝑬 , 𝒚 ≔ 𝒏 ) : set the clock to a specific value. 9. 𝒅𝒑𝒒𝒛 ( 𝑬 , 𝒚 ≔ 𝒛 ) : copy the value of one clock into another. 10. 𝒕𝒊𝒋𝒈𝒖 ( 𝑬 , 𝒚 ≔ 𝒚 + 𝒏 ) : add or subtract a clock with an integer value. 18

  19. COMP 763 OVERVIEW  In the context  In Theory: Timed Automata – The language: Definitions and Semantics – Model Checking and Implementation  In Practice: UPPAAL – Language Extensions – Simulation and Verification  Case Study  Conclusion on the tool and on the language 19

  20. COMP 763 IN PRACTICE: UPPAAL UPPAAL, The Tool [4,5] [4] G. Behrmannet al. Uppaal Implementation Secrets. In Proceedings of the 7th International Symposium on Formal Techniques in Real-Time and Fault Tolerant Systems, 2002. [5] G. Behrmann, A. David, and K. G. Larsen. A Tutorial on Uppaal. In proceedings of the 4th International School on Formal Methods for the Design of Computer, Communication, and 20 Software Systems . LNCS 3185.

  21. COMP 763 IN PRACTICE: UPPAAL Language Extensions • Typed variables: – Integer – Clock – Channel – Constant – Scalar (set) – Array – Meta-variable – Record variable: structure 21

  22. COMP 763 IN PRACTICE: UPPAAL Language Extensions: A C syntax • Functions (typed and untyped) • For/While/Do loops, If-Else statements • Operators – All C operators: comparison, mathematical, assignment – Wrapper operators: min, max, and , or , not , imply – Quantifier: forall , exists 22

  23. COMP 763 IN PRACTICE: UPPAAL Language Extensions • Template: extended time automaton – Locations (extended) – Edges (extended) – Declarations – Parameters 23

  24. COMP 763 IN PRACTICE: UPPAAL Location • Invariant • Initial • Urgent – Atomic: freeze time • Committed – Urgent + Highest priority 24

  25. COMP 763 IN PRACTICE: UPPAAL Edge • Guard – Edge is enabled iff its guard is true • Update – Assignment – State of the system changed only on transition execution • Synchronization – Over channel with the same name • Selection – Non-deterministic binding of variable over a range 25

  26. COMP 763 IN PRACTICE: UPPAAL Synchronization • Edge labelled ch! (emitter) synchronizes with edge labelled ch? (receiver) • Binary: pair of channels chosen non-deterministically • Broadcast: emitter channel synchs with all receiver channels. Not blocking • Urgent: no delay, no time constraint 26

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