On the Limits of the Classical Approach to Cost Analysis

The classical approach to static cost analysis is based on transforming a given program into cost relations and solving them into closed-form upper-bounds. It is known that for some programs, this approach infers upper-bounds that are asymptotically less precise than the actual cost. As yet, it was assumed that this imprecision is due to the way cost relations are solved into upper-bounds. In this paper: (1) we show that this assumption is partially true, and identify the reason due to which cost relations cannot precisely model the cost of such programs; and (2) to overcome this imprecision, we develop a new approach to cost analysis, based on SMT and quantifier elimination. Interestingly, we find a strong relation between our approach and amortised cost analysis.

[1]  Jim Woodcock,et al.  Theoretical Aspects of Computing - ICTAC 2007, 4th International Colloquium, Macau, China, September 26-28, 2007, Proceedings , 2007, ICTAC.

[2]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[3]  Jacques Cohen,et al.  Automating program analysis , 1988, JACM.

[4]  Elvira Albert,et al.  Closed-Form Upper Bounds in Static Cost Analysis , 2011, Journal of Automated Reasoning.

[5]  Ronald L. Rivest,et al.  Introduction to Algorithms, third edition , 2009 .

[6]  Sumit Gulwani,et al.  The reachability-bound problem , 2010, PLDI '10.

[7]  Andy King,et al.  Inferring Argument Size Relationships with CLP(R) , 1996, LOPSTR.

[8]  Alan Bundy,et al.  Logic Program Synthesis via Proof Planning , 1992, LOPSTR.

[9]  Christopher W. Brown,et al.  Efficient Preprocessing Methods for Quantifier Elimination , 2006, CASC.

[10]  Martin Hofmann,et al.  Multivariate amortized resource analysis , 2011, POPL '11.

[11]  Daniel Le Métayer,et al.  ACE: an automatic complexity evaluator , 1988, TOPL.

[12]  Chaochen Zhou,et al.  Discovering Non-linear Ranking Functions by Solving Semi-algebraic Systems , 2007, ICTAC.

[13]  Siau-Cheng Khoo,et al.  Calculating Polynomial Runtime Properties , 2005, APLAS.

[14]  Xin-She Yang,et al.  Introduction to Algorithms , 2021, Nature-Inspired Optimization Algorithms.

[15]  David Monniaux,et al.  Automatic modular abstractions for template numerical constraints , 2009, Log. Methods Comput. Sci..

[16]  Elvira Albert,et al.  More Precise Yet Widely Applicable Cost Analysis , 2011, VMCAI.

[17]  Ben Wegbreit,et al.  Mechanical program analysis , 1975, CACM.

[18]  Elvira Albert,et al.  Parametric inference of memory requirements for garbage collected languages , 2010, ISMM '10.

[19]  Kousha Etessami,et al.  Analysis of Recursive Game Graphs Using Data Flow Equations , 2004, VMCAI.

[20]  Deepak Kapur Automatically Generating Loop Invariants Using Quantifier Elimination , 2005, Deduction and Applications.

[21]  Sumit Gulwani,et al.  SPEED: precise and efficient static estimation of program computational complexity , 2009, POPL '09.

[22]  Ashish Tiwari,et al.  Verification and synthesis using real quantifier elimination , 2011, ISSAC '11.

[23]  Saumya K. Debray,et al.  Cost analysis of logic programs , 1993, TOPL.

[24]  Thomas Sturm,et al.  REDLOG: computer algebra meets computer logic , 1997, SIGS.

[25]  Sumit Gulwani,et al.  Bound Analysis of Imperative Programs with the Size-Change Abstraction , 2011, SAS.

[26]  Elvira Albert,et al.  Cost analysis of object-oriented bytecode programs , 2012, Theor. Comput. Sci..