skip to main content
10.1145/964001.964025acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Tridirectional typechecking

Published:01 January 2004Publication History

ABSTRACT

In prior work we introduced a pure type assignment system that encompasses a rich set of property types, including intersections, unions, and universally and existentially quantified dependent types. This system was shown sound with respect to a call-by-value operational semantics with effects, yet is inherently undecidable.In this paper we provide a decidable formulation for this system based on bidirectional checking, combining type synthesis and analysis following logical principles. The presence of unions and existential quantification requires the additional ability to visit subterms in evaluation position before the context in which they occur, leading to a tridirectional type system. While soundness with respect to the type assignment system is immediate, completeness requires the novel concept of contextual type annotations, introducing a notion from the study of principal typings into the source program.

References

  1. Alexander Aiken, Edward~L. Wimmers, and T. K. Lakshman. Soft typing with conditional types. In ACM Symp. Principles of Programming Languages, pages 163--173, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Franco Barbanera, Mariangiola Dezani-Ciancaglini, and Ugo de'Liguoro. Intersection and union types: syntax and semantics. Inf. and Comp., 119:202--230, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Cartwright and M. Fagan. Soft typing. In SIGPLAN Conf. Programming Language Design and Impl. (PLDI), volume~26, pages 278--292, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Coppo, M. Dezani-Ciancaglini, and B. Venneri. Functional characters of solvable terms. Zeitschrift f. math. Logik und Grundlagen d. Math., 27:45--58, 1981.]]Google ScholarGoogle Scholar
  5. Rowan Davies. A practical refinement-type checker for Standard ML. In Algebraic Methodology and Software Tech. (AMAST'97), pages 565--566. Springer LNCS 1349, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Rowan Davies. Practical refinement-type checking. PhD thesis proposal, Carnegie Mellon University, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Rowan Davies and Frank Pfenning. Intersection types and computational effects. In Int'l Conf. Functional Programming (ICFP '00), pages 198--208, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jana Dunfield. Combining two forms of type refinements. Technical Report CMU-CS-02-182, Carnegie Mellon University, September 2002.]]Google ScholarGoogle Scholar
  9. Jana Dunfield and Frank Pfenning. Type assignment for intersections and unions in call-by-value languages. In Found. Software Science and Computational Structures (FOSSACS '03), pages 250--266, Warsaw, Poland, April 2003. Springer LNCS 2620.]]Google ScholarGoogle ScholarCross RefCross Ref
  10. Tim Freeman. Refinement types for ML. PhD thesis, Carnegie Mellon University, 1994. CMU-CS-94-110.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Tim Freeman and Frank Pfenning. Refinement types for ML. In SIGPLAN Conf. Programming Language Design and Impl. (PLDI), volume 26, pages 268--277. ACM Press, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Haruo Hosoya and Benjamin~C. Pierce. How good is local type inference? Technical Report MS-CIS-99-17, University of Pennsylvania, June 1999.]]Google ScholarGoogle Scholar
  13. Trevor Jim. What are principal typings and what are they good for? Technical memorandum MIT/LCS/TM-532, MIT, November 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Yitzhak Mandelbaum, David Walker, and Robert Harper. An effective theory of type refinements. Technical Report TR-656-02, Princeton, December 2002.]]Google ScholarGoogle Scholar
  15. Jens Palsberg and Christina Pavlopoulou. From polyvariant flow information to intersection and union types. J. Func. Prog., 11(3):263--317, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Benjamin C. Pierce. Programming with intersection types and bounded polymorphism. PhD thesis, Carnegie Mellon University, 1991. Technical Report CMU-CS-91-205.]] Google ScholarGoogle Scholar
  17. Benjamin C. Pierce. Programming with intersection types, union types, and polymorphism. Technical Report CMU-CS-91-106, Carnegie Mellon University, 1991.]]Google ScholarGoogle Scholar
  18. Benjamin C. Pierce and David N. Turner. Local type inference. In ACM Symp. Principles of Programming Languages, pages 252--265, 1998. Full version in ACM Trans. Prog. Lang. Sys., 22(1):1--44, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. John C. Reynolds. Design of the programming language Forsythe. Technical Report CMU-CS-96-146, Carnegie Mellon University, 1996.]]Google ScholarGoogle Scholar
  20. Fred Smith, David Walker, and Greg Morrisett. Alias types. In European Symp. on Programming (ESOP'00), pages 366--381, Berlin, Germany, March 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Jean-Pierre Talpin and Pierre Jouvelot. The type and effect discipline. Inf. and Comp., 111(2):245--296, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Inf. and Comp., 132(2):109--176, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. B. Wells and Christian Haack. Branching types. In European Symp. on Programming (ESOP'02), pages 115--132, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J.B. Wells, Allyn Dimock, Robert Muller, and Franklyn Turbak. A calculus with polymorphic and polyvariant flow types. J. Func. Prog., 12(3):183--317, May 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Joe Wells. The essence of principal typings. In Int'l Coll. Automata, Languages, and Programming, volume 2380 of LNCS, pages 913--925. Springer, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Hongwei Xi. Dependent types in practical programming. PhD thesis, Carnegie Mellon University, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Hongwei Xi. Dependently typed data structures. Revision superseding WAAAPL '99, February 2000.]]Google ScholarGoogle Scholar
  28. Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In ACM Symp. Principles of Programming Languages, pages 214--227, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Tridirectional typechecking

        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
          POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2004
          364 pages
          ISBN:158113729X
          DOI:10.1145/964001
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 39, Issue 1
            POPL '04
            January 2004
            352 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/982962
            Issue’s Table of Contents

          Copyright © 2004 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 January 2004

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          POPL '04 Paper Acceptance Rate29of176submissions,16%Overall Acceptance Rate824of4,130submissions,20%

          Upcoming Conference

          POPL '25

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader