A Category Theoretic View of Contextual Types: from Simple Types to Dependent Types
Jason Z.S. Hu, Brigitte Pientka, Ulrich Sch\"opp

TL;DR
This paper provides a categorical semantics for Cocon, a contextual modal type theory, using presheaf models to unify simple and dependent types with a focus on syntax and invariants.
Contribution
It introduces a presheaf-based categorical model for Cocon, capturing contextual objects and extending to dependent types within a unified semantic framework.
Findings
Presheaf models effectively characterize Cocon's contextual objects.
A comonad $lat$ models closed elements, capturing substitution invariance.
Fragment of Cocon modeled without recursor in Fitch-style dependent modal type theory.
Abstract
We describe the categorical semantics for a simply typed variant and a simplified dependently typed variant of Cocon, a contextual modal type theory where the box modality mediates between the weak function space that is used to represent higher-order abstract syntax (HOAS) trees and the strong function space that describes (recursive) computations about them. What makes Cocon different from standard type theories is the presence of first-class contexts and contextual objects to describe syntax trees that are closed with respect to a given context of assumptions. Following M. Hofmann's work, we use a presheaf model to characterise HOAS trees. Surprisingly, this model already provides the necessary structure to also model Cocon. In particular, we can capture the contextual objects of Cocon using a comonad that restricts presheaves to their closed elements. This gives a simple…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Logic, programming, and type systems · Linguistics and Discourse Analysis
