Erasure enriches type theory with a distinction between runtime relevant and irrelevant data, allowing the compilation step to safely erase the latter. Versions of this feature are implemented by many systems, including Agda, Idris, and Rocq. We present a structural version of type theory with erasure, formulated as a second-order generalised algebraic theory (SOGAT). Erasure is encoded as a phase distinction between runtime and erased terms, in the form of a proposition that can appear in a context. This formulation has several advantages: it has models based on categories with families, is compatible with other structural features such as staging, and provides a better guideline for implementation. Through the model theory of SOGATs, we study the semantics of type theory with erasure in families of sets, which generalises to any Grothendieck topos equipped with a tiny proposition. We establish conservativity over Martin-Löf type theory (MLTT) in both phases. For code extraction, we construct a presheaf model that produces untyped lambda calculus programs and prove its correctness through gluing. Our results are formalised in Agda and we provide a toy elaborator implementation.


翻译:擦除为类型论增添了运行时相关数据与无关数据的区分,使编译阶段能够安全地删除后者。许多系统(包括Agda、Idris和Rocq)都实现了该功能的变体。我们提出了一种含擦除的结构化类型论,将其形式化为二阶广义代数理论(SOGAT)。擦除被编码为运行时项与擦除项之间的阶段区分,表现为可出现在语境中的命题形式。这种形式化具有多项优势:它拥有基于含族范畴的模型,与阶段性等其他结构化特性兼容,并为实现提供了更优的指导。通过SOGAT的模型论,我们在集合族中研究了含擦除类型论的语义,该语义可推广至任何配备微命题的格罗腾迪克拓扑。我们建立了两个阶段相对于马丁-勒夫类型论(MLTT)的保守性。对于代码提取,我们构造了一个产生无类型lambda演算程序的预层模型,并通过粘合证明了其正确性。我们的结果已在Agda中形式化,并提供了玩具级实现器。

0
下载
关闭预览

相关内容

「因果推理」概述论文,13页pdf
专知
16+阅读 · 2021年3月20日
【AAAI2021】对比聚类,Contrastive Clustering
专知
26+阅读 · 2021年1月30日
统计学常用数据类型
论智
19+阅读 · 2018年7月6日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
14+阅读 · 2008年12月31日
VIP会员
最新内容
重新思考无人机时代的生存能力
专知会员服务
2+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
2+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
3+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
3+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
5+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
14+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员