arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2206.02831cs.LOcs.PL
收藏

上下文类型的范畴论视角:从简单类型到依赖类型

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

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

AI总结:

本文利用预层模型和余单子 $\ lat$ 刻画 Cocon 的上下文类型语义,并借助带族范畴将其扩展到依赖类型。

摘要:

我们描述了 Cocon 的一个简单类型变体和一个简化的依赖类型变体的范畴语义;Cocon 是一种上下文模态类型理论,其中 box 模态在用于表示高阶抽象语法(HOAS)树的弱函数空间与描述关于这些树的(递归)计算的强函数空间之间进行协调。Cocon 与标准类型理论的不同之处在于,它提供了一等上下文和上下文对象,用于描述相对于给定假设上下文封闭的语法树。遵循 M. Hofmann 的工作,我们使用预层模型来刻画 HOAS 树。令人惊讶的是,该模型已经提供了同样可用于为 Cocon 建模的必要结构。特别是,我们可以使用余单子 $\ lat$ 来捕获 Cocon 的上下文对象,该余单子将预层限制为其封闭元素。这给出了上下文类型不变量(例如替换不变性)的简单语义刻画,并将 Cocon 识别为预层模型的一种类型理论语法。我们进一步利用带族范畴将这一刻画扩展到依赖类型,并表明我们可以在 Birkedal 等人提出的 Fitch 风格依赖模态类型理论中为 Cocon 的一个不含递归子的片段建模。

英文摘要:

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..

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑