Reference. Functors are type refinement systems
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.
Cite
Cited by (12)
From Semantics to Syntax: A Type Theory for Comprehension Categories najmaei-2026-from
The free bifibration on a functor clarke-2025-the
The categorical contours of the Chomsky-Schützenberger representation theorem mellies-2025-the
Univalent Double Categories vanderweide-2024-univalent
Focusing on Refinement Typing economou-2023-focusing
Explicit Refinement Types ghalayini-2023-explicit
CN: Verifying Systems C Code with Separation-Logic Refinement Types pulte-2023-cn
Parsing as a lifting problem and the Chomsky-Schützenberger representation theorem mellis_zeilberger_2022
We begin by explaining how any context-free grammar encodes a functor of operads from a freely generated operad into a certain “operad of spliced words”. This motivates a more general notion of CFG over any category , defined as a finite species equipped with a color denoting the start symbol and a functor of operads into the operad of spliced arrows in . We show that many standard properties of CFGs can be formulated within this framework, and that usual closure properties of CF languages generalize to CF languages of arrows. We also discuss a dual fibrational perspective on the functor via the notion of “displayed” operad, corresponding to a lax functor of operads .
We then turn to the Chomsky-Schützenberger Representation Theorem. We describe how a non-deterministic finite state automaton can be seen as a category equipped with a pair of objects denoting initial and accepting states and a functor of categories satisfying the unique lifting of factorizations property and the finite fiber property. Then, we explain how to extend this notion of automaton to functors of operads, which generalize tree automata, allowing us to lift an automaton over a category to an automaton over its operad of spliced arrows. We show that every CFG over a category can be pulled back along a ND finite state automaton over the same category, and hence that CF languages are closed under intersection with regular languages. The last important ingredient is the identification of a left adjoint to the operad of spliced arrows functor, building the “contour category” of an operad. Using this, we generalize the C-S representation theorem, proving that any context-free language of arrows over a category is the functorial image of the intersection of a -chromatic tree contour language and a regular language.
First Steps in Synthetic Tait Computability: The Objective Metatheory of Cubical Type Theory sterling_2021
Bifibrations of Polycategories and Classical Linear Logic blanco-2020-bifibrations
An Isbell duality theorem for type refinement systems mellies-2017-an
Models for Polymorphism over Physical Dimension atkey-2015-models
Cites 32 works (10 here)
With notes (10)
Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages carette-2009-finally
BI-hyperdoctrines, higher-order separation logic, and abstraction biering-2007-bi
Separation logic: A logic for shared mutable data structures reynolds_separation_2002
Categorical Logic and Type Theory jacobs-1999
This book is an attempt to give a systematic presentation of both logic and type theory from a categorical perspective, using the unifying concept of fibred category. Its intended audience consists of logicians, type theorists, category theorists and (theoretical) computer scientists.
The logic of bunched implications ohearn_pym_bi_1999
Introduction to Higher-Order Categorical Logic lambek_scott_1986
Categories for the Working Mathematician maclane_1971
Adjointness in Foundations lawvere_1969
Functorial Semantics of Algebraic Theories lawvere_1963
External (22)
- A categorical treatment of ornaments (2013)
- Refining inductive types (2012)
- Relating computational effects by ⊤⊤-lifting (2011)
- Monads in action (2010)
- Refinement types for logical frameworks (2010)
- Ornamental algebras, algebraic ornaments (2010)
- Combining Intrinsic and Extrinsic Typing (2008)
- Semantics of Separation-Logic Typing and Higher-order Frame Rules for Algol-like Languages (2006)
- A semantic basis for local reasoning (2002)
- Towards abstract categorial grammars (2001)
- Distributors at work (2000)
- The Meaning of Types From Intrinsic to Extrinsic Semantics (2000)
- Theories of programming languages (1998)
- A framework for defining logics (1993)
- Fibrations, Logical Predicates and Indeterminates (1993)
- Refinement types for logical frameworks (1993)
- Refinement types for ML (1991)
- The coherence of languages with intersection types (1991)
- A category-theoretic approach to the semantics of programming languages (1982)
- Basic concepts of enriched category theory (1982)
- The Essence of Algol (1981)
- An axiomatic basis for computer programming (1969)