Automatically Generated Infrastructure for De Bruijn Syntaxes
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.
KeywordsDe Bruijn syntax formalization infrastructure generation Coq proof assistant
Unable to display preview. Download preview PDF.
- 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
- 6.Charguéraud, A.: The locally nameless representation. Journal of Automated Reasoning (2011)Google Scholar
- 7.Aydemir, B., Weirich, S.: LNgen: Tool support for locally nameless representations (March 2009)Google Scholar
- 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.Church, A.: The Calculi of Lambda Conversion. Princeton University Press (1941)Google Scholar
- 11.Girard, J.Y., Taylor, P., Lafont, Y.: Proofs and Types. Cambridge University Press (1990)Google Scholar
- 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.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