Syntax for Free: Representing Syntax with Binding Using Parametricity

  • Robert Atkey
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5608)


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.


Free Variable Abstract Syntax Type Environment Denotational Semantic Inductive Type 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aydemir, B.E., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: Necula, G.C., Wadler, P. (eds.) POPL, pp. 3–15. ACM Press, New York (2008)Google Scholar
  2. 2.
    Carette, J., Kiselyov, O., Shan, C.-c.: Finally tagless, partially evaluated. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 222–238. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  3. 3.
    Chlipala, A.J.: Parametric higher-order abstract syntax for mechanized semantics. In: ICFP, pp. 143–156 (2008)Google Scholar
  4. 4.
    Coquand, T., Huet, G.: Constructions: A higher order proof system for mechanizing mathematics. In: Buchberger, B. (ed.) EUROCAL 1985. LNCS, vol. 203, pp. 151–184. Springer, Heidelberg (1985)Google Scholar
  5. 5.
    de Bruijn, N.G.: Lambda-calculus notation with nameless dummies: a tool for automatic formula manipulation with application to the Church-Rosser theorem. Indag. Math. 34, 381–392 (1972)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Despeyroux, J., Felty, A.P., Hirschowitz, A.: Higher-Order Abstract Syntax in Coq. In: Dezani-Ciancaglini, M., Plotkin, G. (eds.) TLCA 1995. LNCS, vol. 902, pp. 124–138. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  7. 7.
    Gabbay, M., Pitts, A.M.: A New Approach to Abstract Syntax Involving Binders. In: LICS, pp. 214–224 (1999)Google Scholar
  8. 8.
    Harper, R., Licata, D.R.: Mechanizing metatheory in a logical framework. J. Funct. Program. 17(4-5), 613–673 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Hofmann, M.: Semantical Analysis of Higher-Order Abstract Syntax. In: LICS, pp. 204–213 (1999)Google Scholar
  10. 10.
    Izumi, T.: The Theory of Parametricity in Lambda Cube. Technical Report 1217, RIMS Kokyuroku (2001)Google Scholar
  11. 11.
    Licata, D.R., Zeilberger, N., Harper, R.: Focusing on Binding and Computation. In: LICS, pp. 241–252. IEEE Computer Society, Los Alamitos (2008)Google Scholar
  12. 12.
    Moggi, E., Sabry, A.: Monadic encapsulation of effects: a revised approach (extended version). J. Funct. Program. 11(6), 591–627 (2001)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Pfenning, F., Elliott, C.: Higher-Order Abstract Syntax. In: PLDI, pp. 199–208 (1988)Google Scholar
  14. 14.
    Pfenning, F., Lee, P.: Metacircularity in the polymorphic λ-calculus. Theoretical Computer Science 89, 137–159 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Plotkin, G.D.: Lambda-Definability in the Full Type Hierarchy. In: Seldin, J.P., Hindley, J.R. (eds.) To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, pp. 363–373. Academic Press, London (1980)Google Scholar
  16. 16.
    Reynolds, J.C.: Types, Abstraction and Parametric Polymorphism. In: IFIP Congress, pp. 513–523 (1983)Google Scholar
  17. 17.
    Rhiger, M.: A foundation for embedded languages. ACM Trans. Program. Lang. Syst. 25(3), 291–315 (2003)CrossRefGoogle Scholar
  18. 18.
    Washburn, G., Weirich, S.: Boxes go bananas: Encoding higher-order abstract syntax with parametric polymorphism. J. Funct. Program. 18(1), 87–140 (2008)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Robert Atkey
    • 1
  1. 1.School of InformaticsUniversity of EdinburghUK

Personalised recommendations