Termination Analysis of Java Bytecode

  • Elvira Albert
  • Puri Arenas
  • Michael Codish
  • Samir Genaim
  • Germán Puebla
  • Damiano Zanardini
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5051)


Termination analysis has received considerable attention, traditionally in the context of declarative programming, and recently also for imperative languages. In existing approaches, termination is performed on source programs. However, there are many situations, including mobile code, where only the compiled code is available. In this work we present an automatic termination analysis for sequential Java Bytecode programs. Such analysis presents all of the challenges of analyzing a low-level language as well as those introduced by object-oriented languages. Interestingly, given a bytecode program, we produce a constraint logic program, CLP, whose termination entails termination of the bytecode program. This allows applying the large body of work in termination of CLP programs to termination of Java bytecode. A prototype analyzer is described and initial experimentation is reported.


Basic Block Ranking Function Nest Loop Control Flow Graph Monotonicity Constraint 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: Cost analysis of Java Bytecode. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, Springer, Heidelberg (2007)CrossRefGoogle Scholar
  2. 2.
    Allen, F.: Control flow analysis. In: Symp. on Compiler optimization (1970)Google Scholar
  3. 3.
    Bagnara, R., Ricci, E., Zaffanella, E., Hill, P.: Possibly not closed convex polyhedra and the Parma Polyhedra Library. In: Hermenegildo, M.V., Puebla, G. (eds.) SAS 2002. LNCS, vol. 2477, Springer, Heidelberg (2002)CrossRefGoogle Scholar
  4. 4.
    Benoy, F., King, A.: Inferring Argument Size Relationships with CLP(R). In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 204–223. Springer, Heidelberg (1997)Google Scholar
  5. 5.
    Berdine, J., Cook, B., Distefano, D., O’Hearn, P.: Automatic termination proofs for programs with shape-shifting heaps. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, Springer, Heidelberg (2006)CrossRefGoogle Scholar
  6. 6.
    Bradley, A., Manna, Z., Sipma, H.: Termination of polynomial programs. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, Springer, Heidelberg (2005)Google Scholar
  7. 7.
    Brodsky, A., Sagiv, Y.: Inference of Inequality Constraints in Logic Programs. In: Proceedings of PODS 1991, pp. 95–112. ACM Press, New York (1991)Google Scholar
  8. 8.
    Brotherston, J., Bornat, R., Calcagno, C.: Cyclic proofs of program termination in separation logic. In: Proceedings of POPL-35 (January 2008)Google Scholar
  9. 9.
    Bruynooghe, M., Codish, M., Gallagher, J., Genaim, S., Vanhoof, W.: Termination analysis of logic programs through combination of type-based norms. ACM TOPLAS 29(2) (2007)Google Scholar
  10. 10.
    Codish, M., Taboch, C.: A semantic basis for the termination analysis of logic programs. J. Log. Program. 41(1), 103–123 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    Cook, B., Podelski, A., Rybalchenko, A.: Termination proofs for systems code. In: PLDI (2006)Google Scholar
  12. 12.
    Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: Proc. POPL. ACM Press, New York (1978)Google Scholar
  13. 13.
    DeLine, R., Leino, R.: BoogiePL: A typed procedural language for checking object-oriented programs. Technical Report MSR-TR-2005-70, Microsoft (2005)Google Scholar
  14. 14.
    Genaim, S., Spoto, F.: Technical report, Personal Communication (2007)Google Scholar
  15. 15.
    Giesl, J., Schneider-Kamp, P., Thiemann, R.: AProVE 1.2: Automatic Termination Proofs in the Dependency Pair Framework. In: Furbach, U., Shankar, N. (eds.) IJCAR 2006. LNCS (LNAI), vol. 4130, Springer, Heidelberg (2006)CrossRefGoogle Scholar
  16. 16.
    Jaffar, J., Maher, M.: Constraint Logic Programming: A Survey. Journal of Logic Programming 19(20), 503–581 (1994)CrossRefMathSciNetGoogle Scholar
  17. 17.
    Lee, C., Jones, N., Ben-Amram, A.: The size-change principle for program termination. In: Proc. POPL. ACM Press, New York (2001)Google Scholar
  18. 18.
    Lindenstrauss, N., Sagiv, Y.: Automatic termination analysis of logic programs. In: ICLP (1997)Google Scholar
  19. 19.
    Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. A-W (1996)Google Scholar
  20. 20.
    Necula, G.: Proof-Carrying Code. In: POPL 1997. ACM Press, New York (1997)Google Scholar
  21. 21.
    Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937. Springer, Heidelberg (2004)Google Scholar
  22. 22.
    Rossignoli, S., Spoto, F.: Detecting Non-Cyclicity by Abstract Compilation into Boolean Functions. In: Emerson, E.A., Namjoshi, K.S. (eds.) VMCAI 2006. LNCS, vol. 3855. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  23. 23.
    Secci, S., Spoto, F.: Pair-sharing analysis of object-oriented programs. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 320–335. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  24. 24.
    Spoto, F., Hill, P.M., Payet, E.: Path-length analysis for object-oriented programs. In: Proc. EAAI (2006)Google Scholar
  25. 25.
    Spoto, F., Jensen, T.: Class analyses as abstract interpretations of trace semantics. ACM Trans. Program. Lang. Syst. 25(5), 578–630 (2003)CrossRefGoogle Scholar
  26. 26.
    Vallee-Rai, R., Hendren, L., Sundaresan, V., Lam, P., Gagnon, E., Co, P.: Soot - a Java optimization framework. In: Proc. of CASCON 1999, pp. 125–135 (1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Elvira Albert
    • 1
  • Puri Arenas
    • 1
  • Michael Codish
    • 2
  • Samir Genaim
    • 3
  • Germán Puebla
    • 3
  • Damiano Zanardini
    • 3
  1. 1.DSICComplutense University of Madrid (UCM)Spain
  2. 2.CSBen-Gurion University of the NegevIsrael
  3. 3.CLIPTechnical University of Madrid (UPM)Spain

Personalised recommendations