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

IF 0.7 4区 数学 Q3 COMPUTER SCIENCE, THEORY & METHODS ACM Transactions on Computational Logic Pub Date : 2022-10-20 DOI:https://dl.acm.org/doi/10.1145/3545115
Jason Z. S. Hu, Brigitte Pientka, Ulrich Schöpp
{"title":"A Category Theoretic View of Contextual Types: From Simple Types to Dependent Types","authors":"Jason Z. S. Hu, Brigitte Pientka, Ulrich Schöpp","doi":"https://dl.acm.org/doi/10.1145/3545115","DOIUrl":null,"url":null,"abstract":"<p>We describe the categorical semantics for a simply typed variant and a simplified dependently typed variant of <span>Cocon</span>, 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 <span>Cocon</span> 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 <span>Cocon</span>. In particular, we can capture the contextual objects of <span>Cocon</span> 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 <span>Cocon</span> 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 <span>Cocon</span> without recursor in the Fitch-style dependent modal type theory presented by Birkedal et al.</p>","PeriodicalId":50916,"journal":{"name":"ACM Transactions on Computational Logic","volume":null,"pages":null},"PeriodicalIF":0.7000,"publicationDate":"2022-10-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM Transactions on Computational Logic","FirstCategoryId":"94","ListUrlMain":"https://doi.org/https://dl.acm.org/doi/10.1145/3545115","RegionNum":4,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0

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.

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
语境类型的范畴论视角:从简单类型到依赖类型
我们描述了Cocon的简单类型变体和简化的依赖类型变体的范畴语义,这是一种上下文模态类型理论,其中框模态介于用于表示高阶抽象语法(HOAS)树的弱函数空间和描述关于它们的(递归)计算的强函数空间之间。Cocon与标准类型理论的不同之处在于,它使用一级上下文和上下文对象来描述语法树,这些语法树相对于给定的假设上下文是封闭的。遵循M. Hofmann的工作,我们使用预层模型来表征HOAS树。令人惊讶的是,这个模型已经提供了必要的结构来为con建模。特别地,我们可以用一个将预页限制在其封闭元素上的共通点来捕获上下文对象。这给出了上下文类型不变量(例如替换不变量)的简单语义特征,并将Cocon标识为预表模型的类型论语法。我们进一步将这一特征扩展到使用具有家族的类别的依赖类型,并表明我们可以在Birkedal等人提出的fitch风格依赖模态类型理论中对没有递归的Cocon片段进行建模。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
ACM Transactions on Computational Logic
ACM Transactions on Computational Logic 工程技术-计算机:理论方法
CiteScore
2.30
自引率
0.00%
发文量
37
审稿时长
>12 weeks
期刊介绍: TOCL welcomes submissions related to all aspects of logic as it pertains to topics in computer science. This area has a great tradition in computer science. Several researchers who earned the ACM Turing award have also contributed to this field, namely Edgar Codd (relational database systems), Stephen Cook (complexity of logical theories), Edsger W. Dijkstra, Robert W. Floyd, Tony Hoare, Amir Pnueli, Dana Scott, Edmond M. Clarke, Allen E. Emerson, and Joseph Sifakis (program logics, program derivation and verification, programming languages semantics), Robin Milner (interactive theorem proving, concurrency calculi, and functional programming), and John McCarthy (functional programming and logics in AI). Logic continues to play an important role in computer science and has permeated several of its areas, including artificial intelligence, computational complexity, database systems, and programming languages. The Editorial Board of this journal seeks and hopes to attract high-quality submissions in all the above-mentioned areas of computational logic so that TOCL becomes the standard reference in the field. Both theoretical and applied papers are sought. Submissions showing novel use of logic in computer science are especially welcome.
期刊最新文献
Computationally Hard Problems for Logic Programs under Answer Set Semantics Fundamental Logic is Decidable SAT Modulo Symmetries for Graph Generation and Enumeration Strong Backdoors for Default Logic One or Nothing: Anti-unification over the Simply-Typed Lambda Calculus
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1