Advertisement

Animating the Formalised Semantics of a Java-Like Language

  • Andreas Lochbihler
  • Lukas Bulwahn
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6898)

Abstract

Considerable effort has gone into the techniques of extracting executable code from formal specifications and animating them. We show how to apply these techniques to the large JinjaThreads formalisation. It models a substantial subset of multithreaded Java source and bytecode in Isabelle/HOL and focuses on proofs and modularity whereas code generation was of little concern in its design. Employing Isabelle’s code generation facilities, we obtain a verified Java interpreter that is sufficiently efficient for running small Java programs. To this end, we present refined implementations for common notions such as the reflexive transitive closure and Russell’s definite description operator. From our experience, we distill simple guidelines on how to develop future formalisations with executability in mind.

Keywords

Virtual Machine Introduction Rule Description Operator Code Equation Subtype Relation 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Atkey, R.: CoqJVM: An Executable Specification of the Java Virtual Machine Using Dependent Types. In: Miculan, M., Scagnetto, I., Honsell, F. (eds.) TYPES 2007. LNCS, vol. 4941, pp. 18–32. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  2. 2.
    Ballarin, C.: Interpretation of locales in Isabelle: Theories and proof contexts. In: Borwein, J.M., Farmer, W.M. (eds.) MKM 2006. LNCS (LNAI), vol. 4108, pp. 31–43. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  3. 3.
    Barthe, G., Crégut, P., Grégoire, B., Jensen, T., Pichardie, D.: The MOBIUS proof carrying code infrastructure. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2007. LNCS, vol. 5382, pp. 1–24. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  4. 4.
    Bauer, G., Nipkow, T.: Flyspeck I: Tame graphs. In: Klein, G., Nipkow, T., Paulson, L. (eds.) The Archive of Formal Proofs (2006), http://afp.sourceforge.net/entries/Flyspeck-Tame.shtml, Formal proof development
  5. 5.
    Berghofer, S., Bulwahn, L., Haftmann, F.: Turning inductive into equational specifications. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 131–146. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Bulwahn, L., Krauss, A., Haftmann, F., Erkök, L., Matthews, J.: Imperative functional programming with Isabelle/HOL. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 134–149. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  7. 7.
    Farzan, A., Bevilacqua, V., Roşu, G.: Formal JVM code analysis in JavaFAN. In: Rattray, C., Maharaj, S., Shankland, C. (eds.) AMAST 2004. LNCS, vol. 3116, pp. 147–150. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  8. 8.
    Haftmann, F.: Data refinement (raffinement) in Isabelle/HOL This is a draft of an envisaged publication still to be elaborated which, applying the usual rules of academic confidentiality, can be inspected at, http://www4.in.tum.de/~haftmann/pdf/data_refinement_haftmann.pdf
  9. 9.
    Haftmann, F., Nipkow, T.: Code generation via higher-order rewrite systems. In: Blume, M., Kobayashi, N., Vidal, G. (eds.) FLOPS 2010. LNCS, vol. 6009, pp. 103–117. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  10. 10.
    Klein, G., Nipkow, T.: A machine-checked model for a Java-like language, virtual machine and compiler. ACM Trans. Progr. Lang. Sys. 28, 619–695 (2006)CrossRefGoogle Scholar
  11. 11.
    Lammich, P., Lochbihler, A.: The Isabelle Collections Framework. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 339–354. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  12. 12.
    Leroy, X.: A formally verified compiler back-end. J. Autom. Reasoning 43(4), 363–446 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Letouzey, P.: Extraction in Coq: An overview. In: Beckmann, A., Dimitracopoulos, C., Löwe, B. (eds.) CiE 2008. LNCS, vol. 5028, pp. 359–369. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  14. 14.
    Liu, H., Moore, J.S.: Executable JVM model for analytical reasoning: A study. In: IVME 2003, pp. 15–23. ACM, New York (2003)Google Scholar
  15. 15.
    Lochbihler, A.: Type safe nondeterminism – a formal semantics of Java threads. In: Workshop on Foundations of Object-Oriented Languages, FOOL 2008 (2008)Google Scholar
  16. 16.
    Lochbihler, A.: Verifying a compiler for Java threads. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 427–447. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  17. 17.
    Lochbihler, A.: Jinja with threads. In: Klein, G., Nipkow, T., Paulson, L. (eds.) The Archive of Formal Proofs (2007), http://afp.sourceforge.net/entries/JinjaThreads.shtml, Formal proof development
  18. 18.
    Lochbihler, A.: Formalising FinFuns – generating code for functions as data from Isabelle/HOL. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 310–326. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  19. 19.
    Marić, F.: Formal verification of a modern SAT solver by shallow embedding into Isabelle/HOL. Theor. Comput. Sci. 411(50), 4333–4356 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  20. 20.
    Thiemann, R., Sternagel, C.: Certification of termination proofs using CeTA. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 452–468. Springer, Heidelberg (2009)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Andreas Lochbihler
    • 1
  • Lukas Bulwahn
    • 2
  1. 1.Karlsruher Institut für TechnologieGermany
  2. 2.Technische Universität MünchenGermany

Personalised recommendations