skip to main content
10.1145/507635.507637acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

A fresh approach to representing syntax with static binders in functional programming

Published:01 October 2001Publication History

ABSTRACT

Tell category theorists about the concept of abstract syntax for a language and they may say "that's just the initial algebra for a sum-of-products functor on the category of sets". Despite what you might think, they are trying to be helpful since the initiality property is the common denominator of both definitions by structural recursion and proofs by structural induction [5, Sect. 4.4]. In recent years we have learned how to extend this initial algebra view of abstract syntax to encompass languages with statically scoped binders. In the presence of such binders one wants to abstract away from the specific names of bound variables, either by quotienting parse trees by a suitable notion of alpha-equivalence, or by replacing conventional trees with ones containing de Bruijn indices [1]. By changing from the category of sets to other well-known, but still 'set-like' categories of sheaves or presheaves, one can regain an initial algebra view of this even more than normally abstract syntax---the pay-off being new and automatically generated forms of structural recursion and induction that respect alpha-equivalence [2, 3]. One good test of these new ideas is to see if they give rise to new forms of functional programming. In fact they do. The paper [6] sketches a functional programming language for representing and manipulating syntactical structure involving binders, based on the mathematical model of variable-binding in [3, 4]. In this ML-like language there are new forms of type for names and name-binding that come along with facilities for declaring fresh names, for binding names in abstractions and for pulling apart such name-abstractions via pattern-matching. The key idea is that properly abstract uses of names, i.e. ones that do not descend below the level of alpha-conversion, can be imposed on the user by a static type system that deduces information about the freshness of names. Even though we appear to be giving users a 'gensym' facility, the type system restricts the way it can be used to the extent that we keep within effect-free functional programming, in the sense that the usual laws of pure functional programming remain valid (augmented with new laws for names and name-abstractions). In this talk I will introduce this new approach to representing languages static binders in functional programming and discuss some of the difficulties we have had verifying its semantic properties.

References

  1. N. G. de Bruijn. 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.Google ScholarGoogle Scholar
  2. M. P. Fiore, G. D. Plotkin, and D. Turi. Abstract syntax and variable binding. In 14th Annual Symposium on Logic in Computer Science. pages 193-202. IEEE Computer Society Press, Washington, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. J. Gabbay and A. M. Pitts. A new approach to abstract syntax involving binders. In 14th Annual Symposium on Logic in Computer Science, pages 214-224. IEEE Computer Society Press, Washington, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. J. Gabbay and A. M. Pitts. A new approach to abstract syntax with variable binding. Formal Aspects of Computing. 2001. Special issue in honour of Rod Burstall. To appear.Google ScholarGoogle Scholar
  5. J. Meseguer and J. A. Goguen. Initiality, induction and computability. In M. Nivat and J. C. Reynolds, editors, Algebraic Methods in Semantics, chapter 14, pages 459-541. Cambridge University Press, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. M. Pitts and M. J. Gabbay. A metalanguage for programming with hound names modulo renaming. In R. Backhouse and 3. N. Oliveira. editors, Mathematics of Program Construction. 5th International Conference, MPC2000. Ponte de Lima, Portugal, July 2000. Proceedings. volume 1837 of Lecture Notes in Computer Science, pages 230-255. Springer-Verlag, Heidelberg, 2000. Google ScholarGoogle Scholar

Index Terms

  1. A fresh approach to representing syntax with static binders in functional programming

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ICFP '01: Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
        October 2001
        277 pages
        ISBN:1581134150
        DOI:10.1145/507635
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 36, Issue 10
          October 2001
          276 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/507669
          Issue’s Table of Contents

        Copyright © 2001 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 October 2001

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        ICFP '01 Paper Acceptance Rate23of66submissions,35%Overall Acceptance Rate333of1,064submissions,31%

        Upcoming Conference

        ICFP '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader