to to termination analysis
play

to to Termination Analysis in in Lin inear Tim ime Roman - PowerPoint PPT Presentation

From Shape Analysis to to Termination Analysis in in Lin inear Tim ime Roman Manevich Ben-Gurion University of the Negev Noam Rinetzky Tel Aviv University Boris Dogadov Tel Aviv University UPGRADE YOUR SHAPE ANALYSIS 2 UPGRADE YOUR


  1. From Shape Analysis to to Termination Analysis in in Lin inear Tim ime Roman Manevich Ben-Gurion University of the Negev Noam Rinetzky Tel Aviv University Boris Dogadov Tel Aviv University

  2. UPGRADE YOUR SHAPE ANALYSIS 2

  3. UPGRADE YOUR SHAPE ANALYSIS START PROVING TOTAL CORRECTNESS TODAY 2

  4. UPGRADE YOUR SHAPE ANALYSIS START PROVING TOTAL CORRECTNESS TODAY FOR JUST 5% OF THE RUNNING TIME 2

  5. Research problem • Automatically verify termination of heap-manipulating programs • Dynamic memory allocation • Destructive updates • Applications • Systems codes, e.g., Windows device drivers containing linked data structures: lists, trees, etc. • Object-oriented programs utilizing containers: sets, maps, and graphs 3

  6. Scalability “dimensions” Shape complexity (complexity of heap invariants) PL features overlaid hierarchical numeric data containers concurrency recursive recursion Code size 4

  7. Classic approach Heap-manipulating Program Instrumented Shape Analyzer Safety property  Integer Program Always terminates Termination [Berdine et al. CAV 2006] [Berdine et al. POPL 2007] Analyzer [Magill et al. POPL 2010] May not terminate 5

  8. Classic approach Shape analysis-specific Heap-manipulating Program Instrumented Shape Analyzer Safety property  Integer Program Always terminates Termination [Berdine et al. CAV 2006] [Berdine et al. POPL 2007] Analyzer [Magill et al. POPL 2010] May not terminate 5

  9. Classic approach Shape analysis-specific Heap-manipulating Program Termination undecidable Instrumented Shape Analyzer Safety property  Integer Program Always terminates Termination [Berdine et al. CAV 2006] [Berdine et al. POPL 2007] Analyzer [Magill et al. POPL 2010] May not terminate 5

  10. Classic approach Shape analysis-specific Heavyweight Heap-manipulating Program Termination undecidable Instrumented Shape Analyzer Safety property  Integer Program Always terminates Termination [Berdine et al. CAV 2006] [Berdine et al. POPL 2007] Analyzer [Magill et al. POPL 2010] May not terminate 5

  11. Classic approach Shape analysis-specific Heavyweight Heap-manipulating Program Termination undecidable Instrumented Shape Analyzer Safety property  TRS Integer Program Always terminates Termination [AProVE Giesl et al. [Berdine et al. CAV 2006] CAV 2012, RTA 2011, [Berdine et al. POPL 2007] Analyzer IJCAR 2014] [Magill et al. POPL 2010] May not terminate 5

  12. Classic approach Shape analysis-specific Heavyweight Heap-manipulating Program Termination undecidable Instrumented Shape Analyzer Safety property  TRS Integer Program Logic Program Always terminates Termination [AProVE Giesl et al. [Berdine et al. CAV 2006] [Albert et al. FMOOBDS 2008] CAV 2012, RTA 2011, [Berdine et al. POPL 2007] Analyzer [Spoto et al. TOPLAS 2010] IJCAR 2014] [Magill et al. POPL 2010] May not terminate 5

  13. Classic approach Naughty idea: Once shape Shape analysis-specific analysis does the heavy lifting termination is easy Heavyweight Heap-manipulating Program Termination undecidable Instrumented Shape Analyzer Safety property  TRS Integer Program Logic Program Always terminates Termination [AProVE Giesl et al. [Berdine et al. CAV 2006] [Albert et al. FMOOBDS 2008] CAV 2012, RTA 2011, [Berdine et al. POPL 2007] Analyzer [Spoto et al. TOPLAS 2010] IJCAR 2014] [Magill et al. POPL 2010] May not terminate 5

  14. Our solution Abstract transition relation Heap-manipulating Program Partition-based Shape Analyzer Safety property  Evolution relation Always terminates Termination Analyzer May not terminate 6

  15. Our solution Most shape analyses (Sep. Logic, TVLA, Boolean heaps, TRS) Abstract transition relation Heap-manipulating Program Partition-based Shape Analyzer Safety property  Evolution relation Always terminates Termination Analyzer May not terminate 6

  16. Our solution Most shape analyses (Sep. Logic, TVLA, Boolean heaps, TRS) Abstract transition relation Heap-manipulating Program Partition-based Shape Analyzer Safety property  Evolution relation Always terminates Termination Analyzer May not terminate Easy to implement Induced by shape analysis 6

  17. Our solution Most shape analyses Termination checked (Sep. Logic, TVLA, Boolean heaps, TRS) in linear time Abstract transition relation Heap-manipulating Program Partition-based Shape Analyzer Safety property  Evolution relation Always terminates Termination Analyzer May not terminate Easy to implement Induced by shape analysis 6

  18. Main results 7

  19. Main results 1. Termination analysis parametrized by partition-based shape analysis • Enables handling wide range of shape invariants (both inductive data structures and unstructured graphs) 7

  20. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) 7

  21. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) • Novel ranking function based on evolution relation 7

  22. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) • Novel ranking function based on evolution relation 3. Featherweight analysis • Linear time modulo shape analysis • Modular 7

  23. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) • Novel ranking function based on evolution relation 3. Featherweight analysis  Code size • Linear time modulo shape analysis • Modular 7

  24. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) • Novel ranking function based on evolution relation 3. Featherweight analysis  Code size • Linear time modulo shape analysis • Modular 4. Handles recursion very precisely • Limited support for concurrency 7

  25. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) • Novel ranking function based on evolution relation 3. Featherweight analysis  Code size • Linear time modulo shape analysis • Modular 4. Handles recursion very precisely  PL features • Limited support for concurrency 7

  26. Main results 1. Termination analysis parametrized by partition-based shape analysis  Shape • Enables handling wide range of shape invariants complexity (both inductive data structures and unstructured graphs) • Novel ranking function based on evolution relation 3. Featherweight analysis  Code size • Linear time modulo shape analysis • Modular 4. Handles recursion very precisely  PL features • Limited support for concurrency 5. Precise enough on a variety of benchmarks 7

  27. Agenda • Our recipe for proving termination • Apply recipe for shape analysis • Handling nested loops and recursion • Experiments and conclusion 8

  28. Reminder: general recipe for proving termination To show that a transition system (  ,  ) does not contain infinite paths: 9

  29. Reminder: general recipe for proving termination To show that a transition system (  ,  ) does not contain infinite paths: 1. Find well-founded ordering  :    (all descending chains finite) 9

  30. Reminder: general recipe for proving termination To show that a transition system (  ,  ) does not contain infinite paths: 1. Find well-founded ordering  :    (all descending chains finite) 2. Show that every infinite path must contain an infinite  -descending chain  *  *  *  *  1  i  k  j    9

  31. Our recipe To show that a transition system (  ,  ) does not contain infinite paths: 10

  32. Our recipe To show that a transition system (  ,  ) does not contain infinite paths: 1. Find well-founded ordering  :    that is monotone:    ’   ’   10

  33. Our recipe To show that a transition system (  ,  ) does not contain infinite paths: 1. Find well-founded ordering  :    that is monotone:    ’   ’   2. Compute a ( finite ) abstract transition system (  ,  ) 10

  34. Our recipe To show that a transition system (  ,  ) does not contain infinite paths: 1. Find well-founded ordering  :    that is monotone:    ’   ’   2. Compute a ( finite ) abstract transition system (  ,  ) 3. Find all decreasing transitions  := {} for each    ’   do if    ’ then  :=   (  ,  ’ ) fi od // linear time 10

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