skip to main content
research-article

Termination and non-termination specification inference

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

Techniques for proving termination and non-termination of imperative programs are usually considered as orthogonal mechanisms. In this paper, we propose a novel mechanism that analyzes and proves both program termination and non-termination at the same time. We first introduce the concept of second-order termination constraints and accumulate a set of relational assumptions on them via a Hoare-style verification. We then solve these assumptions with case analysis to determine the (conditional) termination and non- termination scenarios expressed in some specification logic form. In contrast to current approaches, our technique can construct a summary of terminating and non-terminating behaviors for each method. This enables modularity and reuse for our termination and non-termination proving processes. We have tested our tool on sample programs from a recent termination competition, and compared favorably against state-of-the-art termination analyzers.

References

  1. M. F. Atig, A. Bouajjani, M. Emmi, and A. Lal. Detecting Fair Nontermination in Multithreaded Programs. In CAV, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Berdine, B. Cook, D. Distefano, and P. W. O’Hearn. Automatic Termination Proofs for Programs with Shape-Shifting Heaps. In CAV, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Berdine, A. Chawdhary, B. Cook, D. Distefano, and P. W. O’Hearn. Variance analyses from invariance analyses. In POPL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Bozga, R. Iosif, and F. Koneˇcný. Deciding Conditional Termination. In TACAS, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. R. Bradley, Z. Manna, and H. B. Sipma. The Polyranking Principle. In ICALP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Brockschmidt, T. Ströder, C. Otto, and J. Giesl. Automated Detection of Non-Termination and NullPointerExceptions for Java Bytecode. In FoVeOOS, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Brockschmidt, B. Cook, and C. Fuhs. Better termination proving through cooperation. In CAV, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H.-Y. Chen, B. Cook, C. Fuhs, K. Nimkar, and P. O’Hearn. Proving nontermination via safety. In TACAS, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  9. W.-N. Chin, C. David, H. H. Nguyen, and S. Qin. Automated verification of shape, size and bag properties via user-defined predicates in separation logic. Science of Computer Programming, 77(9), 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Codish, S. Genaim, M. Bruynooghe, J. Gallagher, and W. Vanhoof. One loop at a time. In Intl. Workshop on Termination (WST), 2003.Google ScholarGoogle Scholar
  11. B. Cook, A. Podelski, and A. Rybalchenko. Abstraction refinement for termination. In SAS, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. B. Cook, A. Podelski, and A. Rybalchenko. Termination proofs for systems code. In PLDI, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. B. Cook, A. Podelski, and A. Rybalchenko. Proving thread termination. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. B. Cook, S. Gulwani, T. Lev-Ami, A. Rybalchenko, and M. Sagiv. Proving conditional termination. In CAV, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. B. Cook, D. Kroening, P. Rümmer, and C. M. Wintersteiger. Ranking Function Synthesis for Bit-Vector Relations. In TACAS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. Cook, A. See, and F. Zuleger. Ramsey vs. Lexicographic Termination Proving. In TACAS, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Cousot. Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming. In VMCAI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Falke, D. Kapur, and C. Sinz. Termination Analysis of C Programs Using Compiler Intermediate Languages. In RTA, 2011.Google ScholarGoogle Scholar
  19. P. Ganty and S. Genaim. Proving termination starting from the end. In CAV, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Gherghina, C. David, S. Qin, and W.-N. Chin. Structured specifications for better verification of heap-manipulating programs. In FM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. Giesl, M. Brockschmidt, F. Emmes, F. Frohn, C. Fuhs, C. Otto, M. Plücker, P. Schneider-Kamp, T. Ströder, S. Swiderski, and R. Thiemann. Proving Termination of Programs Automatically with AProVE. In IJCAR, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  22. S. Grebenshchikov, N. P. Lopes, C. Popeea, and A. Rybalchenko. Synthesizing software verifiers from proof rules. In PLDI, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. Gulwani, S. Srivastava, and R. Venkatesan. Program Analysis As Constraint Solving. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. Gupta, T. A. Henzinger, R. Majumdar, A. Rybalchenko, and R.-G. Xu. Proving non-termination. In POPL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. W. R. Harris, A. Lal, A. V. Nori, and S. K. Rajamani. Alternation for Termination. In SAS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Heizmann, J. Hoenicke, and A. Podelski. Termination Analysis by Learning Terminating Programs. In CAV, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Heizmann, D. Dietsch, J. Leike, B. Musa, and A. Podelski. Ultimate Automizer with Array Interpolation (Competition Contribution). In TACAS, 2015.Google ScholarGoogle Scholar
  28. D. Jovanovic and L. M. de Moura. Solving non-linear arithmetic. In IJCAR, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Kroening, N. Sharygina, A. Tsitovich, and C. M. Wintersteiger. Termination Analysis with Compositional Transition Invariants. In CAV, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. D. Larraz, A. Oliveras, E. Rodriguez-Carbonell, and A. Rubio. Proving termination of imperative programs using Max-SMT. In FMCAD, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  31. D. Larraz, K. Nimkar, A. Oliveras, E. Rodriguez-Carbonell, and A. Rubio. Proving Non-termination Using Max-SMT. In CAV, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Q. L. Le, C. Gherghina, S. Qin, and W.-N. Chin. Shape Analysis via Second-Order Bi-Abduction. In CAV, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. T. C. Le, C. Gherghina, A. Hobor, and W.-N. Chin. A resource-based logic for termination and non-termination proofs. In ICFEM, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  34. C. S. Lee, N. D. Jones, and A. M. Ben-Amram. The size-change principle for program termination. In POPL, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. É. Payet and F. Spoto. Experiments with Non-Termination Analysis for Java Bytecode. Electr. Notes Theor. Comput. Sci., 253(5), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. C. S. Peirce. Collected papers of Charles Sanders Peirce. Harvard University Press., 1958.Google ScholarGoogle Scholar
  37. A. Podelski and A. Rybalchenko. Transition Invariants. In LICS, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. A. Podelski and A. Rybalchenko. A Complete Method for the Synthesis of Linear Ranking Functions. In VMCAI, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  39. A. Podelski and A. Rybalchenko. ARMC: The Logical Choice for Software Model Checking with Abstraction Refinement. In PADL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. C. Popeea and W.-N. Chin. Inferring Disjunctive Postconditions. In ASIAN, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. J. Reynolds. Separation Logic: A Logic for Shared Mutable Data Structures. In LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. A. Rybalchenko. Constraint Solving for Program Verification: Theory and Practice by Example. In CAV, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. A. Schrijver. Theory of Linear and Integer Programming. John Wiley & Sons, New York, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. T. Ströder, C. Aschermann, F. Frohn, J. Hensel, and J. Giesl. AProVE: Termination and Memory Safety of C Programs (Competition Contribution). In TACAS, 2015.Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. SV-COMP. The Competition on Software Verification. http://sv-comp. sosy-lab.org/2015/, 2015.Google ScholarGoogle Scholar
  46. TermCOMP. The Annual International Termination Competition. http://termination-portal.org/wiki/Termination_Competition_ 2014/, 2014.Google ScholarGoogle Scholar
  47. H. Velroyen and P. Rümmer. Non-termination checking for imperative programs. In TAP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Termination and non-termination specification inference

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                Full Access

                • Published in

                  cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 50, Issue 6
                  PLDI '15
                  June 2015
                  630 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/2813885
                  • Editor:
                  • Andy Gill
                  Issue’s Table of Contents
                  • cover image ACM Conferences
                    PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation
                    June 2015
                    630 pages
                    ISBN:9781450334686
                    DOI:10.1145/2737924

                  Copyright © 2015 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 3 June 2015

                  Check for updates

                  Qualifiers

                  • research-article

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader