Verification of Java Bytecode Using Analysis and Transformation of Logic Programs

  • Elvira Albert
  • Miguel Gómez-Zamalloa
  • Laurent Hubert
  • Germán Puebla
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4354)

Abstract

State of the art analyzers in the Logic Programming (LP) paradigm are nowadays mature and sophisticated. They allow inferring a wide variety of global properties including termination, bounds on resource consumption, etc. The aim of this work is to automatically transfer the power of such analysis tools for LP to the analysis and verification of Java bytecode (jvml). In order to achieve our goal, we rely on well-known techniques for meta-programming and program specialization. More precisely, we propose to partially evaluate a jvml interpreter implemented in LP together with (an LP representation of) a jvml program and then analyze the residual program. Interestingly, at least for the examples we have studied, our approach produces very simple LP representations of the original jvml programs. This can be seen as a decompilation from jvml to high-level LP source. By reasoning about such residual programs, we can automatically prove in the CiaoPP system some non-trivial properties of jvml programs such as termination, run-time error freeness and infer bounds on its resource consumption. We are not aware of any other system which is able to verify such advanced properties of Java bytecode.

References

  1. 1.
    Barras, B., et al.: The Coq proof assistant reference manual: Version 6.1. Technical Report RT-0203 (1997), citeseer.ist.psu.edu/barras97coq.html
  2. 2.
    Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López, P., Puebla, G. (eds.): The Ciao System (v1.13), http://www.clip.dia.fi.upm.es/Software/Ciao/
  3. 3.
    Cousot, P., Cousot, R.: Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Proc. of POPL 1977, pp. 238–252 (1977)Google Scholar
  4. 4.
    Debray, S., López, P., Hermenegildo, M., Lin, N.: Estimating the Computational Cost of Logic Programs. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864, pp. 255–265. Springer, Heidelberg (1994)Google Scholar
  5. 5.
    Früwirth, T., Shapiro, E., Vardi, M.Y., Yardeni, E.: Logic programs as types for logic programs. In: Proc. LICS 1991, pp. 300–309 (1991)Google Scholar
  6. 6.
    Futamura, Y.: Partial evaluation of computation process - an approach to a compiler-compiler. Systems, Computers, Controls 2(5), 45–50 (1971)Google Scholar
  7. 7.
    Gallagher, J.: Transforming logic programs by specializing interpreters. In: Proc. of the 7th. European Conference on Artificial Intelligence (1986)Google Scholar
  8. 8.
    Henriksen, K.S., Gallagher, J.P.: Analysis and specialisation of a pic processor. In: SMC (2), pp. 1131–1135. IEEE, Los Alamitos (2004)Google Scholar
  9. 9.
    Hermenegildo, M., Puebla, G., Bueno, F., López, P.: Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation. Science of Computer Programming 58(1–2), 115–140 (2005)MATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, New York (1993)MATHGoogle Scholar
  11. 11.
    Leuschel, M.: On the power of homeomorphic embedding for online termination. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 230–245. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  12. 12.
    Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. A-W (1996)Google Scholar
  13. 13.
    Peralta, J.C., Gallagher, J., Sağlam, H.: Analysis of imperative programs through analysis of CLP. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 246–261. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  14. 14.
    Pichardie, D.: Bicolano (Byte Code Language in cOq), http://www-sop.inria.fr/everest/personnel/David.Pichardie/bicolano/main.html
  15. 15.
    Puebla, G., Albert, E., Hermenegildo, M.: Abstract Interpretation with Specialized Definitions. In: Yi, K. (ed.) SAS 2006. LNCS, vol. 4134, Springer, Heidelberg (2006)CrossRefGoogle Scholar
  16. 16.
    Puebla, G., Bueno, F., Hermenegildo, M.: An Assertion Language for CLP. In: Deransart, P., Małuszyński, J. (eds.) DiSCiPl 1999. LNCS, vol. 1870, pp. 23–61. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  17. 17.
    Ross, B.J.: The partial evaluation of imperative programs using prolog. In: META, pp. 341–363 (1988)Google Scholar
  18. 18.
    Vaucheret, C., Bueno, F.: More Precise yet Efficient Type Inference for Logic Programs. In: Hermenegildo, M.V., Puebla, G. (eds.) SAS 2002. LNCS, vol. 2477, pp. 102–116. Springer, Heidelberg (2002)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Elvira Albert
    • 1
  • Miguel Gómez-Zamalloa
    • 1
  • Laurent Hubert
    • 2
  • Germán Puebla
    • 2
  1. 1.DSIC, Complutense University of MadridMadridSpain
  2. 2.CLIP, Technical University of MadridMadridSpain

Personalised recommendations