A Category Theoretic View of Contextual Types: from Simple Types to Dependent Types

06/06/2022
by   Jason Z. S. Hu, et al.
0

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 semantic characterisation of the invariants of contextual types (e.g. substitution invariance) and identifies Cocon as a type-theoretic syntax of presheaf models. We further extend this characterisation to dependent types using categories with families and show that we can model a fragment of Cocon without recursor in the Fitch-style dependent modal type theory presented by Birkedal et. al..

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/10/2019

Cocon: Computation in Contextual Type Theory

We describe a Martin-Löf style dependent type theory, called Cocon, that...
research
05/07/2019

A Type Theory for Defining Logics and Proofs

We describe a Martin-Löf-style dependent type theory, called Cocon, that...
research
04/14/2018

Modal Dependent Type Theory and Dependent Right Adjoints

In recent years we have seen several new models of dependent type theory...
research
11/13/2022

Choice Trees: Representing Nondeterministic, Recursive, and Impure Programs in Coq

This paper introduces Choice Trees (ctrees), a monad for modeling nondet...
research
12/29/2019

ÆTHEL: Automatically Extracted Type-Logical Derivations for Dutch

We present ÆTHEL, a semantic compositionality dataset for written Dutch....
research
10/03/2022

Reflections on existential types

Existential types are reconstructed in terms of small reflective subuniv...
research
04/09/2018

Modality via Iterated Enrichment

This paper investigates modal type theories by using a new categorical s...

Please sign up or login with your details

Forgot password? Click here to reset