Conditional termination of loops over heap-allocated data

Static analysis which takes into account the values of data stored in the heap is considered complex and computationally intractable in practice. Thus, most static analyzers do not keep track of object fields nor of array contents, i.e., they are heap-insensitive. In this article, we propose locality conditions for soundly tracking heap-allocated data in Java (bytecode) programs, by means of ghost non-heap allocated variables. This way, heap-insensitive analysis over the transformed program can infer information on the original heap-allocated data without sacrificing efficiency. If the locality conditions cannot be proven unconditionally, we seek to generate aliasing preconditions which, when they hold in the initial state, guarantee the termination of the program. Experimental results show that we greatly improve the accuracy w.r.t. a heap-insensitive analysis while the overhead introduced is reasonable.

[1]  Reinhard Wilhelm,et al.  Parametric shape analysis via 3-valued logic , 1999, POPL '99.

[2]  Étienne Payet,et al.  Path-Length Analysis for Object-Oriented Programs , 2006 .

[3]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[4]  Marius Bozga,et al.  Deciding Conditional Termination , 2012, TACAS.

[5]  Fausto Spoto,et al.  Detecting Non-cyclicity by Abstract Compilation into Boolean Functions , 2006, VMCAI.

[6]  Alexander Aiken,et al.  Checking and inferring local non-aliasing , 2003, PLDI '03.

[7]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[8]  Elvira Albert,et al.  Cost Analysis of Java Bytecode , 2007, ESOP.

[9]  Bor-Yuh Evan Chang,et al.  Abstract Interpretation with Alien Expressions and Heap Structures , 2005, VMCAI.

[10]  Peter Müller,et al.  Formal Translation of Bytecode into BoogiePL , 2007, Electron. Notes Theor. Comput. Sci..

[11]  Andreas Podelski,et al.  A Complete Method for the Synthesis of Linear Ranking Functions , 2004, VMCAI.

[12]  Christian von Essen,et al.  Automated Termination Analysis of Java Bytecode by Term Rewriting , 2010, RTA.

[13]  Étienne Payet,et al.  A termination analyzer for Java bytecode based on path-length , 2010, TOPL.

[14]  Elvira Albert,et al.  Field-Sensitive Value Analysis by Field-Insensitive Analysis , 2009, FM.

[15]  Elvira Albert,et al.  Removing useless variables in cost analysis of Java bytecode , 2008, SAC '08.

[16]  Elvira Albert,et al.  Incremental resource usage analysis , 2012, PEPM '12.

[17]  Reiner Hähnle,et al.  ABS: A Core Language for Abstract Behavioral Specification , 2010, FMCO.

[18]  Laurie Hendren,et al.  Soot---a java optimization framework , 1999 .

[19]  Elvira Albert,et al.  Cost Analysis of Concurrent OO Programs , 2011, APLAS.

[20]  Elvira Albert,et al.  Termination Analysis of Java Bytecode , 2008, FMOODS.

[21]  Sumit Gulwani,et al.  Proving Conditional Termination , 2008, CAV.

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

[23]  Pietro Ferrara,et al.  TVAL+ : TVLA and Value Analyses Together , 2012, SEFM.

[24]  Peter W. O'Hearn,et al.  Automatic Termination Proofs for Programs with Shape-Shifting Heaps , 2006, CAV.

[25]  Anindya Banerjee,et al.  Regional Logic for Local Reasoning about Global Invariants , 2008, ECOOP.

[26]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[27]  Elvira Albert,et al.  From Object Fields to Local Variables: A Practical Approach to Field-Sensitive Analysis , 2010, SAS.

[28]  Peter W. O'Hearn,et al.  A Local Shape Analysis Based on Separation Logic , 2006, TACAS.