better termination proving through cooperation
play

Better termination proving through cooperation Marc Brockschmidt 1 - PowerPoint PPT Presentation

Better termination proving through cooperation Marc Brockschmidt 1 Byron Cook 2 , 3 Carsten Fuhs 3 1 RWTH Aachen University 2 Microsoft Research Cambridge 3 University College London Deduktionstreffen 2013 Termination Analysis: Invariants and Rank


  1. Better termination proving through cooperation Marc Brockschmidt 1 Byron Cook 2 , 3 Carsten Fuhs 3 1 RWTH Aachen University 2 Microsoft Research Cambridge 3 University College London Deduktionstreffen 2013

  2. Termination Analysis: Invariants and Rank Functions Example y := 1; while x > 0 do x := x − y; y := y + 1; done Invariant y > 0 and rank function x prove termination How do we know that we need y > 0? x requires it �

  3. Termination Analysis: Invariants and Rank Functions Example y := 1; while x > 0 do x := x − y; y := y + 1; done Invariant y > 0 and rank function x prove termination How do we know that we need y > 0? x requires it � How do we know that x is a RF? y > 0 proves it �

  4. Termination by iterative strengthening: Idea 1 Safety: Provide samples (Counterexamples) 2 Rank tool: Find specific termination argument 3 Safety: Prove generality, or 1

  5. Termination by iterative strengthening: Idea 1 Safety: Provide samples (Counterexamples) 2 Rank tool: Find specific termination argument 3 Safety: Prove generality, or 1

  6. Termination by iterative strengthening Find counterexample then strengthen argument Loop states

  7. Termination by iterative strengthening Execution Find counterexample then strengthen argument Loop states

  8. Termination by iterative strengthening Execution Find counterexample then strengthen argument Loop states Terminating states

  9. Termination by iterative strengthening Execution Find counterexample then strengthen argument Loop states Terminating states Terminating states

  10. Termination by iterative strengthening Find counterexample s then strengthen argument e t a t s g n i t a n i m r e T Loop states Terminating states Terminating states

  11. Termination by iterative strengthening: Worst case 1 Safety: Look at everything, then return old sample 2 Rank tool: Find too specific termination argument 3 Safety: Can’t prove generality, repeat 1

  12. Termination by iterative strengthening: Worst case 1 Safety: Look at everything, then return old sample 2 Rank tool: Find too specific termination argument 3 Safety: Can’t prove generality, repeat 1

  13. Termination by iterative simplification Loop trans.

  14. Termination by iterative simplification Execution Loop trans.

  15. Termination by iterative simplification Execution Find rank function for SCC Loop trans.

  16. Termination by iterative simplification Execution Find rank function for SCC then remove transitions Loop trans.

  17. Termination by iterative simplification Execution Find rank function for SCC then remove transitions Loop trans.

  18. Termination by iterative simplification Execution Find rank function for SCC then remove transitions Loop trans.

  19. Termination by cooperation 1 Safety: Provide samples (Counterexamples) 2 Rank tool: Find termination argument in context 3 Rank tool: Mark definitely terminating parts 4 Safety: Prove generality for rest, or 1

  20. Cooperation: High-level view Safety Termination

  21. Cooperation: High-level view Safety Termination

  22. Cooperation: High-level view Safety Termination Terminating states

  23. Cooperation: High-level view Safety Termination Terminating states

  24. Cooperation: High-level view Safety Termination Terminating states

  25. Cooperation: High-level view start check decrease τ 0 : if (k ≥ 1); maybe take a i := 0; snapshot ℓ t ℓ d ℓ 1 1 1 τ t 1 : if (i < n); 2 : if (j > i); j := 0; i := i + 1; τ 2 : if (j > i); τ 1 : if (i < n); τ t τ t 3 : if (j ≤ i); i := i + 1; j := 0; j := j + k; ℓ t ℓ d ℓ 2 2 2 maybe take a snapshot τ 3 : if (j ≤ i); check decrease j := j + k;

  26. Cooperation: High-level view Intuition: Safety subgraph : original program Termination subgraph : instrumented copy

  27. Cooperation: High-level view Intuition: Safety subgraph : original program Termination subgraph : instrumented copy Ranking : Simplify problem, “point out hard bits”

  28. Cooperation: High-level view Intuition: Safety subgraph : original program Termination subgraph : instrumented copy Ranking : Simplify problem, “point out hard bits” Safety : Analyze whole program, “point out invariants”

  29. Cooperation: High-level view Intuition: Safety subgraph : original program Termination subgraph : instrumented copy Ranking : Simplify problem, “point out hard bits” Safety : Analyze whole program, “point out invariants” Approach: Analyze whole SCC, not counterexample slice

  30. Cooperation: High-level view Intuition: Safety subgraph : original program Termination subgraph : instrumented copy Ranking : Simplify problem, “point out hard bits” Safety : Analyze whole program, “point out invariants” Approach: Analyze whole SCC, not counterexample slice Remove transitions after proof

  31. Cooperation: Evaluation Evaluated on 449 termination proving benchmarks 260 known terminating, 181 known non-terminating, 8 unknown Sources: Windows drivers, Apache , PostgreSQL , . . .

  32. Cooperation: Evaluation Evaluated on 449 termination proving benchmarks 260 known terminating, 181 known non-terminating, 8 unknown Sources: Windows drivers, Apache , PostgreSQL , . . . Term (#) Term (avg. s) Cooperating-T2 245 3.42 AProVE 197 2.21 KITTeL 196 4.65 T2 189 5.15 AProVE+Interproc 185 1.53 Terminator 177 4.99 Size-Change/MCNP 156 17.50 ARMC 138 16.16

  33. Cooperation: Evaluation NR 300 120 Cooperating-T2 (s) 60 30 10 5 1 0.5 0.5 1 5 10 30 60 120 300 NR + T2

  34. Cooperation: Evaluation NR 300 120 Cooperating-T2 (s) 60 30 10 5 1 0.5 0.5 1 5 10 30 60 120 300 NR o Terminator

  35. Cooperation: Evaluation NR 300 120 Cooperating-T2 (s) 60 30 10 5 1 0.5 0.5 1 5 10 30 60 120 300 NR x AProVE

  36. Cooperation: Evaluation NR 300 120 Cooperating-T2 (s) 60 30 10 5 1 0.5 0.5 1 5 10 30 60 120 300 NR o Terminator | + T2 | x AProVE

  37. Cooperation: Evaluation Evaluated on 449 termination proving benchmarks 260 known terminating, 181 known non-terminating, 8 unknown Sources: Windows drivers, Apache , PostgreSQL , . . . Term (#) Term (avg. s) Cooperating-T2 245 3.42 AProVE 197 2.21 KITTeL 196 4.65 T2 189 5.15 AProVE+Interproc 185 1.53 Terminator 177 4.99 Size-Change/MCNP 156 17.50 ARMC 138 16.16 Sources available: http://research.microsoft.com/en-us/projects/t2/

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