skip to main content
article

Mechanized meta-reasoning using a hybrid HOAS/de bruijn representation and reflection

Published:16 September 2006Publication History
Skip Abstract Section

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.

References

  1. William Aitken and Robert L. Constable. Reflecting on NuPRL: Lessons 1-4. Technical report, Cornell University, Computer Science Department, Ithaca, NY, 1992.Google ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarCross RefCross Ref
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarCross RefCross Ref
  8. 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 ScholarGoogle ScholarCross RefCross Ref
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. Dimitri Hendriks. Proof reflection in Coq. Journal of Automated Reasoning, 29(3):277--307, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle Scholar
  14. 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 ScholarGoogle Scholar
  15. Jason J. Hickey, Aleksey Nogin, Alexei Kopylov, et al. MetaPRL home page. http://metaprl.org/.Google ScholarGoogle Scholar
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. van Heijenoort, editor. From Frege to Gödel: A Source Book in Mathematical Logic, 1879--1931. Harvard University Press, Cambridge, MA, 1967.Google ScholarGoogle Scholar

Index Terms

  1. Mechanized meta-reasoning using a hybrid HOAS/de bruijn representation and reflection

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!