Automatically Generated Infrastructure for De Bruijn Syntaxes

  • Emmanuel Polonowski
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7998)


Dealing with variable binding during the formalization of programming languages metatheory is notorious for being a very complex issue. This paper introduces a new framework, DBEB, and a tool based on it, DBGen, whose purpose is to generate Coq code providing a rather complete infrastructure for de Bruijn encodings of a large variety of languages. DBEB is an abstract syntax with explicit binding informations that captures the great regularity of de Bruijn syntaxes. From this abstract syntax it is then possible to derive all the definitions and property statements and proofs required for the formalization of the syntactic infrastructure of the language.

Thereby, from a Coq inductive definition of a syntax in de Bruijn style, annotated with comments that make explicit its binding structure within DBEB, DBGen produces a Coq module with term structures definitions and a significant amount of properties (and their proof), up to the substitution lemma. Mutually defined syntaxes are supported, and such definitions may contain several distinct sets of variables. Moreover, this framework handles the generation of a named syntax for “usual” binding with explicit variables together with a smart translation function that greatly improves the readability of de Bruijn terms.


De Bruijn syntax formalization infrastructure generation Coq proof assistant 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    de Bruijn, N.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the church-rosser theorem. Indagationes Mathematicae (Proceedings) 75(5), 381–392 (1972)zbMATHCrossRefGoogle Scholar
  2. 2.
    Aydemir, B.E., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: Necula, G.C., Wadler, P. (eds.) Proceeding of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 3–15. ACM (2008)Google Scholar
  3. 3.
    Gabbay, M.J., Pitts, A.M.: A new approach to abstract syntax with variable binding. Formal Aspects of Computing 13, 341–363 (2001)CrossRefGoogle Scholar
  4. 4.
    Pitts, A.M.: Nominal logic, a first order theory of names and binding. Information and Computation 186, 165–193 (2003)MathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Urban, C., Tasson, C.: Nominal techniques in isabelle/hol. In: Nieuwenhuis, R. (ed.) CADE 2005. LNCS (LNAI), vol. 3632, pp. 38–53. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. 6.
    Charguéraud, A.: The locally nameless representation. Journal of Automated Reasoning (2011)Google Scholar
  7. 7.
    Aydemir, B., Weirich, S.: LNgen: Tool support for locally nameless representations (March 2009)Google Scholar
  8. 8.
    Polonowski, E.: DBGen User Manual, TR–LACL–2012–4 This document introduces DBGen, an automatic generator of De Bruijn infrastructure for the Coq proof assistant. TR–LACL–2012–4 (2012)Google Scholar
  9. 9.
    Church, A.: The Calculi of Lambda Conversion. Princeton University Press (1941)Google Scholar
  10. 10.
    Aydemir, B., et al.: Mechanized metatheory for the masses: The poplmark challenge. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 50–65. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  11. 11.
    Girard, J.Y., Taylor, P., Lafont, Y.: Proofs and Types. Cambridge University Press (1990)Google Scholar
  12. 12.
    Klop, J.W., van Oostrom, V., van Raamsdonk, F.: Combinatory reduction systems: introduction and survey. Theoretical Computer Science 121(1-2), 279–308 (1993)MathSciNetzbMATHCrossRefGoogle Scholar
  13. 13.
    Lee, G., Oliveira, B.C.D.S., Cho, S., Yi, K.: Gmeta: A generic formal metatheory framework for first-order representations. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 436–455. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  14. 14.
    Sewell, P., Nardelli, F.Z., Owens, S., Peskine, G., Ridge, T., Sarkar, S., Strinsa, R.: Ott: Effective tool support for the working semanticist. Journal of Functional Programming 20, 71–122 (2010)zbMATHCrossRefGoogle Scholar
  15. 15.
    Crolard, T., Polonowski, E.: A program logic for higher-order procedural variables and non-local jumps. Technical Report TR-LACL-2011-4, 50 pages (2011-2012)Google Scholar
  16. 16.
    Crolard, T., Polonowski, E.: Deriving a Floyd-Hoare logic for non-local jumps from a formulæ-as-types notion of control. Journal of Logic and Algebraic Programming, 181–208 (2012)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Emmanuel Polonowski
    • 1
  1. 1.LACLUniversity Paris-East CréteilCréteilFrance

Personalised recommendations