skip to main content
research-article

Compositional certified resource bounds

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

This paper presents a new approach for automatically deriving worst-case resource bounds for C programs. The described technique combines ideas from amortized analysis and abstract interpretation in a unified framework to address four challenges for state-of-the-art techniques: compositionality, user interaction, generation of proof certificates, and scalability. Compositionality is achieved by incorporating the potential method of amortized analysis. It enables the derivation of global whole-program bounds with local derivation rules by naturally tracking size changes of variables in sequenced loops and function calls. The resource consumption of functions is described abstractly and a function call can be analyzed without access to the function body. User interaction is supported with a new mechanism that clearly separates qualitative and quantitative verification. A user can guide the analysis to derive complex non-linear bounds by using auxiliary variables and assertions. The assertions are separately proved using established qualitative techniques such as abstract interpretation or Hoare logic. Proof certificates are automatically generated from the local derivation rules. A soundness proof of the derivation system with respect to a formal cost semantics guarantees the validity of the certificates. Scalability is attained by an efficient reduction of bound inference to a linear optimization problem that can be solved by off-the-shelf LP solvers. The analysis framework is implemented in the publicly-available tool C4B. An experimental evaluation demonstrates the advantages of the new technique with a comparison of C4B with existing tools on challenging micro benchmarks and the analysis of more than 2900 lines of C code from the cBench benchmark suite.

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):142–159, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Albert, R. Bubel, S. Genaim, R. Hähnle, and G. Román-D´ıez. Verified Resource Guarantees for Heap Manipulating Programs. In Fundamental Approaches to Software Engineering - 15th Int. Conf. (FASE’12), pages 130–145, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. C. Alias, A. Darte, P. Feautrier, and L. Gonnord. Multi-dimensional Rankings, Program Termination, and Complexity Bounds of Flowchart Programs. In 17th Int. Static Analysis Symposium (SAS’10), pages 117–133, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. E. Alonso-Blas and S. Genaim. On the limits of the classical approach to cost analysis. In 19th Int. Static Analysis Symposium (SAS’12), pages 405–421, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Atkey. Amortised Resource Analysis with Separation Logic. In 19th Euro. Symp. on Prog. (ESOP’10), pages 85–103, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Barthe, B. Grégoire, and S. Z. Béguelin. Formal Certification of Code-Based Cryptographic Proofs. In 36th ACM Symp. on Principles of Prog. Langs. (POPL’09), pages 90–101, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Barthe, G. Betarte, J. D. Campo, C. Luna, and D. Pichardie. System-Level Non-Interference for Constant-Time Cryptography. IACR Cryptology ePrint Archive, 2014:422, 2014.Google ScholarGoogle Scholar
  8. R. Blanc, T. A. Henzinger, T. Hottelier, and L. Kovács. ABC: Algebraic Bound Computation for Loops. In Logic for Prog., AI., and Reasoning - 16th Int. Conf. (LPAR’10), pages 103–118, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Blazy, A. Maroneze, and D. Pichardie. Formal Verification of Loop Bound Estimation for WCET Analysis. In Verified Software: Theories, Tools, Experiments - 5th Int. Conf. (VSTTE’13), 2013. To appear.Google ScholarGoogle Scholar
  10. V. A. Braberman, F. Fernández, D. Garbervetsky, and S. Yovine. Parametric prediction of heap memory requirements. In 7th Int. Symp. on Memory Management (ISMM’08), pages 141–150, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Brockschmidt, F. Emmes, S. Falke, C. Fuhs, and J. Giesl. Alternating Runtime and Size Complexity Analysis of Integer Programs. In Tools and Alg. for the Constr. and Anal. of Systems - 20th Int. Conf. (TACAS’14), pages 140–155, 2014.Google ScholarGoogle Scholar
  12. M. Carbin, S. Misailovic, and M. C. Rinard. Verifying Quantitative Reliability for Programs that Execute on Unreliable Hardware. In 28th Conf. on Object-Oriented Prog., Sys., Langs., and Appl., OOPSLA’13, pages 33–52, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Q. Carbonneaux, J. Hoffmann, T. Ramananandro, and Z. Shao. End-to-End Verification of Stack-Space Bounds for C Programs. In Conf. on Prog. Lang. Design and Impl. (PLDI’14), page 30, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Q. Carbonneaux, J. Hoffmann, and Z. Shao. Compositional Certified Resource Bounds (Extended Version). Technical Report YALEU/DCS/TR-1505, Dept. of Computer Science, Yale University, New Haven, CT, April 2015.Google ScholarGoogle Scholar
  15. A. Carroll and G. Heiser. An Analysis of Power Consumption in a Smartphone. In USENIX Annual Technical Conference (USENIX’10), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Cohen, H. S. Zhu, E. E. Senem, and Y. D. Liu. Energy Types. In 27th Conf. on Object-Oriented Prog., Sys., Langs., and Appl., OOPSLA’12, pages 831–850, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. COIN-OR Project. CLP (Coin-or Linear Programming). https: //projects.coin-or.org/Clp, 2014. Accessed: 2014-11-12.Google ScholarGoogle Scholar
  18. S. Gulwani and F. Zuleger. The Reachability-Bound Problem. In Conf. on Prog. Lang. Design and Impl. (PLDI’10), pages 292–304, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Gulwani, S. Jain, and E. Koskinen. Control-Flow Refinement and Progress Invariants for Bound Analysis. In Conf. on Prog. Lang. Design and Impl. (PLDI’09), pages 375–385, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Gulwani, K. K. Mehra, and T. M. Chilimbi. SPEED: Precise and Efficient Static Estimation of Program Computational Complexity. In 36th ACM Symp. on Principles of Prog. Langs. (POPL’09), pages 127–139, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. Hoffmann and M. Hofmann. Amortized Resource Analysis with Polynomial Potential. In 19th Euro. Symp. on Prog. (ESOP’10), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Hoffmann and Z. Shao. Type-Based Amortized Resource Analysis with Integers and Arrays. In 12th International Symposium on Functional and Logic Programming (FLOPS’14), 2014.Google ScholarGoogle Scholar
  23. J. Hoffmann, K. Aehlig, and M. Hofmann. Multivariate Amortized Resource Analysis. In 38th ACM Symp. on Principles of Prog. Langs. (POPL’11), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Hoffmann, K. Aehlig, and M. Hofmann. Multivariate Amortized Resource Analysis. ACM Trans. Program. Lang. Syst., 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Hofmann and S. Jost. Static Prediction of Heap Space Usage for First-Order Functional Programs. In 30th ACM Symp. on Principles of Prog. Langs. (POPL’03), pages 185–197, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Hofmann and S. Jost. Type-Based Amortised Heap-Space Analysis. In 15th Euro. Symp. on Prog. (ESOP’06), pages 22–37, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Hofmann and G. Moser. Amortised resource analysis and typed polynomial interpretations. In Joint 25th RTA and 12th TLCA, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  28. E. Käsper and P. Schwabe. Faster and Timing-Attack Resistant AESGCM. In Cryptographic Hardware and Emb. Sys., 11th Int. Workshop (CHES’09), pages 1–17, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. X. Leroy. Formal Verification of a Realistic Compiler. Communications of the ACM, 52(7):107–115, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. J. Regehr, A. Reid, and K. Webb. Eliminating Stack Overflow by Abstract Interpretation. ACM Trans. Embed. Comput. Syst., 4(4):751– 778, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. Sinn, F. Zuleger, and H. Veith. A Simple and Scalable Approach for Bound Analysis and Amortized Complexity Analysis. In Computer Aided Verification - 26th Int. Conf. (CAV’14), page 743–759, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. R. E. Tarjan. Amortized Computational Complexity. SIAM Journal on Algebraic Discrete Methods, 6(2):306–318, 1985.Google ScholarGoogle ScholarCross RefCross Ref
  33. F. Zuleger, M. Sinn, S. Gulwani, and H. Veith. Bound Analysis of Imperative Programs with the Size-change Abstraction. In 18th Int. Static Analysis Symposium (SAS’11), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Compositional certified resource bounds

              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!