coinductive program verification
play

Coinductive Program Verification Thesis Proposal Brandon Moore - PowerPoint PPT Presentation

Coinductive Program Verification Thesis Proposal Brandon Moore University of Illinois December 12, 2013 Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 1 / 58 Outline Introduction 1 Goals and


  1. Coinductive Program Verification Thesis Proposal Brandon Moore University of Illinois December 12, 2013 Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 1 / 58

  2. Outline Introduction 1 Goals and Motivation Operational Semantics Specifications as Reachability Approach 2 Reachability by Coinduction Coinduction with Derived Rules Higher-Order Specifications Proposed Work 3 Coinduction Principles Operational Semantics Automating Verification Validation Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 2 / 58

  3. Goal Program Verification for every language Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 3 / 58

  4. Goal Program Verification from (multi-step) Operational Semantics Always need executable semantics, to test formalization Can we avoid axiomatic semantics? Why operational? ◮ Denotational is a whole different story ◮ Don’t know how to handle big step Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 4 / 58

  5. Goal Program Verification from (multi-step) Operational Semantics Always need executable semantics, to test formalization Can we avoid axiomatic semantics? Why operational? ◮ Denotational is a whole different story ◮ Don’t know how to handle big step Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 4 / 58

  6. Goal Program Verification from (multi-step) Operational Semantics Always need executable semantics, to test formalization Can we avoid axiomatic semantics? Why operational? ◮ Denotational is a whole different story ◮ Don’t know how to handle big step Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 4 / 58

  7. Program verifiers should be at least certifying Certifying A certifying verifier produces a proof certificate along with claims Certified A certified verifier has a proof that it returns only true claims. Semantics in certificate language Translate specifications to claims about semantics Certificates are proofs claims are true Coq for certificate language, proof checker Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 5 / 58

  8. General Perspective Language independence by passing from syntax to extension ◮ Semantics, specifications, proof principles, etc. Truth/Proof as inclusion Coinduction Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 6 / 58

  9. Project Structure Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 7 / 58

  10. Operational semantics Definition An Operational Semantics is a set cfg of configurations and a one-step transition relation S ⊆ cfg × cfg Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 8 / 58

  11. A simple imperative language cfg = Stmt × ( Var ⇀ Z ), written � code , store � S contains steps like � while(n!=0) {s=s+n; n=n-1} , { s �→ 1 , n �→ 10 }� to � s=s+n; n=n-1; while(n!=0) {s=s+n; n=n-1} , { s �→ 1 , n �→ 10 }� Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 9 / 58

  12. Multiple Steps Transitive closure S ∗ takes multiple steps, e.g. � while(n!=0) {s=s+n; n=n -1}; x=s , { s �→ 1 , n �→ 10 , x �→ 0 }� to � x = s , { s �→ 56 , n �→ 10 , x �→ 1 }� Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 10 / 58

  13. Reachability Definition A configuration x ∈ cfg reaches a set P ⊆ cfg of configurations when x S ∗ y for some y ∈ P , or x diverges in S Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 11 / 58

  14. Reachability in Pictures Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 12 / 58

  15. Reachability from Hoare Triples Start with a standard Hoare Triple { s = s 0 , n = n 0 } while(n!=0) {s=s+n; n=n-1} { s = s 0 + � n 0 i =0 i } Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 13 / 58

  16. Drop special syntax for variables Ordinary predicates on store of configuration { store ( s ) = s 0 ∧ store ( n ) = n 0 } while(n!=0) {s=s+n; n=n-1} { store ( s ) = s 0 + � n 0 i =0 i } Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 14 / 58

  17. Drop special role of code Ordinary predicates on configuration γ { γ. store ( s ) = s 0 ∧ γ. store ( n ) = n 0 ∧ γ. code = while(n!=0) {s=s+n; n=n -1}; R } { γ. store ( s ) = s 0 + � n 0 i =0 i ∧ γ. code = R } Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 15 / 58

  18. Matching Logic Reachability Spec became a matching logic reachability property: ϕ ⇒ RL ϕ ′ ( ϕ, ϕ ′ predicates on cfg ) Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 16 / 58

  19. Back to Basic Reachability Expands to reachability claims ϕ ⇒ RL ϕ ′ iff � γ ⇒ { γ ′ | ∃ fv ( ϕ ′ ) \ fv ( ϕ ) , ϕ ′ ( γ ′ ) } � ∀ γ, ∀ fv ( ϕ ) , ϕ ( γ ) → Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 17 / 58

  20. Approach Specifications become sets of claims Proving sets of claims Coinduction Derived rules Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 18 / 58

  21. Truth as Set Definition Let claims = cfg ×P ( cfg ), naming the set of all reachability claims Definition Let reaches ⊆ claims be the set of true reachability claims, reaches = { ( x , P ) | x reaches P } Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 19 / 58

  22. Proof by Inclusion x ⇒ P for all ( x , P ) ∈ R iff R ⊆ reaches Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 20 / 58

  23. Inclusion by Coinduction Definition Given set A and function F : P ( A ) → P ( A ), X ⊆ A is F-stable if X ⊆ F ( X ) Coinduction If G is the greatest fixpoint of a monotone F , X ⊆ F ( X ) implies X ⊆ G Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 21 / 58

  24. Reachability as a Fixpoint reaches is the greatest fixpoint of step : P ( claims ) → P ( claims ) step [ R ] = done ∪ next [ R ] where done : P ( claims ), next : P ( claims ) → P ( claims ) done = { ( x , P ) | x ∈ P } next [ R ] = { ( x , P ) | ∃ y . x S y ∧ ( y , P ) ∈ R } (Proof) Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 22 / 58

  25. done in pictures ( a , P ) ∈ done ( b , P ) ∈ done ( c , P ) ∈ done ( d , P ) �∈ done ( a , Q ) �∈ done ( b , Q ) �∈ done ( c , Q ) ∈ done ( d , Q ) ∈ done Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 23 / 58

  26. next in pictures R Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 24 / 58

  27. next in pictures next [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 24 / 58

  28. next in pictures next [ next [ R ]] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 24 / 58

  29. Reachability as a Fixpoint reaches is the greatest fixpoint of step : P ( claims ) → P ( claims ) step [ R ] = done ∪ next [ R ] where done : P ( claims ), next : P ( claims ) → P ( claims ) done = { ( x , P ) | x ∈ P } next [ R ] = { ( x , P ) | ∃ y . x S y ∧ ( y , P ) ∈ R } Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 25 / 58

  30. Direct coinduction 1 Goal: d ⇒ P Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  31. Direct coinduction 1 Expand to stable set R Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  32. Direct coinduction 1 step [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  33. Direct coinduction 1 ( e , P ) ∈ done ⊆ step [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  34. Direct coinduction 1 ( e , P ) ∈ done ⊆ step [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  35. Direct coinduction 1 ( e , P ) ∈ R → ( d , P ) ∈ next [ R ] ⊆ step [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  36. Direct coinduction 1 ( e , P ) ∈ R → ( d , P ) ∈ next [ R ] ⊆ step [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 26 / 58

  37. Direct coinduction 2 Goal: a ⇒ P Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 27 / 58

  38. Direct coinduction 2 Expand to stable set R Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 27 / 58

  39. Direct coinduction 2 step [ R ] Brandon Moore (University of Illinois) Coinductive Program Verification December 12, 2013 27 / 58

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