论文标题

上下文类型的类别理论观点:从简单类型到相关类型

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

论文作者

Hu, Jason Z. S., Pientka, Brigitte, Schöpp, Ulrich

论文摘要

我们描述了简单键入的变体和简化的依赖性类型的Cocon的分类语义,Cocon是一种上下文模态类型理论,其中盒子模态介导了用于表示高级抽象语法(HOAS)树的弱函数空间与描述(递归)计算的强大功能空间的弱函数空间。使Cocon与标准类型理论不同的是存在一流的上下文和上下文对象,以描述与给定假设上下文相关的语法树。在M. Hofmann的工作之后,我们使用预局部模型来表征Hoas树。令人惊讶的是,该模型已经提供了对Cocon建模的必要结构。特别是,我们可以使用Comonad $ \ flat $捕获可可的上下文对象,该对象限制了预兆的封闭元素。这给出了上下文类型的不变性(例如替代不变性)的简单语义表征,并将Cocon鉴定为Presheaf模型的类型理论语法。我们进一步将这种特征扩展到与家族的类别相关类型,并表明我们可以在Birkedal Et提出的fitch风格的依赖模态类型理论中对Cocon的碎片进行建模。 Al ..

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 $\flat$ 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..

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源