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.
Supplemental Material
- Robert Atkey, Patricia Johann, and Neil Ghani. Refining Inductive Types. LMCS, 8:2, 2012.Google Scholar
- Jean Bénabou. Distributors at work.Notes from a course at TU Darmstadt in June 2000, taken by Thomas Streicher.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. JFP, 5:19, 2009. Google Scholar
Digital Library
- Pierre-Evariste Dagand and Conor McBride. A Categorical Treatment of Ornaments. LICS 2013. Google Scholar
Digital Library
- Philippe de Groote. Towards Abstract Categorial Grammars. In Assoc. for Computational Linguistics, 39th Annual Meeting, 2001. Google Scholar
Digital Library
- Andrzej Filinski. Monads in Action. POPL 2010. Google Scholar
Digital Library
- Tim Freeman and Frank Pfenning. Refinement Types for ML. PLDI 1991. Google Scholar
Digital Library
- Robert Harper, Furio Honsell and Gordon Plotkin. A Framework For Defining Logics. Journal of the ACM, 40(1):143--184, 1993. Google Scholar
Digital Library
- Claudio Hermida. Fibrations, Logical predicates and indeterminates, PhD thesis, University of Edinburgh, November 1993.Google Scholar
- C.A.R. Hoare. An Axiomatic Basis for Computer Programming, Communications of the ACM, 12:10, 1969. Google Scholar
Digital Library
- Bart Jacobs. Categorical Logic and Type Theory. Studies in Logic and the Foundations of Mathematics 141. North Holland, 1999.Google Scholar
- Shin-ya Katsumata. Relating Computational Effects by $\top\top$-Lifting. ICALP 2011. Google Scholar
Digital Library
- Max Kelly. Basic concepts in enriched category theory. CUP, 1982.Google Scholar
- Joachim Lambek. The mathematics of sentence structure. American Mathematical Monthly, 65:3, 1958.Google Scholar
Cross Ref
- Joachim Lambek and Philip Scott. Introduction to Higher-order Categorical Logic. CUP, 1986. Google Scholar
Digital Library
- F. William Lawvere. Functorial Semantics of Algebraic Theories, PhD thesis, Columbia University, 1963.Google Scholar
Cross Ref
- F. William Lawvere. Adjointness in Foundations, Dialectica 23, 1969, 281--296.Google Scholar
Cross Ref
- William Lovas. Refinement types for logical frameworks, PhD thesis, Carnegie Mellon University, September 2010. Google Scholar
Digital Library
- Saunders Mac Lane. Categories for the Working Mathematician. Springer, 1971.Google Scholar
Cross Ref
- Conor McBride. Ornamental Algebras, Algebraic Ornaments. JFP (to appear). 9/8/2010 version available on author's website.Google Scholar
- Peter W. O'Hearn and David J. Pym. The Logic of Bunched Implications. BSL 5:2, 1999.Google Scholar
- Peter W. O'Hearn and Hongseok Yang. A Semantic Basis for Local Reasoning. FOSSACS 2002. Google Scholar
Digital Library
- Frank J. Oles. A Category-Theoretic Approach to the Semantics of Programming Languages, PhD thesis, Syracuse University, 1982. Google Scholar
Digital Library
- Frank Pfenning. Refinement Types for Logical Frameworks. Workshop on Types for Proofs and Programs, May 1993.Google Scholar
- Frank Pfenning. Church and Curry: Combining Intrinsic and Extrinsic Typing.Studies in Logic 17, 2008, 303--338.Google Scholar
- John C. Reynolds. The Essence of Algol. Algorithmic Languages, 1981, 345--372.Google Scholar
- John C. Reynolds. The Coherence of Languages with Intersection Types, TACS 1991. Google Scholar
Digital Library
- John C. Reynolds. Theories of Programming Languages. CUP, 1998. Google Scholar
Digital Library
- John C. Reynolds. The Meaning of Types: from Intrinsic to Extrinsic Semantics. BRICS Report RS-00--32, Aarhus University, December 2000.Google Scholar
- John C. Reynolds. Separation logic: A Logic for Shared Mutable Data Structures. LICS 2002. Google Scholar
Digital Library
Index Terms
Functors are Type Refinement Systems
Recommendations
Functors are Type Refinement Systems
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesThe 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 ...
The fire triangle: how to mix substitution, dependent elimination, and effects
There is a critical tension between substitution, dependent elimination and effects in type theory. In this paper, we crystallize this tension in the form of a no-go theorem that constitutes the fire triangle of type theory. To release this tension, we ...
RustBelt: securing the foundations of the Rust programming language
Rust is a new systems programming language that promises to overcome the seemingly fundamental tradeoff between high-level safety guarantees and low-level control over resource management. Unfortunately, none of Rust's safety claims have been formally ...







Comments