skip to main content
research-article

Functors are Type Refinement Systems

Published:14 January 2015Publication History
Skip Abstract Section

Abstract

The standard reading of type theory through the lens of category theory is based on the idea of viewing a type system as a category of well-typed terms. We propose a basic revision of this reading: rather than interpreting type systems as categories, we describe them as functors from a category of typing derivations to a category of underlying terms. Then, turning this around, we explain how in fact any functor gives rise to a generalized type system, with an abstract notion of typing judgment, typing derivations and typing rules. This leads to a purely categorical reformulation of various natural classes of type systems as natural classes of functors.

The main purpose of this paper is to describe the general framework (which can also be seen as providing a categorical analysis of refinement types), and to present a few applications. As a larger case study, we revisit Reynolds' paper on ``The Meaning of Types'' (2000), showing how the paper's main results may be reconstructed along these lines.

Skip Supplemental Material Section

Supplemental Material

2676970.mov

References

  1. Robert Atkey, Patricia Johann, and Neil Ghani. Refining Inductive Types. LMCS, 8:2, 2012.Google ScholarGoogle Scholar
  2. Jean Bénabou. Distributors at work.Notes from a course at TU Darmstadt in June 2000, taken by Thomas Streicher.Google ScholarGoogle Scholar
  3. Bodil Biering, Lars Birkedal, and Noah Torp-Smith. BI-Hyperdoctrines, Higher-order Separation Logic, and Abstraction. ACM Trans. Program. Lang. Syst., 5:29, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Lars Birkedal, Noah Torp-Smith, and Hongseok Yang.Semantics of Separation-Logic Typing and Higher-order Frame Rules for Algol-like languages. LMCS, 5:2, 2006.Google ScholarGoogle Scholar
  5. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. JFP, 5:19, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Pierre-Evariste Dagand and Conor McBride. A Categorical Treatment of Ornaments. LICS 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Philippe de Groote. Towards Abstract Categorial Grammars. In Assoc. for Computational Linguistics, 39th Annual Meeting, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Andrzej Filinski. Monads in Action. POPL 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Tim Freeman and Frank Pfenning. Refinement Types for ML. PLDI 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Robert Harper, Furio Honsell and Gordon Plotkin. A Framework For Defining Logics. Journal of the ACM, 40(1):143--184, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Claudio Hermida. Fibrations, Logical predicates and indeterminates, PhD thesis, University of Edinburgh, November 1993.Google ScholarGoogle Scholar
  12. C.A.R. Hoare. An Axiomatic Basis for Computer Programming, Communications of the ACM, 12:10, 1969. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Bart Jacobs. Categorical Logic and Type Theory. Studies in Logic and the Foundations of Mathematics 141. North Holland, 1999.Google ScholarGoogle Scholar
  14. Shin-ya Katsumata. Relating Computational Effects by $\top\top$-Lifting. ICALP 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Max Kelly. Basic concepts in enriched category theory. CUP, 1982.Google ScholarGoogle Scholar
  16. Joachim Lambek. The mathematics of sentence structure. American Mathematical Monthly, 65:3, 1958.Google ScholarGoogle ScholarCross RefCross Ref
  17. Joachim Lambek and Philip Scott. Introduction to Higher-order Categorical Logic. CUP, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. F. William Lawvere. Functorial Semantics of Algebraic Theories, PhD thesis, Columbia University, 1963.Google ScholarGoogle ScholarCross RefCross Ref
  19. F. William Lawvere. Adjointness in Foundations, Dialectica 23, 1969, 281--296.Google ScholarGoogle ScholarCross RefCross Ref
  20. William Lovas. Refinement types for logical frameworks, PhD thesis, Carnegie Mellon University, September 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Saunders Mac Lane. Categories for the Working Mathematician. Springer, 1971.Google ScholarGoogle ScholarCross RefCross Ref
  22. Conor McBride. Ornamental Algebras, Algebraic Ornaments. JFP (to appear). 9/8/2010 version available on author's website.Google ScholarGoogle Scholar
  23. Peter W. O'Hearn and David J. Pym. The Logic of Bunched Implications. BSL 5:2, 1999.Google ScholarGoogle Scholar
  24. Peter W. O'Hearn and Hongseok Yang. A Semantic Basis for Local Reasoning. FOSSACS 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Frank J. Oles. A Category-Theoretic Approach to the Semantics of Programming Languages, PhD thesis, Syracuse University, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Frank Pfenning. Refinement Types for Logical Frameworks. Workshop on Types for Proofs and Programs, May 1993.Google ScholarGoogle Scholar
  27. Frank Pfenning. Church and Curry: Combining Intrinsic and Extrinsic Typing.Studies in Logic 17, 2008, 303--338.Google ScholarGoogle Scholar
  28. John C. Reynolds. The Essence of Algol. Algorithmic Languages, 1981, 345--372.Google ScholarGoogle Scholar
  29. John C. Reynolds. The Coherence of Languages with Intersection Types, TACS 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. John C. Reynolds. Theories of Programming Languages. CUP, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. John C. Reynolds. The Meaning of Types: from Intrinsic to Extrinsic Semantics. BRICS Report RS-00--32, Aarhus University, December 2000.Google ScholarGoogle Scholar
  32. John C. Reynolds. Separation logic: A Logic for Shared Mutable Data Structures. LICS 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Functors are Type Refinement Systems

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 50, Issue 1
      POPL '15
      January 2015
      682 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2775051
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
        January 2015
        716 pages
        ISBN:9781450333009
        DOI:10.1145/2676726

      Copyright © 2015 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 14 January 2015

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!