A Bytecode Logic for JML and Types

  • Lennart Beringer
  • Martin Hofmann
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4279)


We present a program logic for virtual machine code that may serve as a suitable target for different proof-transforming compilers. Compilation from JML-specified source code is supported by the inclusion of annotations whose interpretation extends to non-terminating computations. Compilation from functional languages, and the communication of results from intermediate level program analysis phases are facilitated by a new judgement format that admits the compositionality of type systems to be reflected in derivations. This makes the logic well suited to serve as a language in which proofs of a PCC architecture are expressed. We substantiate this claim by presenting the compositional encoding of a type system for bounded heap consumption. Both the soundness proof of the logic and the derivation of the type system have been formally verified by an implementation in Isabelle/HOL.


Program Logic Type System Operational Semantic Proof System Program Point 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ábrahám, E., de Boer, F.S., de Roever, W.P., Steffen, M.: An assertion-based proof system for multithreaded Java. Theoretical Computer Science 331(2-3), 251–290 (2005)MATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Nanevski, L.B.A., Morrisett, G.: Polymorphism and Separation in Hoare Type Theory. In: Proceedings of the 11th ACM International Conference on Functional Programming (ICFP 2006). ACM Press, New York (2006)Google Scholar
  3. 3.
    Appel, A.W.: SSA is functional programming. ACM SIGPLAN Notices 33(4), 17–20 (1998)CrossRefMathSciNetGoogle Scholar
  4. 4.
    Appel, A.W.: Foundational proof-carrying code. In: Proceedings of the 16th Annual IEEE Symposium on Logic in Computer Science (LICS). IEEE Computer Society, Los Alamitos (2001)Google Scholar
  5. 5.
    Aspinall, D., Beringer, L., Hofmann, M., Loidl, H.-W., Momigliano, A.: A program logic for resource verification. In: Slind, K., Bunker, A., Gopalakrishnan, G.C. (eds.) TPHOLs 2004. LNCS, vol. 3223, pp. 34–49. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  6. 6.
    Aspinall, D., Beringer, L., Momigliano, A.: Optimisation validation. In: Knoop, J., Necula, G.C., Zimmermann, W. (eds.) Proceedings of the 5th International Workshop on Compiler Optimization Meets Compiler Verification (COCV 2006). ENTCS. Elsevier, Amsterdam (to appear, 2006)Google Scholar
  7. 7.
    Bannwart, F.Y., Müller, P.: A logic for bytecode. In: Spoto, F. (ed.) Bytecode Semantics, Verification, Analysis and Transformation (BYTECODE). ENTCS, vol. 141(1), pp. 255–273. Elsevier, Amsterdam (2005)Google Scholar
  8. 8.
    Barthe, G.: Mobius – Mobility, Ubiquity and Security, http://mobius.inria.fr
  9. 9.
    Beckert, B., Schlager, S.: A sequent calculus for first-order dynamic logic with trace modalities. In: Goré, R.P., Leitsch, A., Nipkow, T. (eds.) IJCAR 2001. LNCS (LNAI), vol. 2083, pp. 626–641. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  10. 10.
    Benton, N.: Simple relational correctness proofs for static analyses and program transformations. In: Jones, N.D., Leroy, X. (eds.) Proceedings of the 31st ACM Symposium on Principles of Programming Languages, POPL 2004, Venice, Italy, pp. 14–25. ACM, New York (2004)CrossRefGoogle Scholar
  11. 11.
    Benton, N.: A typed, compositional logic for a stack-based abstract machine. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 364–380. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  12. 12.
    Beringer, L., Hofmann, M.: A bytecode logic for JML and types – Isabelle/HOL sources (2006), http://www.tcs.ifi.lmu.de/~beringer/BytecodeLogic.tar.gz
  13. 13.
    Beringer, L., Hofmann, M., Momigliano, A., Shkaravska, O.: Automatic certification of heap consumption. In: Baader, F., Voronkov, A. (eds.) LPAR 2004. LNCS (LNAI), vol. 3452, pp. 347–362. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  14. 14.
    Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. International Journal on Software Tools for Technology Transfer 7(3), 212–232 (2005)CrossRefGoogle Scholar
  15. 15.
    Cachera, D., Jensen, T.P., Pichardie, D., Schneider, G.: Certified memory usage analysis. In: Fitzgerald, J.S., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 91–106. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  16. 16.
    Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems (TOPLAS) 13(4) (October 1991)Google Scholar
  17. 17.
    Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for java. In: PLDI 2002: Proceedings of the ACM Conference on Programming language design and implementation, pp. 234–245. ACM Press, New York (2002)CrossRefGoogle Scholar
  18. 18.
    Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: PLDI 1993: Proceedings of the ACM Conference on Programming language design and implementation, pp. 237–247. ACM Press, New York (1993)CrossRefGoogle Scholar
  19. 19.
    Hähnle, R., Mostowski, W.: Verification of safety properties in the presence of transactions. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 151–171. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  20. 20.
    Hofmann, M., Jost, S.: Static prediction of heap space usage for first-order functional programs. In: POPL 2003: Proceedings of the 30th ACM Symposium on Principles of programming languages, pp. 185–197. ACM Press, New York (2003)CrossRefGoogle Scholar
  21. 21.
    Jacobs, B., Poll, E.: A logic for the java modeling language JML. In: Hußmann, H. (ed.) FASE 2001. LNCS, vol. 2029, pp. 284–299. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  22. 22.
    Jones, C.B.: Systematic Software Development Using VDM, 2nd edn. Prentice-Hall, Englewood Cliffs (1990)MATHGoogle Scholar
  23. 23.
    Kelsey, R.A.: A correspondence between continuation passing style and static single assignment form. ACM SIGPLAN Notices 30(3), 13–22 (1995)CrossRefGoogle Scholar
  24. 24.
    Kleymann, T.: Hoare Logic and VDM: Machine-Checked Soundness and Completeness Proofs. PhD thesis, LFCS, University of Edinburgh (1998)Google Scholar
  25. 25.
    Leavens, G.T., Poll, E., Clifton, C., Cheon, Y., Ruby, C., Cok, D., Müller, P., Kiniry, J.: JML Reference Manual (draft) (May 2006), http://www.cs.iastate.edu/~leavens/JML
  26. 26.
    Leino, K.R.M., Stata, R.: Checking object invariants. Technical Report #1997-007, Digital Equipment Corporation Systems Research Center, Palo Alto, USA (1997)Google Scholar
  27. 27.
    Nanevski, A., Morrisett, G.: Dependent type theory of stateful higher-order functions. Technical Report TR-24-05, Harvard University (2005)Google Scholar
  28. 28.
    Necula, G.C.: Proof-carrying code. In: POPL 1997: Proceedings of the 24th ACM Symposium on Principles of programming languages, pp. 106–119. ACM Press, New York (1997)CrossRefGoogle Scholar
  29. 29.
    Nipkow, T.: Hoare logics for recursive procedures and unbounded nondeterminism. In: Bradfield, J.C. (ed.) CSL 2002 and EACSL 2002. LNCS, vol. 2471, pp. 103–119. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  30. 30.
    Pichardie, D.: Bicolano – Byte Code Language in Coq (2006), http://www-sop.inria.fr/everest/personnel/David.Pichardie/bicolano/main.html
  31. 31.
    Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: Proceedings of the 17th IEEE Symposium on Logic in Computer Science (LICS 2002)., pp. 55–74. IEEE Computer Society, Los Alamitos (2002)CrossRefGoogle Scholar
  32. 32.
    Rinard, M., Marinov, D.: Credible compilation with pointers. In: Proceedings of the FLoC Workshop on Run-Time Result Verification (July 1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Lennart Beringer
    • 1
  • Martin Hofmann
    • 1
  1. 1.Institut für InformatikUniversität MünchenMünchenGermany

Personalised recommendations