handling java s abrupt termination in a sequent calculus
play

Handling Javas Abrupt Termination in a Sequent Calculus for Dynamic - PowerPoint PPT Presentation

Handling Javas Abrupt Termination in a Sequent Calculus for Dynamic Logic Bernhard Beckert Bettina Sasse U NIVERSITY OF K ARLSRUHE I NSTITUTE FOR L OGIC , C OMPLEXITY AND D EDUCTION S YSTEMS i12www.ira.uka.de/ key VerifiCard Workshop


  1. Handling Java’s Abrupt Termination in a Sequent Calculus for Dynamic Logic Bernhard Beckert Bettina Sasse U NIVERSITY OF K ARLSRUHE I NSTITUTE FOR L OGIC , C OMPLEXITY AND D EDUCTION S YSTEMS i12www.ira.uka.de/ ˜key VerifiCard Workshop Marseille, January 2002 VerifiCard Workshop, Marseille, January 2002 – p.1

  2. Reasons for Limited Use of Verification No support for programming languages that are used in practice VerifiCard Workshop, Marseille, January 2002 – p.2

  3. Reasons for Limited Use of Verification No support for programming languages that are used in practice Verification requires knowledge in higher-order logic, tactic languages, etc. Verification is not integrated into standard CASE tools and software development processes VerifiCard Workshop, Marseille, January 2002 – p.2

  4. Reasons for Limited Use of Verification No support for programming languages that are used in practice Verification requires knowledge in higher-order logic, tactic languages, etc. Verification is not integrated into standard CASE tools and software development processes Verifier and software developer speak different languages VerifiCard Workshop, Marseille, January 2002 – p.2

  5. Central Paradigm of the KeY Project Formal methods must – and can – be integrated into commercially used methodologies, tools, and languages for software development VerifiCard Workshop, Marseille, January 2002 – p.3

  6. Central Paradigm of the KeY Project Formal methods must – and can – be integrated into commercially used methodologies, tools, and languages for software development Integrated tool for modelling formal specification verification of object-oriented programs (Java Card) VerifiCard Workshop, Marseille, January 2002 – p.3

  7. The KeY System extension for formal CASE Tool specification UML OCL Java Verification Component Dynamic Logic Deduction Component automated interactive counter examples VerifiCard Workshop, Marseille, January 2002 – p.4

  8. Dynamic Logic Transparency of rules and proofs Formulas contain programs Basic rules for each programming construct Rule application corresponds to symbolic execution VerifiCard Workshop, Marseille, January 2002 – p.5

  9. Dynamic Logic Transparency of rules and proofs Formulas contain programs Basic rules for each programming construct Rule application corresponds to symbolic execution Handling “real” object-oriented language Java Requires extensions and new concepts VerifiCard Workshop, Marseille, January 2002 – p.5

  10. Verification of Java Card: Difficulties Program state depends on the objects and their attributes Aliasing Polymorphism (dynamic binding) Evaluation of Java expressions may have side effects Programming constructs such as – abrupt termination (e.g. exceptions) – built-in data types (incl. arrays and strings) – initialisation of objects VerifiCard Workshop, Marseille, January 2002 – p.6

  11. Dynamic Logic Syntax � � Modal operators [ p ] and � � p � � for each program p Refer to the final state of p VerifiCard Workshop, Marseille, January 2002 – p.7

  12. Dynamic Logic Syntax � � Modal operators [ p ] and � � p � � for each program p Refer to the final state of p Semantics [ p ] F : If p terminates, then F holds in the final state (partial correctness) � � � p � � � F : p terminates and F holds in the final state (total correctness) VerifiCard Workshop, Marseille, January 2002 – p.7

  13. Expressivity of Dynamic Logic Hoare triple F → → → [ p ] G { F } p { G } the same as VerifiCard Workshop, Marseille, January 2002 – p.8

  14. ✏ � � ✠ ✟ ✝ ✞ ✝ ✆ ✁ ✁ ✆ � ✝ ✞ ✝ ✟ ✠ ✑ ✒ � ✏ ✝ ✝ Expressivity of Dynamic Logic Hoare triple F → → → [ p ] G { F } p { G } the same as Simple example ∀ ∀ n ( � ∀ � � � � � → → → n = ✡☞☛ = = ✂☎✄ ✌✎✍ � � � � � � ) n = = = ✡☞☛ ✂☎✄ ✌✎✍ VerifiCard Workshop, Marseille, January 2002 – p.8

  15. ✞ ✄ ✄ ☞ ☛ ✄ ✟ ☎ ✄ ✍ ✂ ✁ � ✌ ✍ ✡ ✌ Rule for if-else premisses Γ , b = Γ , b = ⊢ � � ⊢ � � ⊢ ⊢ � � p � � F ⊢ ⊢ � � q � � F ☎✝✆ ✞✠✟ = = = = Γ ⊢ ⊢ � ⊢ � � � � � F b p q conclusion VerifiCard Workshop, Marseille, January 2002 – p.9

  16. ✄ ✄ ✡ ✞ ✌ ✟ ☎ ✄ ✂ ✍ ✁ � ✌ ✍ ☞ ☛ ✄ Rule for if-else premisses new proof obligation Γ , b = Γ , b = ⊢ � � ⊢ � � ⊢ ⊢ � � p � � F ⊢ ⊢ � � q � � F ☎✝✆ ✞✠✟ = = = = Γ ⊢ ⊢ � ⊢ � � � � � F b p q conclusion old proof obligation VerifiCard Workshop, Marseille, January 2002 – p.9

  17. ✁ ✝ ✞ ✝ � ✁ ✞ � ✆ � � � � ✁ ✄ � ✂ ✁ ✂ � ✆ � � � ✝ ✡ ✁ � ✁ ✂ � ✡ ✂ ✂ ✄ ✆ ✄ ✄ ✆ ✟ ☎ Abrupt Termination in Java Reasons for abrupt termination } (with or w/o label) loop (current iteration) loop, , } (with or w/o label) labelled block - statement } exception (also: block, loop, method) method } (also: - , block, loop) VerifiCard Workshop, Marseille, January 2002 – p.10

  18. ✂ ☎ ✄ ✂ ☛ ✠ ✝ ✟ ✍ ✞ ✡ ✆✝ ✁ ✁ ✂ ✠ ☛ ✡ ✑ ✝ ✏ ✡ ✠ ✝ ✂ ✂ ✁ � ☎ ✆ ✄ ✁ ✄ ✑ Abrupt Termination in Java: Examples Loop terminated by ✌✎✍ VerifiCard Workshop, Marseille, January 2002 – p.11

  19. ✆ ✝ ✡ ✝ ✟ ✡ ✌ ✠ ☎ � � ✟ ☎ ✂ ✌ ✝ ✄ ✁ ✌ ✂ ✑ ✂ ✁ ✂ ✄ � ✂ ✝ ✟ ✟ ✂ ☎ ✡ ☛ � ✂ ☛ � � ✝ � ☎ ✡ ✂ ✆ ✞ ✞ ✞ ✍ ✞ ✄ ✆ � ✁ � ✁ ☛ ✡ ☎ ✟ ✌ ☎ ✁ ✠ ✆ � Abrupt Termination in Java: Examples - - with exception ✌✎✍ ✁✄✂ ✁ ✞✝ ✂ ✞✡ VerifiCard Workshop, Marseille, January 2002 – p.12

  20. Integrating Abrupt Termination into DL � � New semantics for � � p � � F : p terminates normally (not abruptly) and F holds in the final state There is no “return value” describing the reason for termination VerifiCard Workshop, Marseille, January 2002 – p.13

  21. ✂ ✞ ✄ ☎ ✁ ✁ ✞ � ✁ ✞ ✆ � ✆ � � ✝ ✞ ☎ ✡ ✞ ✡ ✝ ✆ ✟ ✆ ✡ � � ✝ ✆ ✝ ✡ ✞ ✄ � ✁ Possible Contexts of an Abrupt Termination method block statement , - , loops - - statement VerifiCard Workshop, Marseille, January 2002 – p.14

  22. ✍ ✡ ☞ ✝ ☛ ✄ ✞ ✡ ✝ ✆ ☞ ✆ ✞ ☛ ☎ ✡ ✄ ☛ ☞ ✌ ✍ ✌ Rule for while Loops Symbolic execution of one loop iteration Γ ⊢ ⊢ � � ⊢ � � � � F b p b p Γ ⊢ ⊢ � � ⊢ � � � � F b p VerifiCard Workshop, Marseille, January 2002 – p.15

  23. � ✆ ☛ ☎ ☞ ✌ ✆ ✍ ✍ ✄ ✡ ✁ ✄ ✄ ☎ ✄ ✞ ✆ ✝ ✡ ✞ ✄ ☛ ☎ ☞ ✌ ✆ ✍ ✄ ✁ ✁ ✄ ✡ ✄ ✆ ✂ � ✁ ✂ � ✡ ✂ ✂ ✄ ✁ � ✂ ☎ ✡ ✝ ☎ ☛ ✄ ☞ ✁ � ✌ ✄ � ✌ ✂ ✁ ✍ ✆ ✄ Rule for while Loops Symbolic execution of one loop iteration target Γ ⊢ ⊢ � � ⊢ � � � � F b l 1 l 2 p b p Γ ⊢ ⊢ � � ⊢ � � � � F b p target Construction of p ’ : l 1 → → l 2 VerifiCard Workshop, Marseille, January 2002 – p.15

  24. ✁ ✂ ✑ ✂ ☛ ✠ ✝ ✟ ✍ ✞ ✡ ✆✝ � ✁ ✠ ☛ ✂ ☎ ✄ ✡ ✝ ✏ ✡ ✠ ✝ ✂ ✂ ✁ ✑ Rule for while Loops: Example ✌✎✍    p VerifiCard Workshop, Marseille, January 2002 – p.16

  25. ✞ ✡ � ☛ ✄ ✞ ✡ ✝ ✆ ✍ ☎ ✆ ✆ ☎ ✂ � � ☎ ✆ ✄ ✁ ✄ ☞ ✄ � ✂ ✁ ✄ ✡ ✆ ✌ ☞ ✄ ✂ ✁ � ☛ ✄ ✞ ✡ ✝ ☛ ☞ ✡ ✂ ✂ � ✄ ☞ ✄ ✍ ✍ ✁ ✌ ✂ ☛ ☎ ✂ ✑ ✂ ☛ ✠ ✝ ✟ ✍ ✞ ✡ ✆✝ ✁ ✁ ✠ ☛ ✂ ☎ ✄ ✡ ✝ ✏ ✍ ✠ ✝ ✂ ✂ ✁ ✑ ☎ ☎ ✂ ✡ ✌ � ✁ ✞ ✌ � � ✞ ☞ ✄ ✁ ✆ � ☛ ☎ ✡ ✄ ✆ ☎ ☎ ✡ ✡ ✆ ✡ VerifiCard Workshop, Marseille, January 2002 – p.16 � F � � � F � � p Rule for while Loops: Example  p   � � ⊢ � ⊢ Γ ⊢ ✌✎✍ � � ⊢ � Γ ⊢ ⊢

  26. ✟ ✟ ✂ � ✄ ☎ ✟ ✡ ✡ � ☛ ✟ ✄ � ✡ ✡ ✍ � ✄ ✂ ✟ ✁ ✠ ✂ ☎ ✡ ✂ ✄ ✡ ✂ � ✂ ✄ ✁ ✁ ☎ ☛ ✌ ✡ ☎ ✌ Rule for Exception that is Caught Γ ⊢ Γ ⊢ ⊢ ⊢ instanceof ( exc , T ) ⊢ ⊢ � � � � � F � e exc q r ✌✎✍ Γ ⊢ ⊢ ⊢ � � � � � � F exc p T e q r ✌✎✍ VerifiCard Workshop, Marseille, January 2002 – p.17

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