Abstract
Formalizing meta-theory, or proofs about programming languages, in a proof assistant has many well-known benefits. Unfortunately, the considerable effort involved in mechanizing proofs has prevented it from becoming standard practice. This cost can be amortized by reusing as much of existing mechanized formalizations as possible when building a new language or extending an existing one. One important challenge in achieving reuse is that the inductive definitions and proofs used in these formalizations are closed to extension. This forces language designers to cut and paste existing definitions and proofs in an ad-hoc manner and to expend considerable effort to patch up the results.
The key contribution of this paper is the development of an induction technique for extensible Church encodings using a novel reinterpretation of the universal property of folds. These encodings provide the foundation for a framework, formalized in Coq, which uses type classes to automate the composition of proofs from modular components. This framework enables a more structured approach to the reuse of meta-theory formalizations through the composition of modular inductive definitions and proofs.
Several interesting language features, including binders and general recursion, illustrate the capabilities of our framework. We reuse these features to build fully mechanized definitions and proofs for a number of languages, including a version of mini-ML. Bounded induction enables proofs of properties for non-inductive semantic functions, and mediating type classes enable proof adaptation for more feature-rich languages.
Supplemental Material
- B. E. Aydemir, A. Charguéraud, B. C. Pierce, R. Pollack, and S. Weirich. Engineering Formal Metatheory. In POPL'08, 2008. Google Scholar
Digital Library
- B. E. Aydemir and S. Weirich. LNgen: Tool Support for Locally Nameless Representations, 2009. Unpublished manuscript.Google Scholar
- B.E. Aydemir et al. Mechanized Metatheory for the Masses: The PoplMark Challenge. In TPHOLs'05, 2005. Google Scholar
Digital Library
- P. Bahr. Evaluation `a la carte: Non-strict evaluation via compositional data types. In Proceedings of the 23rd Nordic Workshop on Programming Theory, NWPT '11, pages 38--40, 2011.Google Scholar
- D. Batory, J. Kim, and P. Höfner. Feature interactions, products, and composition. In GPCE, 2011. Google Scholar
Digital Library
- C. Böhm and A. Berarducci. Automatic synthesis of typed lambdaprograms on term algebras. Theor. Comput. Sci., 39, 1985.Google Scholar
- O. Boite. Proof reuse with extended inductive types. In Theorem Proving in Higher Order Logics, pages 50--65, 2004.Google Scholar
Cross Ref
- A. Chlipala. Parametric higher-order abstract syntax for mechanized semantics. In ICFP'08, 2008. Google Scholar
Digital Library
- D. Clément, T. Despeyroux, G. Kahn, and J. Despeyroux. A Simple Applicative Language: mini-ML. In LFP'86, 1986. Google Scholar
Digital Library
- W. R. Cook. A denotational semantics of inheritance. PhD thesis, Providence, RI, USA, 1989. AAI9002214. Google Scholar
Digital Library
- T. Coquand and Gérard Huet. The calculus of constructions. Technical Report RR-0530, INRIA, May 1986.Google Scholar
- N. A. Danielsson. Operational semantics using the partiality monad. In ICFP'12, 2012. Google Scholar
Digital Library
- B. Delaware, W. R. Cook, and D. Batory. Product lines of theorems. In OOPSLA'11, 2011. Google Scholar
Digital Library
- L. Duponcheel. Using catamorphisms, subtypes and monad transformers for writing modular functional interpreters., 1995.Google Scholar
- J. Gibbons and R. Hinze. Just do it: simple monadic equational reasoning. In ICFP'11, 2011. Google Scholar
Digital Library
- J. A. Goguen, J. W. Thatcher, E. G. Wagner, and J. B. Wright. Initial algebra semantics and continuous algebras. J. ACM, 24(1), Jan. 1977. Google Scholar
Digital Library
- G. Gonthier, B. Ziliani, A. Nanevski, and D. Dreyer. How to make ad hoc proof automation less ad hoc. In ICFP'11, 2011. Google Scholar
Digital Library
- R. Hinze. Church numerals, twice! JFP, 15(1):1--13, 2005. Google Scholar
Digital Library
- G. Hutton. A tutorial on the universality and expressiveness of fold. J. Funct. Program., 9(4):355--372, 1999. Google Scholar
Digital Library
- M. Jaskelioff, N. Ghani, and G. Hutton. Modularity and implementation of mathematical operational semantics. Electron. Notes Theor. Comput. Sci., 229(5), March 2011. Google Scholar
Digital Library
- G. Lee, B. C. d. S. Oliveira, S. Cho, and K. Yi. Gmeta: A generic formal metatheory framework for first-order representations. In ESOP 2012, 2012. Google Scholar
Digital Library
- X. Leroy. Formal verification of a realistic compiler. Communications of the ACM, 52(7), 2009. Google Scholar
Digital Library
- M. Y. Levin and B. C. Pierce. Tinkertype: A language for playing with formal systems. Journal of Functional Programming, 13(2), March 2003. Google Scholar
Digital Library
- S. Liang and P. Hudak. Modular denotational semantics for compiler construction. In ESOP'96, 1996. Google Scholar
Digital Library
- S. Liang, P. Hudak, and M. Jones. Monad transformers and modular interpreters. In POPL'95, 1995. Google Scholar
Digital Library
- D. MacQueen. Modules for standard ML. In LFP'84, 1984. Google Scholar
Digital Library
- G. Malcolm. Algebraic Data Types and Program Transformation. PhD thesis, Rijksuniversiteit Groningen, September 1990.Google Scholar
- E. Moggi. Notions of computation and monads. Inf. Comput., 93(1), July 1991. Google Scholar
Digital Library
- A. Mulhern. Proof weaving. In WMM '06, September 2006.Google Scholar
- B. C. d. S. Oliveira. Modular visitor components. In ECOOP'09, 2009. Google Scholar
Digital Library
- B. C. d. S. Oliveira and W. R. Cook. Extensibility for the masses: Practical extensibility with object algebras. In ECOOP'12, 2012. Google Scholar
Digital Library
- B. C. d. S. Oliveira, R. Hinze, and A. Löh. Extensible and modular generics for the masses. In Trends in Functional Programming, 2006.Google Scholar
- B. C. d. S. Oliveira, T. Schrijvers, and W. R. Cook. Effectiveadvice: disciplined advice with explicit effects. In AOSD'10, 2010. Google Scholar
Digital Library
- C. Paulin-Mohring. Inductive definitions in the system Coq - rules and properties. In TLCA'93, 1993. Google Scholar
Digital Library
- F. Pfenning and C. Paulin-Mohring. Inductively defined types in the calculus of constructions. In MFPS V, 1990. Google Scholar
Digital Library
- F. Pfenning and C. Schürmann. System description: Twelf - a metalogical framework for deductive systems. In CADE'99, 1999. Google Scholar
Digital Library
- B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google Scholar
Digital Library
- A. M. Pitts. Nominal logic, a first order theory of names and binding. Inf. Comput., 186(2):165--193, 2003. Google Scholar
Digital Library
- Robert Pollack. How to believe a machine-checked proof. In Twenty Five Years of Constructive Type Theory, 1998.Google Scholar
- Christopher Schwaab and Jeremy G. Siek. Modular type-safety proofs using dependant types. CoRR, abs/1208.0535, 2012.Google Scholar
- Peter Sewell et al. Ott: effective tool support for the working semanticist. In ICFP'07, 2007. Google Scholar
Digital Library
- M. Sozeau and N. Oury. First-class type classes. In TPHOLs '08, 2008. Google Scholar
Digital Library
- W. Swierstra. Data types `a la carte. J. Funct. Program., 18(4), 2008. Google Scholar
Digital Library
- T. Uustalu and V. Vene. Coding recursion a la Mendler. In WGP'00, pages 69--85, 2000.Google Scholar
- P. Wadler. The Expression Problem. Email, November 1998. Discussion on the Java Genericity mailing list.Google Scholar
- P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In POPL'89, pages 60--76, 1989. Google Scholar
Digital Library
Index Terms
Meta-theory à la carte
Recommendations
Meta-theory à la carte
POPL '13: Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesFormalizing meta-theory, or proofs about programming languages, in a proof assistant has many well-known benefits. Unfortunately, the considerable effort involved in mechanizing proofs has prevented it from becoming standard practice. This cost can be ...
Completeness and decidability of converse PDL in the constructive type theory of Coq
CPP 2018: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and ProofsThe completeness proofs for Propositional Dynamic Logic (PDL) in the literature are non-constructive and usually presented in an informal manner. We obtain a formal and constructive completeness proof for Converse PDL by recasting a completeness proof ...
Call-by-push-value in Coq: operational, equational, and denotational theory
CPP 2019: Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and ProofsCall-by-push-value (CBPV) is an idealised calculus for functional and imperative programming, introduced as a subsuming paradigm for both call-by-value (CBV) and call-by-name (CBN). We formalise weak and strong operational semantics for (effect-free) ...







Comments