automatic cyclic termination proofs for recursive
play

Automatic Cyclic Termination Proofs for Recursive Procedures in - PowerPoint PPT Presentation

Automatic Cyclic Termination Proofs for Recursive Procedures in Separation Logic Reuben Rowe, University of Kent, Canterbury James Brotherston, University College London CPP, Paris, France Monday 16 th January 2017 Automatically Proving


  1. Automatic Cyclic Termination Proofs for Recursive Procedures in Separation Logic Reuben Rowe, University of Kent, Canterbury James Brotherston, University College London CPP, Paris, France Monday 16 th January 2017

  2. Automatically Proving Termination: Challenges proc shuffle(x) { if x != nil { y := *x; reverse(y); shuffle(y); } } heap manipulation intermediate procedures recursion 1/12

  3. Automatically Proving Termination: Challenges proc shuffle(x) { if x != nil { y := *x; reverse(y); shuffle(y); } } heap manipulation intermediate procedures recursion 1/12

  4. Automatically Proving Termination: Challenges proc shuffle(x) { if x != nil { y := *x; reverse(y); shuffle(y); } } heap manipulation intermediate procedures recursion 1/12

  5. Automatically Proving Termination: Challenges proc shuffle(x) { if x != nil { y := *x; reverse(y); shuffle(y); } } heap manipulation intermediate procedures recursion 1/12

  6. Automatically Proving Termination using Cyclic Proof . • We use the Cyclist framework for automation/certifjcation (Axiom) (Axiom) (Axiom) • Following the approach of Brotherston et al. (POPL ’08) (Inference) 2/12 . . . . . . . • • · • · · • . . . . . · • • • · · · φ ⊢ C

  7. Automatically Proving Termination using Cyclic Proof (Inference) • We use the Cyclist framework for automation/certifjcation semantics total correctness (Axiom) (Axiom) (Axiom) • Following the approach of Brotherston et al. (POPL ’08) 2/12 . . . . . . . . • • · • · · • . . . . . · • • • · · · φ ⊢ C

  8. Automatically Proving Termination using Cyclic Proof (Inference) • We use the Cyclist framework for automation/certifjcation semantics total correctness Separation Logic (Axiom) (Axiom) (Axiom) • Following the approach of Brotherston et al. (POPL ’08) 2/12 . . . . . . . . • • · • · · • . . . . . · • • • · · · φ ⊢ C

  9. Automatically Proving Termination using Cyclic Proof (Inference) • We use the Cyclist framework for automation/certifjcation semantics total correctness Separation Logic (Axiom) • Following the approach of Brotherston et al. (POPL ’08) 2/12 . . . . . . . . • • · • · · • . . . . . · • • • · · · φ ⊢ C

  10. Automatically Proving Termination using Cyclic Proof (Inference) • We use the Cyclist framework for automation/certifjcation semantics total correctness for data Inductive Predicates Separation Logic (Axiom) • Following the approach of Brotherston et al. (POPL ’08) 2/12 . . . . . . . . • • · • · · • . . . . . · • • • · · · φ ⊢ C

  11. Automatically Proving Termination using Cyclic Proof (Inference) • We use the Cyclist framework for automation/certifjcation semantics total correctness for data Inductive Predicates Separation Logic (Axiom) • Following the approach of Brotherston et al. (POPL ’08) 2/12 . . . . . . . . • • · • · • . . . . . · · • • • · · · { φ } C { ψ }

  12. Automatically Proving Termination using Cyclic Proof . • We use the Cyclist framework for automation/certifjcation (Axiom) • Following the approach of Brotherston et al. (POPL ’08) (Inference) . 2/12 . . . . . . • • · • · • . . . . . · · • • • · · · { φ } C { ψ }

  13. Advantages of Using Cyclic Proof • Supports compositional reasoning • Naturally encapsulates inductive principles • Invariants can be discovered • Termination measures extracted automatically 3/12

  14. Advantages of Using Cyclic Proof • Supports compositional reasoning • Naturally encapsulates inductive principles • Invariants can be discovered • Termination measures extracted automatically 3/12

  15. Advantages of Using Cyclic Proof • Supports compositional reasoning • Naturally encapsulates inductive principles • Invariants can be discovered • Termination measures extracted automatically 3/12

  16. Advantages of Using Cyclic Proof • Supports compositional reasoning • Naturally encapsulates inductive principles • Invariants can be discovered • Termination measures extracted automatically 3/12

  17. y n is a single memory cell referenced by x x n describe specifjc structures Ingredients of Our Approach: Separation Logic x w v list z lseg x y nil z y e.g. lseg x y , list z • Symbolic heap syntax makes reasoning easier • Formulas of SL describe portions of the program memory • Predicates P x 1 pieces of memory B is the (separate) conjunction of two domain-disjoint • A y 1 • x • emp is the empty piece of memory 4/12

  18. y n is a single memory cell referenced by x x n describe specifjc structures Ingredients of Our Approach: Separation Logic x w v list z lseg x y nil z y e.g. lseg x y , list z • Symbolic heap syntax makes reasoning easier • Formulas of SL describe portions of the program memory • Predicates P x 1 pieces of memory B is the (separate) conjunction of two domain-disjoint • A y 1 • x • emp is the empty piece of memory 4/12

  19. x n describe specifjc structures Ingredients of Our Approach: Separation Logic x w v list z lseg x y nil z y • Symbolic heap syntax makes reasoning easier • Formulas of SL describe portions of the program memory e.g. lseg x y , list z • Predicates P x 1 pieces of memory B is the (separate) conjunction of two domain-disjoint • A • emp is the empty piece of memory 4/12 • x �→ ( y 1 , . . . , y n ) is a single memory cell referenced by x

  20. x n describe specifjc structures Ingredients of Our Approach: Separation Logic y w v list z lseg x y nil z • Symbolic heap syntax makes reasoning easier x • Formulas of SL describe portions of the program memory e.g. lseg x y , list z • Predicates P x 1 pieces of memory • emp is the empty piece of memory 4/12 • x �→ ( y 1 , . . . , y n ) is a single memory cell referenced by x • A ∗ B is the (separate) conjunction of two domain-disjoint

  21. Ingredients of Our Approach: Separation Logic y w v list z lseg x y nil z x • Formulas of SL describe portions of the program memory • Symbolic heap syntax makes reasoning easier pieces of memory • emp is the empty piece of memory 4/12 • x �→ ( y 1 , . . . , y n ) is a single memory cell referenced by x • A ∗ B is the (separate) conjunction of two domain-disjoint • Predicates P ( x 1 , . . . , x n ) describe specifjc structures e.g. lseg ( x , y ) , list ( z )

  22. Ingredients of Our Approach: Separation Logic • Formulas of SL describe portions of the program memory • emp is the empty piece of memory pieces of memory • Symbolic heap syntax makes reasoning easier 4/12 • x �→ ( y 1 , . . . , y n ) is a single memory cell referenced by x • A ∗ B is the (separate) conjunction of two domain-disjoint • Predicates P ( x 1 , . . . , x n ) describe specifjc structures e.g. lseg ( x , y ) , list ( z ) x = y ∧ z � = nil ∧ lseg ( x , y ) ∗ list ( z ) ∗ v �→ w

  23. Ingredients of our Approach: Symbolic Execution C proc ( x ) C ) (body proc C (proc) v x := * y ; C y ( x fresh) x v x y x v x x (load) 5/12 { φ } C { ψ } (free) : { φ ∗ x �→ y } free( x ); C { ψ }

  24. (proc) Ingredients of our Approach: Symbolic Execution C (body proc C ) proc ( x ) 5/12 { φ } C { ψ } (free) : { φ ∗ x �→ y } free( x ); C { ψ } { x = v [ x ′ / x ] ∧ ( φ ∗ y �→ v )[ x ′ / x ] } C { ψ } (load) : ( x ′ fresh) { φ ∗ y �→ v } x := * y ; C { ψ }

  25. Ingredients of our Approach: Symbolic Execution 5/12 { φ } C { ψ } (free) : { φ ∗ x �→ y } free( x ); C { ψ } { x = v [ x ′ / x ] ∧ ( φ ∗ y �→ v )[ x ′ / x ] } C { ψ } (load) : ( x ′ fresh) { φ ∗ y �→ v } x := * y ; C { ψ } { φ } C { ψ } (proc) : (body ( proc ) = C ) { φ } proc ( � x ) { ψ }

  26. Ingredients of our Approach: Inductive Predicates emp C x list C x list y x C nil • We support user-defjned inductive predicates, e.g. x • A logical rule schema allows case split C x list • Predicate labels identify termination measures, e.g. 6/12 x = nil ∧ emp x �→ y ∗ list ( y ) list ( x ) list ( x )

  27. Ingredients of our Approach: Inductive Predicates C C x list C x list y x emp • We support user-defjned inductive predicates, e.g. nil x • A logical rule schema allows case split • Predicate labels identify termination measures, e.g. 6/12 x = nil ∧ emp x �→ y ∗ list ( y ) list ( x ) list ( x ) { list α ( x ) ∗ φ } C { ψ }

  28. Ingredients of our Approach: Inductive Predicates • We support user-defjned inductive predicates, e.g. • Predicate labels identify termination measures, e.g. • A logical rule schema allows case split 6/12 x = nil ∧ emp x �→ y ∗ list ( y ) list ( x ) list ( x ) { list α ( x ) ∗ φ } C { ψ } { ( x = nil ∧ emp ) ∗ φ } C { ψ } { ( β < α ∧ x �→ y ∗ list β ( x )) ∗ φ } C { ψ } { list α ( x ) ∗ φ } C { ψ }

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