Abstract
We investigate the development of a general-purpose framework for mechanized reasoning about the meta-theory of programming languages. In order to provide a standard, uniform account of a programming language, we propose to define it as a logic in a logical framework, using the same mechanisms for definition, reasoning, and automation that are available to other logics. Then, in order to reason about the language's meta-theory, we use reflection to inject the programming language into (usually richer and more expressive) meta-theory.One of the key features of our approach is that structure of the language is preserved when it is reflected, including variables, meta-variables, and binding structure. This allows the structure of proofs to be preserved as well, and there is a one-to-one map from proof steps in the original programming logic to proof steps in the reflected logic. The act of reflecting a language is automated; all definitions, theorems, and proofs are preserved by the transformation and all the key lemmas (such as proof and structural induction) are automatically derived.The principal representation used by the reflected logic is higher-order abstract syntax (HOAS). However, reasoning about terms in HOAS can be awkward in some cases, especially for variables. For this reason, we define a computationally equivalent variable-free de Bruijn representation that is interchangeable with the HOAS in all contexts. The de Bruijn representation inherits the properties of substitution and alpha-equality from the logical framework, and it is not complicated by administrative issues like variable renumbering.We further develop the concepts and principles of proofs, provability, and structural and proof induction. This work is fully implemented in the MetaPRL theorem prover. We illustrate with an application to F<: as defined in the POPLmark challenge.
- William Aitken and Robert L. Constable. Reflecting on NuPRL: Lessons 1-4. Technical report, Cornell University, Computer Science Department, Ithaca, NY, 1992.Google Scholar
- William Aitken, Robert L. Constable, and Judith Underwood. Metalogical Frameworks II: Using reflected decision procedures. Journal of Automated Reasoning, 22(2):171--221, 1993. Google Scholar
Digital Library
- Stuart F. Allen, Robert L. Constable, Douglas J. Howe, and William Aitken. The semantics of reflected proof. In Proceedings of the 5th Symposium on Logic in Computer Science, pages 95--197. IEEE Computer Society Press, June 1990.Google Scholar
Cross Ref
- Brian E. Aydemir, Aaron Bohannon, Matthew Fairbairn, J. Nathan Foster, Benjamin C. Pierce, Peter Sewell, Dimitrios Vytiniotis, Geoffrey Washburn, Stephanie Weirich, and Steve Zdancewic. Mechanized metatheory for the masses: The POPLmark challenge. Available from http://www.cis.upenn.edu/group/proj/plclub/mmm/,2005. Google Scholar
Digital Library
- James Cheney. Towards a general theory of names, binding and scope. In Proceedings of the 2005 workshop on Mechanized reasoning about languages with variable binding, pages 33--40. ACM Press, 2005. Google Scholar
Digital Library
- Robert L. Constable. Using reflection to explain and enhance type theory. In Helmut Schwichtenberg, editor, Proof and Computation, volume 139 of NATO Advanced Study Institute, International Summer School held in Marktoberdorf, Germany, July 20-August 1, NATO Series F, pages 65--100. Springer, Berlin, 1994.Google Scholar
- N.G. de Bruijn. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagaciones Mathematische, 34:381--392, 1972. This also appeared in the Proceedings of the Koninklijke Nederlandse Akademie van Wetenschappen, Amsterdam, series A, 75, No. 5.Google Scholar
Cross Ref
- Kurt Gödel. Über formal unentscheidbare sätze der principia mathematica und verwandter systeme I. Monatshefte für Mathematik und Physik, 38:173--198, 1931. English version in {24}.Google Scholar
Cross Ref
- Robert Harper, Furio Honsell, and Gordon Plotkin. A framework for defining logics. Journal of the Association for Computing Machinery, 40(1):143--184, January 1993. A revised and expanded version of the 1987 paper. Google Scholar
Digital Library
- J. Harrison. Metatheory and reflection in theorem proving: A survey and critique. Technical Report CRC-53, SRI International, Cambridge Computer Science Research Centre, Millers Yard, Cambridge, UK, February 1995.Google Scholar
- Dimitri Hendriks. Proof reflection in Coq. Journal of Automated Reasoning, 29(3):277--307, 2002. Google Scholar
Digital Library
- Jason Hickey, Aleksey Nogin, Robert L. Constable, Brian E. Aydemir, Eli Barzilay, Yegor Bryukhov, Richard Eaton, Adam Granicz, Alexei Kopylov, Christoph Kreitz, Vladimir N. Krupski, Lori Lorigo, Stephan Schmitt, Carl Witty, and Xin Yu. MetaPRL-A modular logical environment. In David Basin and Burkhart Wolff, editors, Proceedings of the 16th International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2003), volume 2758 of Lecture Notes in Computer Science, pages 287--303. Springer-Verlag, 2003Google Scholar
- Jason Hickey, Aleksey Nogin, Xin Yu, and Alexei Kopylov. Practical reflection for sequent logics. In Proceedings of the International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice (LFMTP'06), Electronic Notes in Theoretical Computer Science, 2006. To appear.Google Scholar
- Jason J. Hickey, Brian Aydemir, Yegor Bryukhov, Alexei Kopylov, Aleksey Nogin, and Xin Yu. A listing of MetaPRL theories. http://metaprl.org/theories.pdf.Google Scholar
- Jason J. Hickey, Aleksey Nogin, Alexei Kopylov, et al. MetaPRL home page. http://metaprl.org/.Google Scholar
- Aleksey Nogin and Jason Hickey. Sequent schema for derived rules. In Victor A. Carreño, Cézar A. Muñoz, and Sophiène Tahar, editors, Proceedings of the 15th International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2002), volume 2410 of Lecture Notes in Computer Science, pages 281--297. Springer-Verlag, 2002. Google Scholar
Digital Library
- Aleksey Nogin and Alexei Kopylov. Formalizing type operations using the "Image" type constructor. Accepted to to Workshop on Logic, Language, Information and Computation (WoLLIC), 2006. Google Scholar
Digital Library
- Aleksey Nogin, Alexei Kopylov, Xin Yu, and Jason Hickey. A computational approach to reflective meta-reasoning about languages with bindings. In MERLIN '05: Proceedings of the 3rd ACM SIGPLAN workshop on Mechanized reasoning about languages with variable binding, pages 2--12. ACM Press, 2005. An extended version is available as California Institute of Technology technical report CaltechCSTR:2005. 003. Google Scholar
Digital Library
- Russell OConnor. Essential incompleteness of arithmetic verified by Coq. InProceedings of the 18th International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2005), volume 3603 of Lecture Notes in Computer Science, pages 245--260, 2005. Google Scholar
Digital Library
- Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN '88 Conference on Programming Language Design and Implementation (PLDI), volume 23(7) of SIGPLAN Notices, pages 199--208, Atlanta, Georgia, June 1988. ACM Press. Google Scholar
Digital Library
- Andrew M. Pitts and Murdoch Gabbay. A metalanguage for programming with bound names modulo renaming. In R. Backhouse and J.N. Oliveira, editors, Mathematics of Program Construction, volume 1837 of Lecture Notes in Computer Science, pages 230--255. Springer-Verlag, Heidelberg, 2000. Google Scholar
Digital Library
- Gordon Plotkin. An illative theory of relations. In R. Cooper, K. Mukai, and J. Perry, editors, Situation Theory and Its Applications, Volume 1, number 22 in CSLI Lecture Notes, pages 133--146. Centre for the Study of Language and Information, 1990.Google Scholar
- Harald Rueß. Computational reflection in the calculus of constructions and its application to theorem proving. In R. Hindley, editor, Proceedings of the International Conference on Typed Lambda Calculus and its Applications (TLCA'97), volume 1210 of Lecture Notes in Computer Science, Nancy, France, April 1997. Springer-Verlag. Google Scholar
Digital Library
- J. van Heijenoort, editor. From Frege to Gödel: A Source Book in Mathematical Logic, 1879--1931. Harvard University Press, Cambridge, MA, 1967.Google Scholar
Index Terms
Mechanized meta-reasoning using a hybrid HOAS/de bruijn representation and reflection
Recommendations
Mechanized meta-reasoning using a hybrid HOAS/de bruijn representation and reflection
ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programmingWe investigate the development of a general-purpose framework for mechanized reasoning about the meta-theory of programming languages. In order to provide a standard, uniform account of a programming language, we propose to define it as a logic in a ...
Practical Reflection for Sequent Logics
It is well-known that adding reflective reasoning can tremendously increase the power of a proof assistant. In order for this theoretical increase of power to become accessible to users in practice, the proof assistant needs to provide a great deal of ...
A computational approach to reflective meta-reasoning about languages with bindings
MERLIN '05: Proceedings of the 3rd ACM SIGPLAN workshop on Mechanized reasoning about languages with variable bindingWe present a foundation for a computational meta-theory of languages with bindings implemented in a computer-aided formal reasoning environment. Our theory provides the ability to reason abstractly about operators, languages, open-ended languages, ...







Comments