Skip to main content
Log in

Mechanizing Metatheory Without Typing Contexts

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

Abstract

When mechanizing the metatheory of a programming language, one usually needs many lemmas proving structural properties of typing judgments, such as permutation and weakening. Such structural lemmas are sometimes unnecessary if we eliminate typing contexts by expanding typing judgments into their original hypothetical proofs. This technique of eliminating typing contexts, which has been around since Church (J Symb Log 5(2):56–68, 1940), is based on the view that entailment relations, such as typing judgments, are just syntactic tools for displaying only the hypotheses and conclusion of a hypothetical proof while hiding its internal structure. In this paper, we apply this technique to parts 1A/2A of the textscPoplMark challenge (Aydemir et al. 2005) and experimentally evaluate its efficiency by formalizing System F  < :  in the Coq proof assistant in a number of different ways. An analysis of our Coq developments shows that eliminating typing contexts produces a more significant reduction in both the number of lemmas and the count of tactics than the cofinite quantification, one of the most effective ways of simplifying the mechanization involving binders. Our experiment with System F  < :  suggests three guidelines to follow when applying the technique of eliminating typing contexts.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Aydemir, B., Bohannon, A., Fairbairn, M., Foster, J.N., Pierce, B.C., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S., Zdancewic, S.: Mechanized metatheory for the masses: the PoplMark challenge. In: Hurd, J., Melham, T.F. (eds.) Proceedings of the Eighteenth International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2005), pp. 50–65. Springer (2005)

  2. Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: Proceedings of the 35th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’08, pp. 3–15. ACM (2008)

  3. Charguéraud, A.: http://www.chargueraud.org/research/2006/poplmark/ (2006)

  4. Church, A.: A formulation of the simple theory of types. J. Symbolic Logic 5(2), 56–68 (1940)

    Article  MathSciNet  Google Scholar 

  5. Curry, H.B., Feys, R.: Combinatory Logic. North-Holland (1958)

  6. de Bruijn. N.G.: Lambda calculus notation with nameless dummies. A tool for automatic formula manipulation with application to the church-rosser theorem. Indagat. Math. 34, 381–392 (1972)

    Article  Google Scholar 

  7. Garrigue, J.: A certified implementation of ML with structural polymorphism. In: Proceedings of the 8th Asian conference on Programming Languages and Systems, APLAS’10, pp. 360–375. Springer-Verlag (2010)

  8. Geuvers, H., Krebbers, R., McKinna, J., Wiedijk, F.: Pure type systems without explicit contexts. In: Proceedings of the 5th International Workshop on Logical Frameworks and Meta-languages (LFMTP), pp. 53–67 (2010)

  9. Gordon, A.D.: A mechanisation of name-carrying syntax up to alpha-conversion. In: Proceedings of the 6th International Workshop on Higher Order Logic Theorem Proving and its Applications, pp. 413–425. Springer-Verlag (1994)

  10. Harper, R., Honsell, F., Plotkin G.: A framework for defining logics. J. ACM 40, 143–184 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  11. Krebbers, R.: A formalization of Γ ∞  in Coq. http://robbertkrebbers.nl/research/gammainf (2010)

  12. Leroy, X.: A locally nameless solution to the POPLmark challenge. Research report 6098, INRIA (2007)

  13. Mazurak, K., Zhao, J., Zdancewic, S.: Lightweight linear types in System F°. In: Proceedings of the 5th ACM SIGPLAN Workshop on Types in Language Design and Implementation, TLDI ’10, pp. 77–88. ACM (2010)

  14. McKinna, J., Pollack, R.: Pure type systems formalized. In: Proceedings of the International Conference on Typed Lambda Calculi and Applications, pp. 289–305. Springer-Verlag (1993)

  15. McKinna, J., Pollack, R.: Some lambda calculus and type theory formalized. J. Autom. Reasoning 23, 373–409 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  16. Montagu, B.: Experience report: mechanizing core F-zip using the locally nameless approach (extended abstract). In: 5th ACM SIGPLAN Workshop on Mechanizing Metatheory (2010)

  17. Pfenning, F., Elliott, C.: Higher-order abstract syntax. In: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, PLDI ’88, pp. 199–208. ACM (1988)

  18. Pfenning, F., Schürmann, C.: System description: Twelf - a meta-logical framework for deductive systems. In: Proceedings of the 16th International Conference on Automated Deduction (CADE-16), pp. 202–206. Springer-Verlag LNAI (1999)

  19. Pitts, A.M.: Nominal logic, a first order theory of names and binding. Inf. Comput. 186(2), 165–193 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  20. Pollack R., Sato M., Ricciotti, W.: A canonical locally named representation of binding. J. Autom. Reasoning 49(2), 185–207 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  21. Rossberg A., Russo C.V., Dreyer, D.: F-ing modules. In: Proceedings of the 5th ACM SIGPLAN Workshop on Types in Language Design and Implementation, TLDI ’10, pp. 89–102. ACM (2010)

  22. Urban, C.: Nominal techniques in Isabelle/HOL. J. Autom. Reasoning 40, 327–356 (2008)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sungwoo Park.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Park, J., Seo, J., Park, S. et al. Mechanizing Metatheory Without Typing Contexts. J Autom Reasoning 52, 215–239 (2014). https://doi.org/10.1007/s10817-013-9287-4

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10817-013-9287-4

Keywords

Navigation