Syntax for Free: Representing Syntax with Binding Using Parametricity

We show that, in a parametric model of polymorphism, the type *** *** . ((*** ****** ) ****** ) ***(*** ****** ****** ) ****** is isomorphic to closed de Bruijn terms. That is, the type of closed higher-order abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a model of parametric polymorphism inside the Coq proof assistant. The proof of the theorem requires parametricity over Kripke relations. We also investigate some variants of this representation.

[1]  M. Hoffman Semantical analysis of higher-order abstract syntax , 1999 .

[2]  Andrew M. Pitts,et al.  A new approach to abstract syntax involving binders , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[3]  de Ng Dick Bruijn Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[4]  Adam Chlipala Parametric higher-order abstract syntax for mechanized semantics , 2008, ICFP.

[5]  Arthur Charguéraud,et al.  Engineering formal metatheory , 2008, POPL '08.

[6]  J. Roger Hindley,et al.  To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism , 1980 .

[7]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[8]  Noam Zeilberger,et al.  Focusing on Binding and Computation , 2008, 2008 23rd Annual IEEE Symposium on Logic in Computer Science.

[9]  Sam Lindley,et al.  Extensional Rewriting with Sums , 2007, TLCA.

[10]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[11]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[12]  Peter Lee,et al.  Metacircularity in the Polymorphic lambda-Calculus , 1991, Theor. Comput. Sci..

[13]  Stephanie Weirich,et al.  Boxes go bananas: Encoding higher-order abstract syntax with parametric polymorphism , 2008, J. Funct. Program..

[14]  Amy P. Felty,et al.  Higher-Order Abstract Syntax in Coq , 1995, TLCA.

[15]  Jacques Carette,et al.  Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages , 2007, Journal of Functional Programming.

[16]  Morten Rhiger,et al.  A foundation for embedded languages , 2002, TOPL.

[17]  Robert Harper,et al.  Mechanizing metatheory in a logical framework , 2007, Journal of Functional Programming.

[18]  Jacques Carette,et al.  Finally Tagless, Partially Evaluated , 2007, APLAS.

[19]  Amr Sabry,et al.  Monadic encapsulation of effects: a revised approach (extended version) , 2001, J. Funct. Program..

[20]  Thierry Coquand,et al.  Constructions: A Higher Order Proof System for Mechanizing Mathematics , 1985, European Conference on Computer Algebra.

[21]  竹内 泉 The Theory of Parametricity in Lambda Cube (Towards new interaction between category theory and proof theory) , 2001 .