A Category Theoretic View of Contextual Types: From Simple Types to Dependent Types
-
Published:2022-10-20
Issue:4
Volume:23
Page:1-36
-
ISSN:1529-3785
-
Container-title:ACM Transactions on Computational Logic
-
language:en
-
Short-container-title:ACM Trans. Comput. Logic
Author:
Hu Jason Z. S.1ORCID,
Pientka Brigitte1ORCID,
Schöpp Ulrich2ORCID
Affiliation:
1. McGill University, Montréal, Québec, Canada
2. fortiss GmbH, Munich, Germany
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 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.
Funder
Natural Sciences and Engineering Research Council of Canada
Fonds de recherche du Québec - Nature et Technologies
Postgraduate Scholarship - Doctoral by the Natural Sciences and Engineering Research Council of Canada
Publisher
Association for Computing Machinery (ACM)
Subject
Computational Mathematics,Logic,General Computer Science,Theoretical Computer Science
Reference28 articles.
1. Two-level type theory and applications;Annenkov Danil;ArXiv E-prints,2017
2. Andrew Barber and Gordon Plotkin. 1996. Dual Intuitionistic Linear Logic. University of Edinburgh, Department of Computer Science, Laboratory for Foundations of Computer Science.
3. A term calculus for Intuitionistic Linear Logic
4. Modal dependent type theory and dependent right adjoints
5. Paolo Capriotti. 2016. Models of Type Theory with Strict Equality. Ph.D. Dissertation. School of Computer Science, University of Nottingham, UK, Nottingham. Retrieved from http://arxiv.org/abs/1702.04912.