Skip to main content
Log in

The Locally Nameless Representation

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

Abstract

This paper provides an introduction to the locally nameless approach to the representation of syntax with variable binding, focusing in particular on the use of this technique in formal proofs. First, we explain the benefits of representing bound variables with de Bruijn indices while retaining names for free variables. Then, we explain how to describe and manipulate syntax in that form, and show how to define and reason about judgments on locally nameless terms.

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.

Similar content being viewed by others

References

  1. Altenkirch, T., McBride, C., McKinna, J.: Why Dependent Types Matter. Available from http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.106.8190 (2005). Accessed Apr 2006

  2. Aydemir, B., Bohannon, A., Fairbairn, M., Foster, J.N., Pierce, B.C., Sewell, P., Vytiniotis, D., GeoffrG.ey Washburn, Weirich, S., Zdancewic, S.: Mechanized metatheory for the masses: the PoplMark challenge. In: TPHOLs, vol. 3603 of LNCS, pp. 50–65. Springer (2005)

  3. Aydemir, B., Weirich, S., Zdancewic, S.: Abstracting Syntax. Technical Reports (CIS) (2009)

  4. Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (2008)

  5. Barras, B., Werner, B.: Coq in coq. Available from http://pauillac.inria.fr/~barras/coq_work-eng.html (1997). Accessed Mar 2006

  6. Benton, N., Koutavas, V.: A Mechanized Bisimulation for the Nu-Calculus (2007)

  7. Charguéraud, A.: Submission to the PoplMark Challenge, Part 1a. Available from http://arthur.chargueraud.org/research/2006/poplmark/ (2006). Accessed Jul 2009

  8. Chlipala, A.: Submission to the PoplMark Challenge, Part 1a. Available from http://www.cs.berkeley.edu/~adamc/poplmark/ (2006). Accessed Jun 2006

  9. The Coq Development Team: The Coq Proof Assistant Reference Manual, Version 8.2. Available at http://coq.inria.fr/ (2009). Accessed Jul 2009

  10. 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(5), 381–392 (1972)

    Google Scholar 

  11. de Vries, E., Plasmeijer, R., Abrahamson, D.M.: Uniqueness typing simplified. In: IFL, vol. 5083 of LNCS, pp. 201–218. Springer (2007)

  12. Effinger-Dean, L., Grossman, D.: Modular Metatheory for Memory Consistency Models (2010)

  13. Garrigue, J.: A Certified Interpreter for ML with Structural Polymorphism (2009)

  14. Gordon, A.D.: A mechanisation of name-carrying syntax up to alpha-conversion. In: Proceedings on Higher-order Logic Theorem Proving and its Applications, vol. 780 of LNCS, pp. 414–426. Springer (1993)

  15. Gordon, A.D., Melham, T.: Five axioms of alpha-conversion. In: TPHOLs, vol. 1125 of LNCS, pp. 173–190. Springer (1996)

  16. Henrio, L., Kammüller, F., Lutz, B., Sudhof, H.: Locally Nameless Sigma Calculus (2010)

  17. Huet, G.: The zipper. J. Funct. Program. 7(5), 549–554 (1997) Functional Pearl

    Article  MathSciNet  MATH  Google Scholar 

  18. Huet, G.: The constructive engine. In: A Perspective in Theoretical Computer Science: Commerative Volume for Gift Siromoney. World Scientific Publishing (1989) Also available as INRIA Technical Report 110

  19. Jia, L., Vaughan, J.A., Mazurak, K., Zhao, J., Zarko, L., Schorr, J., Zdancewic, S.: Aura: a programming language for authorization and audit. In: ACM SIGPLAN International Conference on Functional Programming, pp. 27–38. ACM (2008)

  20. Krebbers, R.: A formalization of Γ in Coq. URL: http://robbertkrebbers.nl/research/gammainf/ (2010). Accessed Dec 2010

  21. Leroy, X.: A Locally Nameless Solution to the Poplmark Challenge. Technical Report 6098, INRIA (2007)

  22. Luo, Z., Pollack, R.: The LEGO proof development system: a user’s manual. Technical Report ECS-LFCS-92-211, University of Edinburgh (1992)

  23. McBride, C., McKinna, J.: Functional pearl: I am not a number—I am a free variable. In: ACM SIGPLAN Workshop on Haskell, pp. 1–9. ACM (2004)

  24. McKinna, J., Pollack, R.: Pure type systems formalized. In: Typed Lambda Calculi and Applications: International Conference on Typed Lambda Calculi and Applications, TLCA ’93, vol. 664 of LNCS, pp. 289–305. Springer (1993)

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

    Article  MathSciNet  MATH  Google Scholar 

  26. Montagu, B.: Mechanizing Core F-zip using the locally nameless approach. In: 5th ACM SIGPLAN Workshop on Mechanizing Metatheory (2010)

  27. Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL: A Proof Assistant For Higher-Order Logic, vol. 2283 of LNCS. Springer (2002)

  28. Norrish, M., Slind, K.: HOL 4. Available from http://hol.sourceforge.net/ (2007)

  29. Papakyriakou, M.A., Gerakios, P.E., Papaspyrou, N.S.: A Mechanized Proof of Type Safety for the Polymorphic λ-calculus with References. In: 6th Panhellenic Logic Symposium (2007)

  30. Paulson, L.C.: Natural deduction as higher-order resolution. J. Log. Program. 3, 237–258 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  31. Paulson, L.C.: A Preliminary User’s Manual for Isabelle. Technical Report TR-133, Computer Laboratory, University of Cambridge (1988)

  32. Paulson, L.C.: ML for the Working Programmer. Cambridge University Press (1991)

  33. Plotkin, G.: Call-by-name, call-by-value and the λ-calculus. Theor. Comp. Sci. 1(2), 125–159 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  34. Pollack, R.: Reasoning About Languages with Binding: Can We Do It Yet? Slides from http://homepages.inf.ed.ac.uk/rpollack/export/bindingChallenge_slides.pdf (2006). Accessed Mar 2006

  35. Pollack, R.: Closure under alpha-conversion. In: TYPES’93: Workshop on Types for Proofs and Programs, Nijmegen, May 1993, Selected Papers, vol. 806 of LNCS, pp. 313–332. Springer (1994)

  36. Pollack, R.: The Theory of LEGO: A Proof Checker for the Extended Calculus of Constructions. PhD thesis, Univ. of Edinburgh (1994)

  37. Pratikakis, P., Foster, J.S., Hicks, M., Neamtiu, I.: Formalizing soundness of contextual effects. In: Theorem Proving in Higher Order Logics, vol. 5170 of LNCS, pp. 262–277. Springer (2008)

  38. Rendel, T., Ostermann, K., Hofer, C.: Typed self-representation. In: Proceedings of the 2009 ACM SIGPLAN conference on Programming Language Design and Implementation, pp. 293–303. ACM (2009)

  39. Ricciotti, W.: Submission to the PoplMark Challenge, Part 1a. Available from http://ricciott.web.cs.unibo.it/ (2007). Accessed Feb 2007

  40. Rossberg, A., Russo, C.V., Dreyer, D.: F-ing modules. In: Workshop on Types in Language Design and Implementation, pp. 89–102. ACM (2010)

  41. Russo, C.V., Vytiniotis, D.: QML: explicit first-class polymorphism for ML. In: Proceedings of the 2009 ACM SIGPLAN workshop on ML, pp. 3–14. ACM (2009)

  42. Shinwell, M.R., Pitts, A.M., Gabbay, M.: FreshML: programming with binders made simple. In: Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, ICFP, pp. 263–274. ACM (2003)

  43. Swamy, N., Hicks, M.: Verified enforcement of stateful information release policies. SIGPLAN Not. 43(12), 21–31 (2008)

    Article  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  45. Yakobowski, B.: Graphical Types and Constraints: Second-order Polymorphism and Inference. PhD thesis, Université Paris-Diderot (2008)

  46. Zhao, J., Zhang, Q., Zdancewic, S.: Relational parametricity for a polymorphic linear lambda calculus. In: APLAS, vol. 6461 of LNCS, pp. 344–359. Springer (2010)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Arthur Charguéraud.

Additional information

The work described in the present paper was performed while working at INRIA Rocquencourt.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Charguéraud, A. The Locally Nameless Representation. J Autom Reasoning 49, 363–408 (2012). https://doi.org/10.1007/s10817-011-9225-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10817-011-9225-2

Keywords

Navigation