Conditional Termination of Loops over Heap-Allocated Data

Research Projects
Organizational Units
Journal Issue
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] A. Aiken, J. S. Foster, J. Kodumal, and T. Terauchi. Checking and Inferring Local Non-Aliasing. In Proc. of PLDI'03, pages 129-140. ACM, 2003. [2] E. Albert, P. Arenas, M. Codish, S. Genaim, G. Puebla, and D. Zanardini. Termination Analysis of Java Bytecode. In Proc. of FMOODS'08, volume 5051 of LNCS, pages 2-18. Springer, 2008. [3] E. Albert, P. Arenas, S. Genaim, M. Gómez-Zamalloa, and G. Puebla. Cost Analysis of Concurrent OO programs. In Proc. of APLAS'11, volume 7078 of LNCS, pages 238-254. Springer, 2011. [4] E. Albert, P. Arenas, S. Genaim, and G. Puebla. Field-Sensitive Value Analysis by Field-Insensitive Analysis. In Proc. of FM'09, volume 5850 of LNCS, pages 370-386. Springer, 2009. [5] E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Ramírez. From Object Fields to Local Variables: A Practical Approach to Field-Sensitive Analysis. In Proc. of SAS'10, volume 6337 of LNCS, pages 100-116. Springer, 2010. [6] E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini. Cost Analysis of Java Bytecode. In Proc. of ESOP'07, volume 4421 of LNCS, pages 157-172. Springer, 2007. [7] E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini. Removing Useless Variables in Cost Analysis of Java Bytecode. In Proc. of SAC'08, pages 368-375. ACM Press, 2008. [8] E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini. Cost Analysis of Object- Oriented Bytecode Programs. Theoretical Computer Science, 413(1):142-159, 2012. [9] E. Albert, J. Correas, G. Puebla, and G. Rom_an-Díez. Incremental Resource Usage Analysis. In Proc. of PEPM'12, pages 25-34. ACM Press, 2012. [10] E. Albert, S. Genaim, and G. Román-Díez. Conditional Termination of Loops over Arrays. In Proc. of Bytecode'12, 2012. [11] A. Banerjee, D. Naumann, and S. Rosenberg. Regional Logic for Local Reasoning about Global Invariants. In Proc. of ECOOP'08, volume 5142 of LNCS, pages 387-411, 2008. [12] J. Berdine, B. Cook, D. Distefano, and P. O'Hearn. Automatic termination proofs for programs with shape-shifting heaps. In Proc. of CAV'06, volume 4144 of LNCS, pages 386-400, 2006. [13] M. Bozga, R. Iosif, and F. Konecn_y. Deciding Conditional Termination. In Proc. Of TACAS'12, volume 7214 of LNCS, pages 252-266. Springer, 2012. 33 [14] B-Y. E. Chang and K. R. M. Leino. Abstract Interpretation with Alien Expressions and Heap Structures. In Proc. of VMCAI'05, volume 3385 of LNCS, pages 147-163. Springer, 2005. [15] B. Cook, S. Gulwani, T. Lev-Ami, A. Rybalchenko, and M. Sagiv. Proving Conditional Termination. In Proc. of CAV'08, volume 5123 of LNCS, pages 328-340. Springer, 2008. [16] P. Cousot and R. Cousot. Abstract Interpretation: a Uni_ed Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Proc. of POPL'77, pages 238-252. ACM Press, 1977. [17] P. Cousot and N. Halbwachs. Automatic Discovery of Linear Restraints among Variables of a Program. In Proc. of POPL'78, pages 84-97. ACM Press, 1978. [18] D. Distefano, P. W. O'Hearn, and H.k Yang. A Local Shape Analysis Based on Separation Logic. In Proc. of TACAS'06, volume 3920 of LNCS, pages 287-302. Springer, 2006. [19] P. Ferrara, R. Fuchs, and U. Juhasz. Tval+ : Tvla and value analyses together. In Proc. of SEFM'12, volume 7504 of LNCS, pages 63-77. Springer, 2012. [20] E. B. Johnsen, R. Hähnle, J. Scäfer, R. Schlatte, and M. Ste_en. ABS: A Core Language for Abstract Behavioral Speci_cation. In Proc. of FMCO'10 (Revised Papers), volume 6957 of LNCS, pages 142-164. Springer, 2012. [21] H. Lehner and P. Müller. Formal Translation of Bytecode into BoogiePL. In Proc. of Bytecode'07, ENTCS. Elsevier, 2007. [22] T. Lindholm and F. Yellin. The Java Virtual Machine Speci_cation. Addison-Wesley, 1996. [23] A. Min_e. Field-Sensitive Value Analysis of Embedded C Programs with Union Types and Pointer Arithmetics. In Proc. of LCTES'06, pages 54- 63. ACM, 2006. [24] C. Otto, M. Brockschmidt, C. von Essen, and J. Giesl. Automated Termination Analysis of Java Bytecode by Term Rewriting. In Proc. of RTA'10, volume 6 of LIPIcs, pages 259-276, 2010. [25] A. Podelski and A. Rybalchenko. A complete Method for the Synthesis of Linear Ranking Functions. In Proc. of VMCAI'04, volume 2937 of LNCS, pages 465-486. Springer, 2004. [26] Apache Commons Project. [27] S. Rossignoli and F. Spoto. Detecting Non-Cyclicity by Abstract Compilation into Boolean Functions. In Proc. of VMCAI'06, volume 3855 of LNCS, pages 95-110. Springer, 2006. 34 [28] S. Sagiv, T. W. Reps, and R. Wilhelm. Parametric Shape Analysis via 3-Valued Logic. In Proc. of POPL'99, pages 105-118. ACM, 1999. [29] F. Spoto, P.M. Hill, and E. Payet. Path-Length Analysis of Object- Oriented Programs. In Proc. of EAAI'06, 2006. Available at spoto/papers.html. [30] F. Spoto, F. Mesnard, and _E. Payet. A Termination Analyzer for Java Bytecode based on Path-Length. ACM Transactions on Programming Languages and Systems, 32(3), 2010. [31] R. Vall_ee-Rai, L. Hendren, V. Sundaresan, P. Lam, E. Gagnon, and P. Co. Soot - a Java Optimization Framework. In Proc. of CASCON'99, pages 125-135. IBM, 1999.