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

Numbering matters: first-order canonical forms for second-order recursive types

Published: 19 September 2004 Publication History

Abstract

We study a type system equipped with universal types and equire-cursive types, which we refer to as F͘. We show that type equality may be decided in time O(nlog n), an improvement over the previous known bound of O(n2 ). In fact, we show that two more general problems, namely entailment of type equations and type unification, may be decided in time O(nlog n), a new result. To achieve this bound, we associate, with every F͘ type, a first-order canonical form, which may be computed in time O(nlogn). By exploiting this notion, we reduce all three problems to equality and unification of first-order recursive terms, for which efficient algorithms are known.

References

[1]
Martín Abadi and Marcelo P. Fiore. Syntactic considerations on recursive types. In IEEE Symposium on Logic in Computer Science (LICS), pages 242--252, July 1996.
[2]
Michael Brandt and Fritz Henglein. Coinductive axiomatization of recursive type equality and subtyping. Fundamenta Informaticæ, 33:309--338, 1998.
[3]
Kim B. Bruce, Luca Cardelli, and Benjamin C. Pierce. Comparing object encodings. Information and Computation, 155(1/2):108--133, November 1999.
[4]
Dario Colazzo and Giorgio Ghelli. Subtyping recursive types in Kernel Fun. In IEEE Symposium on Logic in Computer Science (LICS), pages 137--146, July 1999.
[5]
Gregory D. Collins and Zhong Shao. Intensional analysis of higher-kinded recursive types. Technical Report YALEU/DCS/TR-1240, Yale University, 2002.
[6]
Jeffrey Considine. Efficient hash-consing of recursive types. Technical Report 2000-006, Boston University, January 2000.
[7]
Karl Crary. Simple, efficient object encoding using intersection types. Technical Report CMU-CS-99-100, Carnegie Mellon University, 1999.
[8]
Gilles Dowek. Higher-order unification and matching. In J. Alan Robinson and Andrei Voronkov, editors, Handbook of Automated Reasoning, pages 1009--1062. Elsevier Science, 2001.
[9]
Murdoch J. Gabbay and Andrew M. Pitts. A new approach to abstract syntax with variable binding. Formal Aspects of Computing, 13(3-5):341--363, July 2002.
[10]
Vladimir Gapeyev, Michael Levin, and Benjamin Pierce. Recursive subtyping revealed. Journal of Functional Programming, 12(6):511--548, 2003.
[11]
Nadji Gauthier. Implementation of N. http://caml.inria.fr/~gauthier/naming.tar.gz, April 2004.
[12]
Neal Glew. An efficient class and object encoding. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 311--324, October 2000.
[13]
Neal Glew. A theory of second-order trees. In European Symposium on Programming (ESOP), volume 2305 of Lecture Notes in Computer Science, pages 147--161. Springer Verlag, April 2002.
[14]
Gérard Huet. Résolution d'équations dans des langages d'ordre 1, 2, .., w . PhD thesis, Université Paris 7, September 1976.
[15]
Christopher League, Zhong Shao, and Valery Trifonov. Representing Java classes in a typed intermediate language. In ACM International Conference on Functional Programming (ICFP),pages 183--196, September 1999.
[16]
Christopher League, Zhong Shao, and Valery Trifonov. Type-preserving compilation of Featherweight Java. ACM Transactions on Programming Languages and Systems, 24(2):112--152, March 2002.
[17]
Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002.
[18]
François Pottier and Nadji Gauthier. Polymorphic typed defunctionalization. In ACMSymposium on Principles of Programming Languages (POPL), pages 89--98, January 2004.
[19]
Didier Rémy. Projective ML. In ACM Symposium on Lisp and Functional Programming (LFP), pages 66--75, 1992.
[20]
Didier Rémy. Type inference for records in a natural extension of ML. In Carl A. Gunter and John C. Mitchell, editors, Theoretical Aspects Of Object-Oriented Programming. Types, Semantics and Language Design. MIT Press, 1994.
[21]
Christian Urban, Andrew Pitts, and Murdoch Gabbay. Nominal unification. In Computer Science Logic, volume 2803 of Lecture Notes in Computer Science, pages 513--527. Springer Verlag, August 2003.
[22]
Hongwei Xi, Chiyan Chen, and Gang Chen. Guarded recursive datatype constructors. In ACM Symposium on Principles of Programming Languages (POPL), January 2003.

Cited By

View all

Index Terms

  1. Numbering matters: first-order canonical forms for second-order recursive types

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      ICFP '04: Proceedings of the ninth ACM SIGPLAN international conference on Functional programming
      September 2004
      264 pages
      ISBN:1581139055
      DOI:10.1145/1016850
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 39, Issue 9
        ICFP '04
        September 2004
        254 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1016848
        Issue’s Table of Contents
      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]

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 19 September 2004

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. equality
      2. polymorphism
      3. recursive types
      4. unification

      Qualifiers

      • Article

      Conference

      ICFP04
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 333 of 1,064 submissions, 31%

      Upcoming Conference

      ICFP '25
      ACM SIGPLAN International Conference on Functional Programming
      October 12 - 18, 2025
      Singapore , Singapore

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)11
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 20 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media