Higher-order abstract syntax in Coq

  • Joëlle Despeyroux
  • Amy Felty
  • André Hirschowitz
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 902)


The terms of the simply-typed λ-calculus can be used to express the higher-order abstract syntax of objects such as logical formulas, proofs, and programs. Support for the manipulation of such objects is provided in several programming languages (e.g. λProlog, Elf). Such languages also provide embedded implication, a tool which is widely used for expressing hypothetical judgments in natural deduction. In this paper, we show how a restricted form of second-order syntax and embedded implication can be used together with induction in the Coq Proof Development system. We specify typing rules and evaluation for a simple functional language containing only function abstraction and application, and we fully formalize a proof of type soundness in the system. One difficulty we encountered is that expressing the higher-order syntax of an object-language as an inductive type in Coq generates a class of terms that contains more than just those that directly represent objects in the language. We overcome this difficulty by defining a predicate in Coq that holds only for those terms that correspond to programs. We use this predicate to express and prove the adequacy for our syntax.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    A. Asperti and G. Longo. Categories, Types, and Structures. MIT Press, Foundations of Computing Series, London, England, 1991.Google Scholar
  2. 2.
    A. Avron, F. Honsell, I. A. Mason, and R. Pollack. Using typed lambda calculus to implement formal systems on a machine. Journal of Automated Reasoning, 9(3):309–354, Dec. 1992.CrossRefGoogle Scholar
  3. 3.
    J. Despeyroux and A. Hirschowitz. Higher-order syntax and induction in coq. In Proceedings of the fifth Int. Conf. on Logic Programming and Automated Reasoning (LPAR 94), Kiev, Ukraine, July 16–21, 1994, 1994. Also available as an INRIA Research Report RR-2292, Inria-Sophia-Antipolis, France, June 1994.Google Scholar
  4. 4.
    G. Dowek, A. Felty, H. Herbelin, G. Huet, C. Murthy, C. Parent, C. Paulin-Mohring, and B. Werner. The coq proof assistant user's guide. Technical Report 154, INRIA, 1993.Google Scholar
  5. 5.
    A. Felty. A logic programming approach to implementing higher-order term rewriting. In L.-H. Eriksson, L. Hallnäs, and P. Schroeder-Heister, editors, Proceedings of the January 1991 Workshop on Extensions to Logic Programming, pages 135–161. Springer-Verlag LNCS, 1992.Google Scholar
  6. 6.
    A. Felty. Implementing tactics and tacticals in a higher-order logic programming language. Journal of Automated Reasoning, 11(1):43–81, Aug. 1993.CrossRefMathSciNetGoogle Scholar
  7. 7.
    J. Hannan. Investigating a Proof-Theoretic Meta-Language for Functional Programs. PhD thesis, University of Pennsylvania, Technical Report MS-CIS-91-09, Jan. 1991.Google Scholar
  8. 8.
    J. Hannan and D. Miller. From operational semantics to abstract machines. Mathematical Structures in Computer Science, 2:415–459, 1992.Google Scholar
  9. 9.
    J. Hannan and F. Pfenning. Compiler verification in LF. In Seventh Annual Symposium on Logic in Computer Science, pages 407–418, 1992.Google Scholar
  10. 10.
    R. Harper, F. Honsell, and G. Plotkin. A framework for denning logics. Journal of the ACM, 40(1):143–184, Jan. 1993.CrossRefGoogle Scholar
  11. 11.
    S. Michaylov and F. Pfenning. Natural semantics and some of its meta-theory in elf. In L.-H. Eriksson, L. Hallnäs, and P. Schroeder-Heister, editors, Proceedings of the January 1991 Workshop on Extensions to Logic Programming, pages 299–344. Springer-Verlag LNCS, 1992.Google Scholar
  12. 12.
    D. Miller. Unification of simply typed lambda-terms as logic programming. In Eighth International Logic Programming Conference. MIT Press, 1991.Google Scholar
  13. 13.
    C. Paulin-Mohring. Inductive definitions in the system Coq; rules and properties. In M. Bezem and J. F. Groote, editors, Proceedings of the International Conference on Typed Lambda Calculi and Applications, volume 664, pages 328–345. Springer Verlag Lecture Notes in Computer Science, 1993.Google Scholar
  14. 14.
    F. Pfenning and E. Rohwedder. Implementing the meta-theory of deductive systems. In Eleventh International Conference on Automated Deduction, pages 537–551. Springer-Verlag LNCS, 1992.Google Scholar

Copyright information

© Springer-Verlag 1995

Authors and Affiliations

  • Joëlle Despeyroux
    • 1
  • Amy Felty
    • 2
  • André Hirschowitz
    • 3
  1. 1.Sophia-AntipolisINRIAValbonne CedexFrance
  2. 2.AT&T Bell LaboratoriesMurray HillUSA
  3. 3.CNRS URA 168University of NiceNice Cedex 2France

Personalised recommendations