Compiling Higher Order Logic by Proof

  • Konrad Slind
  • Guodong Li
  • Scott Owens


We discuss the front end of a compiler whose source language is a subset of higher order logic. The compiler operates by a series of source-to-source transformations in which each transformation step performs a proof showing that the new program is equal to the old; consequently, the end result of compilation is formally deduced from the input. For the most part, compilation is accomplished by rewriting. An important feature of this approach is that properties proved of input programs immediately hold for the code generated by the compiler, which allows high-level proofs of low-level code.


Operational Semantic Deductive System Source Language Proof Assistant High Order 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.
    Augustsson L (1985) Compiling pattern matching. In: Jouannnaud JP (ed) Conference on functional programming languages and computer architecture (LNCS 201) (Nancy, France), pp 368–381Google Scholar
  2. 2.
    Balakrishnan G, Reps TW, Melski D, Teitelbaum T (2005) Wysinwyx: what you see is not what you execute. In: Meyer B, Woodcock J (eds) VSTTE, Lecture notes in computer science, vol 4171. Springer, Berlin, pp 202–213Google Scholar
  3. 3.
    Barras B (2000) Proving and computing in HOL. In: Proceedings of TPHOLs 2000, LNCS, vol 1869. Springer, Berlin, pp 17–37Google Scholar
  4. 4.
    Benton N, Zarfaty U (2009) Formalizing and verifying semantic type soundness of a simple compiler. In: International conference on principles and practice of declarative programming (PPDP)Google Scholar
  5. 5.
    Bertot Y, Caste’ran P (2004) Interactive theorem proving and program development: Coq’art: the calculus of inductive constructions. Texts in theoretical computer science, An EATCS series. Springer, BerlinGoogle Scholar
  6. 6.
    Bishop S, Fairbairn M, Norrish M, Sewell P, Smith M, Wansbrough K (2005) Rigorous specification and conformance testing techniques for network protocols, as applied to TCP, UDP, and Sockets. In: Proceedings of SIGCOMM. ACM, New York, NYGoogle Scholar
  7. 7.
    Blazy S, Dargaye Z, Leroy X (2006) Formal verification of a C compiler front-end. In: 14th International symposium on formal methods (FM 2006), Hamilton, CanadaGoogle Scholar
  8. 8.
    Chlipala A (2007) A certified type-preserving compiler from lambda calculus to assembly language. In: Conference on programming language design and implementation (PLDI’07)Google Scholar
  9. 9.
    Church A (1940) A formulation of the simple theory of types. J Symbolic Log 5:56–68MATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Conchon S, Filliatre J-C (2007) A persistent union-find data structure. In: 2007 ACM SIGPLAN workshop on ML (Freiburg, Germany), October 2007Google Scholar
  11. 11.
    Dave MA (2003) Compiler verification: a bibliography. ACM SIGSOFT Softw Eng Notes 28(6):2CrossRefGoogle Scholar
  12. 12.
    Gordon M, Melham T (1993) Introduction to HOL, a theorem proving environment for higher order logic. Cambridge University Press, CambridgeMATHGoogle Scholar
  13. 13.
    Gordon M, Milner R, Wadsworth C (1979) Edinburgh LCF: a mechanised logic of computation, Lecture notes in computer science, vol 78. Springer, BerlinGoogle Scholar
  14. 14.
    Gordon M, Iyoda J, Owens S, Slind K (2005) Automatic formal synthesis of hardware from higher order logic. In: Proceedings of fifth international workshop on automated verification of critical systems (AVoCS), ENTCS, vol 145Google Scholar
  15. 15.
    Gordon MJC, Hunt WA, Kaufmann M, Reynolds J (2006a) An embedding of the ACL2 logic in HOL. In: Proceedings of ACL2 2006, ACM international conference proceeding series, vol 205. ACM, New York, NY, pp 40–46Google Scholar
  16. 16.
    Gordon MJC, Reynolds J, Hunt WA, Kaufmann M (2006b) An integration of HOL and ACL2. In: Proceedings of FMCAD 2006. IEEE Computer Society, Washington, DC, pp 153–160Google Scholar
  17. 17.
    Hannan J, Pfenning F (1992) Compiler verification in LF. In: Proceedings of the 7th symposium on logic in computer scienceGoogle Scholar
  18. 18.
    Harrison J (1995) Inductive definitions: automation and application. In: Schubert ET, Windley PJ, Alves-Foss J (eds) Proceedings of the 1995 international workshop on higher order logic theorem proving and its applications (Aspen Grove, Utah), LNCS, vol 971. Springer, Berlin, pp 200–213Google Scholar
  19. 19.
    Harrison J (1998) Theorem proving with the real numbers. CPHC/BCS distinguished dissertations, Springer, BerlinMATHGoogle Scholar
  20. 20.
    Hickey J, Nogin A (2006) Formal compiler construction in a logical framework. High Order Symbolic Comput 19(2–3):197–230MATHCrossRefGoogle Scholar
  21. 21.
    Kaufmann M, Manolios P, Moore JS (2000) Computer-aided reasoning: an approach. Kluwer, DordrechtGoogle Scholar
  22. 22.
    Klein G, Nipkow T (2006) A machine-checked model for a Java-like language, virtual machine and compiler. TOPLAS 28(4):619–695 619–695CrossRefGoogle Scholar
  23. 23.
    Krauss K (2009) Automating recursive definitions and termination proofs in higher order logic. PhD thesis, Institut für Informatik, Technische Universität MünchenGoogle Scholar
  24. 24.
    Leinenbach D, Paul W, Petrova E (2005) Towards the formal verification of a C0 compiler: code generation and implementation correctness. In: 4th IEEE international conference on software engineering and formal methods (SEFM 2006)Google Scholar
  25. 25.
    Leroy X (2006) Formal certification of a compiler backend, or: programming a compiler with a proof assistant. In: Proceedings of POPL 2006. ACM, New York, NYGoogle Scholar
  26. 26.
    Leroy X (2009) Formal verification of a realistic compiler. Commun ACM 52(7):107–115CrossRefGoogle Scholar
  27. 27.
    Li G, Slind K (2007) Compilation as rewriting in higher order logic. In: Conference on automated deduction (CADE-21), July 2007Google Scholar
  28. 28.
    Li G, Owens S, Slind K (2007) Structure of a proof-producing compiler for a subset of higher order logic. In: 16th European symposium on programming (ESOP’07)Google Scholar
  29. 29.
    Meyer T, Wolff B (2004) Tactic-based optimized compilation of functional programs. In: Filli\hat{a}tre J-C, Paulin-Mohring C, Werner B (eds) TYPES 2004. Springer, HeidelbergGoogle Scholar
  30. 30.
    Myreen M (2009) Formal verification of machine-code programs. PhD thesis, University of CambridgeGoogle Scholar
  31. 31.
    Myreen M, Gordon M (2007) Hoare logic for realistically modelled machine code. In: Proceedings of TACAS 2007, LNCS vol 4424. Springer, BerlinGoogle Scholar
  32. 32.
    Myreen M, Slind K, Gordon M (2009) Extensible proof-producing compilation. In: de Moor O, Schwartzbach M (eds) Compiler construction, LNCS, vol 5501. Springer, HeidelbergGoogle Scholar
  33. 33.
    Nipkow T, Paulson LC, Wenzel M (2002) Isabelle/HOL – a proof assistant for higher-order logic, LNCS, vol 2283. Springer, BerlinGoogle Scholar
  34. 34.
    Norrish M (2008) A formal semantics for C +  + . In: Informal proceedings of TTVSIGoogle Scholar
  35. 35.
    Norrish M, Slind K (2009) The HOL system: logic, 1998–2009. At
  36. 36.
    Owens S (2008) A sound semantics for OCaml-Light, In: Proceedings of ESOP 2008, LNCS, vol 4960. Springer, BerlinGoogle Scholar
  37. 37.
    Owre S, Rushby JM, Shankar N, Stringer-Calvert DJ (1998) PVS system guide. SRI Computer Science Laboratory, Menlo Park, CA. Available at
  38. 38.
    Paulson L (1983) A higher order implementation of rewriting. Sci Comput Program 3:119–149MATHCrossRefMathSciNetGoogle Scholar
  39. 39.
    Pfenning F, Elliot C (1988) Higher order abstract syntax. In: Proceedings of PLDI. ACM, New York, NY, pp 199–208Google Scholar
  40. 40.
    Pnueli A, Siegel M, Singerman E (1998) Translation validation. In: Proceedings of TACAS’98, Lecture notes in computer science, vol 1384. Springer, Berlin, pp 151–166Google Scholar
  41. 41.
    Rideau L, Serpette B, Leroy X (2008) Tilting at windmills with Coq: formal verification of a compilation algorithm for parallel moves. J Autom Reason 40(4):307–326MATHCrossRefMathSciNetGoogle Scholar
  42. 42.
    Ridge T (2009) Verifying distributed systems: the operational approach. In: Shao Z, Pierce BC (eds) Proceedings of the 36th ACM SIGPLAN-SIGACT symposium on principles of programming languages, POPL 2009, Savannah, GA, USA, January 21–23, 2009. ACM, New York, NY, pp 429–440Google Scholar
  43. 43.
    Sewell P, Nardelli F, Owens S, Peskine G, Ridge T, Sarkar S, Strnisa R (2007) Ott: effective tool support for the working semanticist. In: Proceedings of ICFP 2007. ACM, New York, NYGoogle Scholar
  44. 44.
    Slind K (1999) Reasoning about terminating functional programs. PhD thesis, Institut für Informatik, Technische Universität MünchenGoogle Scholar
  45. 45.
    Slind K, Norrish M (2008) A brief overview of HOL4. In: Mohamed O, Muñoz C, Tahar S (eds) TPHOLs, Lecture notes in computer science, vol 5170. Springer, Heidelberg, pp 28–32Google Scholar
  46. 46.
    Tolmach A, Oliva DP (1998) From ML to Ada: strongly-typed language interoperability via source translation. J Funct Program 8(4):367–412MATHCrossRefGoogle Scholar
  47. 47.
    Wheeler D, Needham R (1999) TEA, a tiny encryption algorithm. In: Fast software encryption: second international workshop, Lecture notes in computer science, vol 1008. Springer, Berlin, pp 363–366Google Scholar

Copyright information

© Springer Science+Business Media, LLC 2010

Authors and Affiliations

  1. 1.Rockwell Collins, Inc.BloomingtonUSA

Personalised recommendations