## A Generic Formal Metatheory Framework for First-Order Representations

Citations: | 1 - 0 self |

### BibTeX

@MISC{Lee_ageneric,

author = {Gyesik Lee and Bruno C. D. S. Oliveira and Sungkeun Cho and Kwangkeun Yi},

title = {A Generic Formal Metatheory Framework for First-Order Representations},

year = {}

}

### OpenURL

### Abstract

This paper presents GMETA: a generic framework for first-order representations of variable binding that provides once and for all many of the so-called infrastructure lemmas and definitions required in mechanizations of formal metatheory. The framework employs datatype-generic programming and modular programming techniques to provide a universe representing a family of datatypes. This universe is generic in two different ways: it is language-generic in the sense that several object languages can be represented within the universe; and it is representation-generic, meaning that it is parameterizable over the particular choice of firstorder representations for binders (for example, locally nameless or de Bruijn). Using this universe, several libraries providing generic infrastructure lemmas and definitions are implemented. These libraries are used in case studies based on the POPLmark challenge, showing that dealing with challenging binding constructs, like the ones found in System F<:, is possible with GMETA. All of GMETA’s generic infrastructure is implemented in the Coq theorem prover, ensuring the soundness of that infrastructure. Furthermore, due to GMETA’s modular design, the libraries can be easily used, extended and customized by end users. 1.

### Citations

766 |
Types and Programming Languages
- Pierce
- 2002
(Show Context)
Citation Context ...rals are defined as follows: RNat : Rep RNat = 1 + R RList : Rep RList = 1 + K RNat × R It is useful to compare these definitions with the more familiar definitions for recursive types using µ-types (=-=Pierce 2002-=-): Nat = µ R. 1 + R List = µ R. 1 + Nat × R The definitions RNat and RList are similar to Nat and List. The main difference is that, in the later two definitions, type-level fixpoints are used. Our gr... |

720 | A framework for defining logics
- Harper, Honsell, et al.
- 1993
(Show Context)
Citation Context ...be used to generate code that has to be verified afterwards. Adequacy Whenever we talk about representations of a language, it is desirable to talk about some form of adequacy of the representations (=-=Harper et al. 1993-=-). Because the typical use of GMETA involves two languages – an object language such as the lambda calculus presented in Figure 2; and the representation of that language in the DGP universe – the que... |

358 |
Intuitionistic Type Theory
- Martin-Löf
- 1984
(Show Context)
Citation Context ...g The key idea behind DGP is that many functions can be defined generically for whole families of datatype definitions. Inductive families are useful to DGP because they allow us to define universes (=-=Martin-Löf 1984-=-) representing whole families of datatypes. By defining functions over this universe we obtain generic functions that work for any datatypes representable in that universe. A Simple Universe Figure 4 ... |

328 | System description: Twelf - a meta-logical framework for deductive systems
- Pfenning, Schürmann
- 1999
(Show Context)
Citation Context ... alpha-equivalence can be handled once and for all by the meta-logic. This is why such approaches are used in logical frameworks such as Abella (Gacek 2008), Hybrid (Momigliano et al. 2008) or Twelf (=-=Pfenning and Schürmann 1999-=-). The main advantage of first-order approaches, and the reason why they are so popular in practice, is that terms with binders are easy to manipulate and understand; and they work well in generalpurp... |

313 |
Higher-order abstract syntax
- Pfenning, Elliott
- 1988
(Show Context)
Citation Context ...g the infrastructure overhead through it’s reusable libraries of infrastructure. Higher-order Approaches and Nominal Logic Approaches based on higher-order abstract syntax (HOAS) (Harper et al. 1993; =-=Pfenning and Elliot 1988-=-) are used in logical frameworks such as Abella (Gacek 2008), Hybrid (Momigliano et al. 2008) or Twelf (Pfenning and Schürmann 1999). In HOAS, the objectlanguage binding is represented using the bindi... |

276 |
Programming in Martin-Löf’s Type Theory. An Introduction
- Nordström, Petersson, et al.
- 1990
(Show Context)
Citation Context ...y (2005) explored how to provide generic operations such as substitution or free variables using nominal abstract syntax. Our work is inspired by the use of universes in type-theory (Martin-Löf 1984; =-=Nordström et al. 1990-=-). The basic universe construction presented in Figure 4 is a simple variation of the regular tree types universe proposed by Morris et al. (2004, 2009) in Epigram. Nevertheless the extensions for rep... |

186 | Towards a Practical Programming Language Based on Dependent Type Theory
- Norell
- 2007
(Show Context)
Citation Context ...the successor of a natural. Inductive families are a generalization of conventional datatypes that has been introduced in dependently typed languages such as Epigram (McBride and McKinna 2004), Agda (=-=Norell 2007-=-) or the Coq theorem prover. Inductive families are one of the inspirations for Generalized Algebraic Datatypes (GADTs) (Peyton Jones et al. 2006), which has been adopted by Haskell and other language... |

182 | PolyP - a polytypic programming language extension
- Jansson, Jeuring
(Show Context)
Citation Context ...s generic in two different ways: 1. Language-generic: several object languages can be represented in the universe. This form of genericity is based on datatypegeneric programming (DGP) (Gibbons 2007; =-=Jansson and Jeuring 1997-=-). 2. Representation-generic: the particular choice of first-order representations (for example, locally nameless or de Bruijn representations) is parameterizable. This form of generic programming is ... |

181 | Nominal Logic: A First Order Theory of Names and Binding - Pitts - 2001 |

172 | Simple unification-based type inference for GADTs - Jones, Vytiniotis, et al. - 2006 |

166 | The view from the left - McBride, McKinna - 2004 |

160 | de Bruijn. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem - G - 1972 |

157 | Scrap your boilerplate: a practical design pattern for generic programming - Lämmel, Jones - 2003 |

146 | Mechanized Metatheory for the Masses: The poplmark Challenge
- Aydemir, Bohannon, et al.
- 2005
(Show Context)
Citation Context ... problem is that, in many cases, the majority of the total number of lemmas and definitions in a formalization consists of basic infrastructure. One example is the solution to the POPLmark challenge (=-=Aydemir et al. 2005-=-) parts 1A+2A by Aydemir et al. (2008). In that solution the number of lemmas and definitions required by the basic infrastructure corresponded to roughly 65% of the development (see also Figure 11). ... |

88 | Nominal Techniques in Isabelle/HOL
- Urban
(Show Context)
Citation Context ... 2003) is an extension of first-order logic that allows reasoning about alpha-equivalent abstract syntax in a generic way. Variants of nominal logic have been adopted in the nominal Isabelle package (=-=Urban 2005-=-). However, because Coq does not have a nominal package, this approach cannot be used in Coq formalizations. DGP and Binding DGP techniques have been widely used in conventional functional programming... |

87 | Engineering formal metatheory
- Aydemir, Charguéraud, et al.
- 2008
(Show Context)
Citation Context ...new object language. For example, one of the most popular and state-of-the art first-order approaches for formalizing metatheory consists of a completely manual scheme using a locally nameless style (=-=Aydemir et al. 2008-=-). The key idea is that a number of guidelines can be followed for obtaining the implementation of the basic infrastructure lemmas and definitions. The problem is that, in many cases, the majority of ... |

82 | B.: Monadic presentations of lambda terms using generalized inductive types
- Altenkirch, Reus
- 1999
(Show Context)
Citation Context ...cal generic operations since there are no representations for variables or binders. DGP techniques have been used before for dealing with binders using a well-scoped de Bruijn indices representation (=-=Altenkirch and Reus 1999-=-; McBride and McKinna 2004). Chlipala (2007) used an approach inspired by proof by reflection techniques (Boutin 1997) to provide several generic operations on well-scoped de Bruijn indices. Licata an... |

71 | Types for Modules
- Russo
- 1998
(Show Context)
Citation Context ...ture corresponded to roughly 65% of the development (see also Figure 11). Another example is the development of the metatheory for a type-directed translation from an ML-module language to System Fω (=-=Rossberg et al. 2010-=-). In that case, as the authors note, “Out of a total of around 550 lemmas, approximately 400 were tedious infrastructure lemmas”. This lead Rossberg et al. not to recommend Aydemir et al. (2008) loca... |

70 | Inductive families
- Dybjer
- 1994
(Show Context)
Citation Context ...h infrastructure to be reused across multiple formalizations. Our universe-based approach has strong theoretical foundations and can be expressed in type-theories with support for inductive families (=-=Dybjer 1997-=-). • Heterogeneous generic operations and lemmas: Of particular interest is the ability of GMETA to deal with challenging binding constructs, involving multiple syntactic sorts (such as binders found ... |

69 | Generic Haskell: Practice and theory
- Hinze, Jeuring
- 2003
(Show Context)
Citation Context ...because Coq does not have a nominal package, this approach cannot be used in Coq formalizations. DGP and Binding DGP techniques have been widely used in conventional functional programming languages (=-=Hinze and Jeuring 2003-=-; Jansson and Jeuring 1997; Lämmel and Peyton Jones 2003; Rodriguez et al. 2009), and Cheney (2005) explored how to provide generic operations such as substitution or free variables using nominal abst... |

58 | Generic programming within dependently typed programming - Altenkirch, McBride - 2002 |

48 | Datatype-generic programming
- Gibbons
- 2007
(Show Context)
Citation Context ...his universe is generic in two different ways: 1. Language-generic: several object languages can be represented in the universe. This form of genericity is based on datatypegeneric programming (DGP) (=-=Gibbons 2007-=-; Jansson and Jeuring 1997). 2. Representation-generic: the particular choice of first-order representations (for example, locally nameless or de Bruijn representations) is parameterizable. This form ... |

46 | Pure Type Systems formalized
- McKinna, Pollack
- 1993
(Show Context)
Citation Context ...of the POPLmark challenge. Two other important first-order representations are: nominal representations, the standard approach for pen-and-paper formalizations; and the locally named representations (=-=Mckinna and Pollack 1993-=-), which uses different types of names to represent variables and parameters. For a more complete survey of first-order representations we suggest Aydemir et al. (2008). GMETA currently supports local... |

45 | Indexed induction-recursion - Dybjer, Setzer - 2006 |

44 | Higher-order abstract syntax in Coq - Despeyroux, Felty, et al. - 1995 |

44 | A finite axiomatization of inductiverecursive definitions - Dybjer, Setzer - 1999 |

41 | A certified type-preserving compiler from lambda calculus to assembly language - Chlipala - 2007 |

36 | Dependently typed programming in Agda - Norell - 2008 |

30 | An implementation of standard ML modules
- MacQueen
- 1988
(Show Context)
Citation Context ...irst-order representations (for example, locally nameless or de Bruijn representations) is parameterizable. This form of generic programming is based on modular programming in the style of MLmodules (=-=MacQueen 1988-=-). With GMETA, developing mechanized metatheory does not involve implementing much of the tedious infrastructure boilerplate by hand for a new language. Instead, such infrastructure can be reused dire... |

26 | The Abella interactive theorem prover (system description). Available from http://arxiv.org/abs/0803.2305
- Gacek
- 2008
(Show Context)
Citation Context ... are appealing because issues like captureavoidance and alpha-equivalence can be handled once and for all by the meta-logic. This is why such approaches are used in logical frameworks such as Abella (=-=Gacek 2008-=-), Hybrid (Momigliano et al. 2008) or Twelf (Pfenning and Schürmann 1999). The main advantage of first-order approaches, and the reason why they are so popular in practice, is that terms with binders ... |

18 | Exploring the regular tree types - Morris, Altenkirch, et al. - 2006 |

17 | A universe of binding and computation - Licata, Harper - 2009 |

17 | Définitions Inductives en Théorie des Types d’Ordre Supérieur. Habilitation thesis, Université Claude Bernard Lyon I - Paulin-Mohring - 1996 |

16 | Scrap your nameplate: (functional pearl - Cheney - 2005 |

13 | Lngen: Tool support for locally nameless representations
- Aydemir, Weirich
- 2010
(Show Context)
Citation Context ...2010/8/3GMETA provides much of the tedious infrastructure boilerplate that would constitute a large part of the whole development otherwise. Closest to our work are generative approaches like LNgen (=-=Aydemir and Weirich 2009-=-), which uses an external tool, based on Ott (Sewell et al. 2010) specifications, to generate the infrastructure lemmas and definitions for a particular language automatically. Generative approaches h... |

11 | Constructing strictly positive families - Morris, Altenkirch, et al. - 2007 |

6 | Abstracting syntax - Aydemir, Weirich, et al. - 2009 |

3 | Polytypic programming in Coq - Verbruggen, Vries, et al. - 2008 |

2 | Polytypic properties and proofs in Coq - Verbruggen, Vries, et al. - 2009 |