skip to main content
research-article

Synthesis of ranking functions using extremal counterexamples

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

We present a complete method for synthesizing lexicographic linear ranking functions (and thus proving termination), supported by inductive invariants, in the case where the transition relation of the program includes disjunctions and existentials (large block encoding of control flow). Previous work would either synthesize a ranking function at every basic block head, not just loop headers, which reduces the scope of programs that may be proved to be terminating, or expand large block transitions including tests into (exponentially many) elementary transitions, prior to computing the ranking function, resulting in a very large global constraint system. In contrast, our algorithm incrementally refines a global linear constraint system according to extremal counterexamples: only constraints that exclude spurious solutions are included. Experiments with our tool Termite show marked performance and scalability improvements compared to other systems.

References

  1. C. Alias, A. Darte, P. Feautrier, and L. Gonnord. Multi-dimensional rankings, program termination, and complexity bounds of flowchart programs. In Static analysis (SAS), Perpignan, France, Sept. 2010.. URL http://hal.inria.fr/inria-00523298. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C. Alias, A. Darte, P. Feautrier, and L. Gonnord. Rank: a tool to check program termination and computational complexity. In Constraints in Software Testing Verification and Analysis, Luxembourg, Mar. 2013.. URL http://hal.inria.fr/hal-00801571. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Ancourt, F. Coelho, and F. Irigoin. A modular static analysis approach to affine loop invariants detection. Electronic Notes in Theoretical Computer Science, 267(1):3 – 16, 2010. ISSN 1571-0661. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. .Google ScholarGoogle Scholar
  5. S. Balev, P. Quinton, S. Rajopadhye, and T. Risset. Linear programming models for scheduling systems of affine recurrence equations - a comparative study. In ACM Symposium on Parallel algorithms and architectures, pages 250–258. ACM, 1998.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. M. Ben-Amram and S. Genaim. Ranking functions for linearconstraint loops. J. ACM, 61(4):26:1–26:55, July 2014. ISSN 0004- 5411.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. R. Bradley, Z. Manna, and H. B. Sipma. The polyranking principle. In Intl. Colloquium on Automata, Languages and Programming (ICALP), volume 3580 of LNCS, pages 1349–1361. Springer, July 2005.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. R. Bradley, Z. Manna, and H. B. Sipma. Linear ranking with reachability. In K. Etessami and S. K. Rajamani, editors, Computer aided verification (CAV), volume 3576 of LNCS, pages 491–504. Springer, July 2005.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Codish and S. Genaim. Proving termination one loop at a time. In F. Mesnard and A. Serebrenik, editors, 13th International Workshop on Logic Programming Environments, Tata Institute of Fundamental Research, Mumbai, India, December 8, 2003, Technical Report CW371, pages 48–59. Katholieke Universiteit Leuven, 2003. URL http://www.cs.kuleuven.ac.be/publicaties/rapporten/cw/ CW371.pdf.Google ScholarGoogle Scholar
  10. B. Cook, A. Podelski, and A. Rybalchenko. Proving program termination. Commun. ACM, 54(5):88–98, May 2011. ISSN 0001-0782. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. .Google ScholarGoogle Scholar
  12. B. Cook, A. See, and F. Zuleger. Ramsey vs. lexicographic termination proving. In TACAS, volume 7795 of LNCS, pages 47–61. Springer, 2013.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In ACM Symposium on Principles of Programming Languages (POPL), pages 84–97. ACM, 1978.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. TOPLAS, 13(4):451–490, 1991.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. P. Feautrier. Some efficient solutions to the affine scheduling problem, part I, one-dimensional time. International Journal of Parallel Programming, 21(5):313–348, Oct. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. Feautrier. Some efficient solutions to the affine scheduling problem, part II, multi-dimensional time. International Journal of Parallel Programming, 21(6):389–420, Dec. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Feautrier and L. Gonnord. Accelerated Invariant Generation for C Programs with Aspic and C2fsm. In Tools for Automatic Program AnalysiS (TAPAS’10), Perpignan, France, 2010.. URL http://hal. inria.fr/inria-00523320.Google ScholarGoogle Scholar
  18. B. Gärtner and J. Matouˇsek. Approximation Algorithms and Semidefinite Programming. Springer, 2012.. Google ScholarGoogle ScholarCross RefCross Ref
  19. 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 S. Demri, D. Kapur, and C. Weidenbach, editors, Automated Reasoning (IJCAR), volume 8562 of LNCS, pages 184–191. Springer, 2014.Google ScholarGoogle Scholar
  20. .Google ScholarGoogle Scholar
  21. L. Gonnord and N. Halbwachs. Combining widening and acceleration in linear relation analysis. In Static analysis (SAS), volume 4134 of LNCS, pages 144–160. Springer, Aug. 2006.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. L. Gonnord and P. Schrammel. Abstract acceleration in linear relation analysis. Sci. Comput. Program., 93:125–153, 2014.. URL http: //dx.doi.org/10.1016/j.scico.2013.09.016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. Gulwani and F. Zuleger. The reachability-bound problem. In ACM symposium on programming language design and implementation (PLDI), pages 292–304. ACM, 2010.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Henry, D. Monniaux, and M. Moy. Succinct representations for abstract interpretation - combined analysis algorithms and experimental evaluation. In Static Analysis - 19th International Symposium, SAS 2012, Deauville, France, September 11-13, 2012. Proceedings, pages 283–299, 2012.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Henry, D. Monniaux, and M. Moy. Pagai: A path sensitive static analyser. Electr. Notes Theor. Comput. Sci., 289:15–25, 2012.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Henry, D. Monniaux, and M. Moy. The Pagai static analyser, 2014. URL http://pagai.forge.imag.fr/.Google ScholarGoogle Scholar
  27. D. Kroening and O. Strichman. Decision procedures. Springer, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  28. D. Larraz, A. Oliveras, E. Rodr´ıguez-Carbonell, and A. Rubio. Proving termination of imperative programs using max-SMT. In FMCAD, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  29. D. Monniaux and L. Gonnord. Using bounded model checking to focus fixpoint iterations. In 18th International Static Analysis Symposium (SAS’11), Venice, Italy, Sept. 2011.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. Nieuwenhuis and A. Oliveras. On SAT modulo theories and optimization problems. In SAT, volume 4121 of LNCS, pages 156– 169. Springer, 2006.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Podelski and A. Rybalchenko. A complete method for the synthesis of linear ranking functions. In Verification, Model Checking and Abstract Interpretation (VMCAI’04), volume 2937 of LNCS, pages 239–251. Springer, 2004..Google ScholarGoogle Scholar
  32. R. E. Rodrigues, P. Alves, F. Pereira, and L. Gonnord. Real-world loops are easy to predict : a case study. In Workshop on Software Termination, Vienne, Austria, July 2014. URL https://hal.inria.fr/ hal-01006208.Google ScholarGoogle Scholar
  33. A. Schrijver. Theory of linear and integer programming. Wiley, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. R. Sebastiani and S. Tomasi. Optimization in SMT with LA(Q) cost functions. In Proceedings of the 6th international joint conference on Automated Reasoning, (IJCAR’12), pages 484–498. Springer, 2012.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Shamir. A linear time algorithm for finding minimum cutsets in reducible graphs. SIAM J. Comput., 8(4):645–655, 1979..Google ScholarGoogle ScholarCross RefCross Ref
  36. J. Tristan and X. Leroy. Verified validation of lazy code motion. In M. Hind and A. Diwan, editors, Programming Language Design and Implementation (PLDI), pages 316–326. ACM, 2009.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. A. M. Turing. Checking a large routine. In Report of a Conference on High Speed Automatic Calculating Machines, 1949. URL http: //www.turingarchive.org/browse.php/B/8.Google ScholarGoogle Scholar
  38. C. Urban. The abstract domain of segmented ranking functions. In Static Analysis (SAS), volume 7935 of LNCS, pages 43–62. Springer, 2013..Google ScholarGoogle Scholar
  39. C. Urban and A. Miné. An abstract domain to infer ordinal-valued ranking functions. In Programming Languages and Systems (ESOP), volume 8410 of LNCS, pages 412–431. Springer, 2014.Google ScholarGoogle Scholar
  40. H. Zankl and A. Middeldorp. Increasing interpretations. Ann. Math. Artif. Intell., 56(1):87–108, 2009.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. F. Zuleger, S. Gulwani, M. Sinn, and H. Veith. Bound analysis of imperative programs with the size-change abstraction. In Proceedings of the 18th international conference on Static analysis, SAS’11, pages 280–297, Berlin, Heidelberg, 2011. Springer-Verlag. URL http://dl. acm.org/citation.cfm?id=2041552.2041574. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Synthesis of ranking functions using extremal counterexamples

              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

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!