skip to main content
10.1145/3009837.3009864acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article
Public Access

Complexity verification using guided theorem enumeration

Published:01 January 2017Publication History

ABSTRACT

Determining if a given program satisfies a given bound on the amount of resources that it may use is a fundamental problem with critical practical applications. Conventional automatic verifiers for safety properties cannot be applied to address this problem directly because such verifiers target properties expressed in decidable theories; however, many practical bounds are expressed in nonlinear theories, which are undecidable.

In this work, we introduce an automatic verification algorithm, CAMPY, that determines if a given program P satisfies a given resource bound B, which may be expressed using polynomial, exponential, and logarithmic terms. The key technical contribution behind our verifier is an interpolating theorem prover for non-linear theories that lazily learns a sufficiently accurate approximation of non-linear theories by selectively grounding theorems of the nonlinear theory that are relevant to proving that P satisfies B. To evaluate CAMPY, we implemented it to target Java Virtual Machine bytecode. We applied CAMPY to verify that over 20 solutions submitted for programming problems hosted on popular online coding platforms satisfy or do not satisfy expected complexity bounds.

References

  1. E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini. Cost analysis of object-oriented bytecode programs. Theor. Comput. Sci., 413(1), 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C. Alias, A. Darte, P. Feautrier, and L. Gonnord. Multi-dimensional rankings, program termination, and complexity bounds of flowchart programs. In SAS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Alur and P. Madhusudan. Adding nesting structure to words. J. ACM, 56 (3), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Alur, R. Bodik, G. Juniwal, M. M. Martin, M. Raghothaman, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In FMCAD, 2015.Google ScholarGoogle Scholar
  5. T. Ball, R. Majumdar, T. D. Millstein, and S. K. Rajamani. Automatic predicate abstraction of C programs. In PLDI, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Borralleras, S. Lucas, R. Navarro-Marset, E. Rodríguez-Carbonell, and A. Rubio. Solving non-linear polynomial arithmetic via sat modulo linear arithmetic. In CADE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. campy. campy. http://www.cc.gatech.edu/~wharris/campy.html, 2016. Accessed: 2016 Nov 6. Q. Carbonneaux, J. Hoffmann, T. Ramananandro, and Z. Shao. End-to-end verification of stack-space bounds for C programs. In PLDI, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Q. Carbonneaux, J. Hoffmann, and Z. Shao. Compositional certified resource bounds. In PLDI, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. codechef. Programming competition, programming contest, online computer programming. https://www.codechef.com/, 2016. Accessed: 2016 June 14. codeforces. Programming competitions and contests, programming community. https://www.codeforces.com/, 2016. Accessed: 2016 June 14. G. E. Collins. Quantifier elimination for real closed fields by cylindrical algebraic decomposition. Springer, 1998.Google ScholarGoogle Scholar
  10. cve-2011-3191. CVE - CVE-2011-3191. https://cve.mitre.org/cgibin/cvename.cgi?name=CVE-2011-3192, 2015.Google ScholarGoogle Scholar
  11. Accessed: 2015 July. L. Dai, B. Xia, and N. Zhan. Generating non-linear interpolants by semidefinite programming. In CAV, 2013.Google ScholarGoogle Scholar
  12. L. M. de Moura and N. Bjørner. Z3: an efficient SMT solver. In TACAS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. framework. A framework for analyzing and transforming Java and Android applications. https://sable.github.io/soot/, 2016. Accessed: 2016.Google ScholarGoogle Scholar
  14. K. Gödel, S. C. Kleene, and J. B. Rosser. On undecidable propositions of formal mathematical systems. Institute for Advanced Study Princeton, NJ, 1934.Google ScholarGoogle Scholar
  15. B. S. Gulavani and S. Gulwani. A numerical abstract domain based on expression abstraction and max operator with application in timing analysis. In CAV, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Gulwani. Automating string processing in spreadsheets using input-output examples. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Gulwani and F. Zuleger. The reachability-bound problem. In PLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Gulwani, S. Jain, and E. Koskinen. Control-flow refinement and progress invariants for bound analysis. In PLDI, 2009a. S. Gulwani, K. K. Mehra, and T. M. Chilimbi. SPEED: precise and efficient static estimation of program computational complexity. In POPL, 2009b. S. Gulwani, S. Jha, A. Tiwari, and R. Venkatesan. Synthesis of loop-free programs. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. W. R. Harris and S. Gulwani. Spreadsheet table transformations from examples. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Heizmann, J. Hoenicke, and A. Podelski. Nested interpolants. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. A. Henzinger, R. Jhala, R. Majumdar, and G. Sutre. Lazy abstraction. In POPL, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. T. A. Henzinger, R. Jhala, R. Majumdar, and K. L. McMillan. Abstractions from proofs. In POPL, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Hoffmann and M. Hofmann. Amortized resource analysis with polynomial potential. In ESOP, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Hoffmann, K. Aehlig, and M. Hofmann. Multivariate amortized resource analysis. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. D. Jovanovi´c and L. De Moura. Solving non-linear arithmetic. In Automated Reasoning, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. leetcode. LeetCode online judge. https://leetcode.com/, 2016. Accessed: 2016.Google ScholarGoogle Scholar
  27. LIS. Problem LIS on LeetCode. https://leetcode.com/problems/ longest-increasing-subsequence/, 2016. Accessed: 2016.Google ScholarGoogle Scholar
  28. K. L. McMillan. Lazy abstraction with interpolants. In CAV, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. G. Nelson and D. C. Oppen. Simplification by cooperating decision procedures. TOPLAS, 1(2), 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. O. Olivo, I. Dillig, and C. Lin. Static detection of asymptotic performance bugs in collection traversals. In PLDI, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Reynolds, M. Deters, V. Kuncak, C. Tinelli, and C. Barrett. Counterexample-guided quantifier instantiation for synthesis in smt. In CAV, 2015.Google ScholarGoogle Scholar
  32. M. Sinn, F. Zuleger, and H. Veith. A simple and scalable static analysis for bound analysis and amortized complexity analysis. In CAV, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. V. Sofronie-Stokkermans. Interpolation in local theory extensions. In Logical Methods in Computer Science, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  34. A. Solar-Lezama, R. Rabbah, R. Bodík, and K. Ebcio˘glu. Programming by sketching for bit-streaming programs. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Tarski. A decision method for elementary algebra and geometry. Texts and Monogrpahs in Symbolic Computation, 1951.Google ScholarGoogle ScholarCross RefCross Ref
  36. N. Totla and T. Wies. Complete instantiation based interpolation. In POPL, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. A. Udupa, A. Raghavan, J. V. Deshmukh, S. Mador-Haim, M. M. Martin, and R. Alur. Transit: specifying protocols with concolic snippets. In PLDI, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. R. Wilhelm, J. Engblom, A. Ermedahl, N. Holsti, S. Thesing, D. B. Whalley, G. Bernat, C. Ferdinand, R. Heckmann, T. Mitra, F. Mueller, I. Puaut, P. P. Puschner, J. Staschulat, and P. Stenström. The worst-case executiontime problem - overview of methods and survey of tools. ACM Trans. Embedded Comput. Syst., 7(3), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. z3. Z3prover/z3 - github. https://github.com/Z3Prover/z3, 2015.Google ScholarGoogle Scholar
  40. Accessed: 2015 Nov 7. Introduction Overview An Iterative Implementation of Binary Search Inductive Step-Count Invariants Synthesizing Step-Count Invariants Background Target Language Program Structure Program Semantics Formal Logic Symbolic Representation of Program Semantics Interpolation Technical Approach Summaries Verification Algorithm Per-Path Bound Satisfaction as Tree-Interpolation Tree Interpolation by Theorem Enumeration The Theorem-Proving Algorithm Enumerating Quantifier-Free T-Theorems Properties Evaluation Benchmarks Results and Conclusions Related Work ConclusionGoogle ScholarGoogle Scholar

Index Terms

  1. Complexity verification using guided theorem enumeration

            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
            • Published in

              cover image ACM Conferences
              POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages
              January 2017
              901 pages
              ISBN:9781450346603
              DOI:10.1145/3009837

              Copyright © 2017 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 ACM 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: 1 January 2017

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate824of4,130submissions,20%

              Upcoming Conference

              POPL '25

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader