A simple and scalable static analysis for bound analysis and amortized complexity analysis

We present the first scalable bound analysis that achieves amortized complexity analysis. In contrast to earlier work, our bound analysis is not based on general purpose reasoners such as abstract interpreters, software model checkers or computer algebra tools. Rather, we derive bounds directly from abstract program models, which we obtain from programs by comparatively simple invariant generation and symbolic execution techniques. As a result, we obtain an analysis that is more predictable and more scalable than earlier approaches. We demonstrate by a thorough experimental evaluation that our analysis is fast and at the same time able to compute bounds for challenging loops in a large real-world benchmark. Technically, our approach is based on lossy vector addition systems (VASS). Our bound analysis first computes a lexicographic ranking function that proves the termination of a VASS, and then derives a bound from this ranking function. Our methodology achieves amortized analysis based on a new insight how lexicographic ranking functions can be used for bound analysis.

[1]  Florian Zuleger,et al.  Ramsey vs. Lexicographic Termination Proving , 2013, TACAS.

[2]  R. Tarjan Amortized Computational Complexity , 1985 .

[3]  Sumit Gulwani,et al.  A combination framework for tracking partition sizes , 2009, POPL '09.

[4]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[5]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[6]  Jürgen Giesl,et al.  Alternating Runtime and Size Complexity Analysis of Integer Programs , 2014, TACAS.

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

[8]  Henny B. Sipma,et al.  Linear Ranking with Reachability , 2005, CAV.

[9]  Marc Brockschmidt,et al.  Better Termination Proving through Cooperation , 2013, CAV.

[10]  Sumit Gulwani,et al.  Bound Analysis using Backward Symbolic Execution , 2009 .

[11]  Sumit Gulwani,et al.  Control-flow refinement and progress invariants for bound analysis , 2009, PLDI '09.

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

[13]  Sumit Gulwani,et al.  A Numerical Abstract Domain Based on Expression Abstraction and Max Operator with Application in Timing Analysis , 2008, CAV.

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

[15]  Ahmed Bouajjani,et al.  Model Checking Lossy Vector Addition Systems , 1999, STACS.

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

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

[18]  Samir Genaim,et al.  On the Limits of the Classical Approach to Cost Analysis , 2012, SAS.

[19]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[20]  Martin Hofmann,et al.  Static prediction of heap space usage for first-order functional programs , 2003, POPL '03.

[21]  Paul Feautrier,et al.  Multi-dimensional Rankings, Program Termination, and Complexity Bounds of Flowchart Programs , 2010, SAS.

[22]  Des Watson,et al.  A study of irreducibility in C programs , 2012, Softw. Pract. Exp..

[23]  Elvira Albert,et al.  On the Inference of Resource Usage Upper and Lower Bounds , 2013, TOCL.

[24]  Peter Lee,et al.  Automatic numeric abstractions for heap-manipulating programs , 2010, POPL '10.