Semantical Analysis of Contextual Types

We describe a category-theoretic semantics for a simply 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 \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\flat $$\end{document}♭ 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 express our category-theoretic constructions by using a modal internal type theory that is implemented in Agda-Flat.

[1]  Gordon D. Plotkin,et al.  Abstract syntax and variable binding , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[2]  Andrew Barber,et al.  Dual Intuitionistic Linear Logic , 1996 .

[3]  Andrew M. Pitts,et al.  A new approach to abstract syntax involving binders , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[4]  Martin Hofmann Semantical analysis of higher-order abstract syntax , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[5]  Bart Jacobs Comprehension Categories and the Semantics of Type Dependency , 1993, Theor. Comput. Sci..

[6]  Martin Hofmann,et al.  Syntax and semantics of dependent types , 1997 .

[7]  Robert Atkey,et al.  A type and scope safe universe of syntaxes with binding: their semantics and proofs , 2018, Journal of Functional Programming.

[8]  Brigitte Pientka,et al.  Programming with proofs and explicit contexts , 2008, PPDP '08.

[9]  Brigitte Pientka,et al.  Cocon: Computation in Contextual Type Theory , 2019, ArXiv.

[10]  Furio Honsell,et al.  An Axiomatic Approach to Metareasoning on Nominal Algebras in HOAS , 2001, ICALP.

[11]  G. A. Kavvos Intensionality, Intensional Recursion, and the Gödel-Löb axiom , 2017, FLAP.

[12]  Brigitte Pientka A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions , 2008, POPL '08.

[13]  Nick Benton,et al.  A Term Calculus for Intuitionistic Linear Logic , 1993, TLCA.

[14]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[15]  Frank Pfenning,et al.  Contextual modal type theory , 2008, TOCL.

[16]  John Cartmell,et al.  Generalised algebraic theories and contextual categories , 1986, Ann. Pure Appl. Log..

[17]  Michael Shulman,et al.  Brouwer's fixed-point theorem in real-cohesive homotopy type theory , 2015, Mathematical Structures in Computer Science.

[18]  Brigitte Pientka,et al.  Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description) , 2010, IJCAR.

[19]  Brigitte Pientka,et al.  A Type Theory for Defining Logics and Proofs , 2019, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[20]  Bas Spitters,et al.  Internal Universes in Models of Homotopy Type Theory , 2018, FSCD.

[21]  Brigitte Pientka,et al.  Inductive Beluga: Programming Proofs , 2015, CADE.

[22]  Furio Honsell,et al.  A framework for defining logics , 1993, JACM.

[23]  Peter Dybjer,et al.  Internal Type Theory , 1995, TYPES.

[24]  Brigitte Pientka,et al.  Well-Founded Recursion over Contextual Objects , 2015, TLCA.

[25]  T. Streicher Semantics of Type Theory , 1991, Progress in Theoretical Computer Science.

[26]  Dale Miller,et al.  Foundational aspects of syntax , 1999, CSUR.

[27]  Bas Spitters,et al.  Internal Universes in Models of Homotopy Type Theory , 2018, International Conference on Formal Structures for Computation and Deduction.