Imperative Functional Programming with Isabelle/HOL

  • Lukas Bulwahn
  • Alexander Krauss
  • Florian Haftmann
  • Levent Erkök
  • John Matthews
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5170)


We introduce a lightweight approach for reasoning about programs involving imperative data structures using the proof assistant Isabelle/HOL. It is based on shallow embedding of programs, a polymorphic heap model using enumeration encodings and type classes, and a state-exception monad similar to known counterparts from Haskell. Existing proof automation tools are easily adapted to provide a verification environment. The framework immediately allows for correct code generation to ML and Haskell. Two case studies demonstrate our approach: An array-based checker for resolution proofs, and a more efficient bytecode verifier.


Virtual Machine Recursive Function Proof Obligation Elimination Rule Hoare Logic 
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.
    Boyer, R.S., Moore, J.S.: Single-threaded objects in ACL2. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, pp. 9–27. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  2. 2.
    Een, N., Sörensson, N.: An extensible sat-solver. In: Goos, G., Hartmanis, J., van Leeuwen, J. (eds.) SAT 2003. LNCS, vol. 2919, p. 502. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  3. 3.
    Filliâtre, J.-C., Marché, C.: The Why/Krakatoa/Caduceus platform for deductive program verification. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  4. 4.
    Haftmann, F., Nipkow, T.: A code generator framework for Isabelle/HOL. Technical Report 364/07, Department of Computer Science, University of Kaiserslautern (August 2007)Google Scholar
  5. 5.
    Huffman, B., Matthews, J., White, P.: Axiomatic constructor classes in Isabelle/HOLCF. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 147–162. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. 6.
    Jones, S.P., Launchbury, J.: Lazy functional state threads. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 24–35 (1994)Google Scholar
  7. 7.
    Klein, G., Nipkow, T.: A machine-checked model for a Java-like language, virtual machine and compiler. ACM Trans. Program. Lang. Syst. 28(4), 619–695 (2006)CrossRefGoogle Scholar
  8. 8.
    Krstić, S., Matthews, J.: Verifying BDD algorithms through monadic interpretation. In: Cortesi, A. (ed.) VMCAI 2002. LNCS, vol. 2294, pp. 182–195. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  9. 9.
    Müller, O., Nipkow, T., Oheimb, D.V., Slotosch, O.: HOLCF = HOL + LCF. Journal of Functional Programming 9, 191–223 (1999)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Nanevski, A., Morrisett, G., Birkedal, L.: Polymorphism and separation in hoare type theory. In: ICFP 2006: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming, pp. 62–73. ACM Press, New York (2006)CrossRefGoogle Scholar
  11. 11.
    Nipkow, T., Paulson, L.C., Wenzel, M.T.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)zbMATHGoogle Scholar
  12. 12.
    Obua, S.: Partizan games in Isabelle/HOLZF. In: Barkaoui, K., Cavalcanti, A., Cerone, A. (eds.) ICTAC 2006. LNCS, vol. 4281, pp. 272–286. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  13. 13.
    Jones, S.P., Wadler, P.: Imperative functional programming. In: Proc. 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 1993), pp. 71–84 (1993)Google Scholar
  14. 14.
    Schirmer, N.: A verification environment for sequential imperative programs in Isabelle/HOL. In: Baader, F., Voronkov, A. (eds.) Logic for Programming, Artificial Intelligence, and Reasoning, vol. 3452, pp. 398–414. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  15. 15.
    Sprenger, C., Basin, D.A.: A monad-based modeling and verification toolbox with application to security protocols. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 302–318. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  16. 16.
    Tuch, H., Klein, G., Norrish, M.: Types, bytes, and separation logic. In: Hofmann, M., Felleisen, M. (eds.) Proc. 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2007), Nice, France, January 2007, pp. 97–108 (2007)Google Scholar
  17. 17.
    Weber, T., Amjad, H.: Efficiently checking propositional refutations in HOL theorem provers. Journal of Applied Logic (to appear, 2007)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Lukas Bulwahn
    • 1
  • Alexander Krauss
    • 1
  • Florian Haftmann
    • 1
  • Levent Erkök
    • 2
  • John Matthews
    • 2
  1. 1.Institut für InformatikTechnische Universität MünchenGarchingGermany
  2. 2.Galois Inc.BeavertonUSA

Personalised recommendations