We present a graded modal type theory, a dependent type theory with grades that can be used to enforce various properties of the code. The theory has $Π$-types, weak and strong $Σ$-types, natural numbers, an empty type, and a universe, and we also extend the theory with weak and strong unit types and graded $Σ$-types. The theory is parameterized by a modality structure, a kind of partially ordered semiring, whose elements (grades) are used to track the usage of variables in terms and types. Different modalities are possible. We focus mainly on quantitative properties, in particular erasure: with the erasure modality one can mark function arguments as erasable. The theory is fully formalized in Agda. The formalization, which uses a syntactic Kripke logical relation at its core and is based on earlier work, establishes major meta-theoretic properties such as subject reduction, consistency, normalization, and decidability of definitional equality. We also prove a substitution theorem for grade assignment, and preservation of grades under reduction. Furthermore we study an extraction function that translates terms to an untyped $λ$-calculus and removes erasable content, in particular function arguments with the "erasable" grade. For a certain class of modalities we prove that extraction is sound, in the sense that programs of natural number type have the same value before and after extraction. Soundness of extraction holds also for open programs, as long as all variables in the context are erasable, the context is consistent, and erased matches are not allowed for weak $Σ$-types.


翻译:我们提出了一种分级模态类型理论,这是一种带有等级标记的依赖类型理论,可用于强制执行代码的多种性质。该理论包含Π-类型、弱Σ-类型与强Σ-类型、自然数、空类型及一个宇宙,并进一步扩展到弱单位类型、强单位类型及分级Σ-类型。该理论以模态结构(一种偏序半环)为参数,其元素(即等级)用于跟踪项和类型中变量的使用情况。不同模态均可适用。我们主要关注量化性质,特别是擦除功能:借助擦除模态,可将函数参数标记为可擦除。该理论已在Agda中完全形式化。该形式化以语法克里普克逻辑关系为核心,基于前期工作构建,确立了主体元理论性质,包括主题归约、一致性、正规化及定义性相等的可判定性。我们还证明了等级赋值的替换定理,以及归约下等级的保持性。此外,我们研究了一种提取函数,该函数将项翻译为无类型λ-演算,并移除可擦除内容(尤其是具有"可擦除"等级的函数参数)。对于特定类别的模态,我们证明了提取的可靠性:即自然数类型的程序在提取前后具有相同的值。对于开放程序,只要上下文中的所有变量均为可擦除、上下文一致,且不允许弱Σ-类型的擦除匹配,提取的可靠性依然成立。

0
下载
关闭预览

相关内容

多模态模型架构的演变
专知会员服务
71+阅读 · 2024年5月29日
【经典书】模式识别概率理论,654页pdf
专知会员服务
88+阅读 · 2021年1月21日
专知会员服务
149+阅读 · 2020年9月6日
基于模型的强化学习综述
专知
42+阅读 · 2022年7月13日
这可能是「多模态机器学习」最通俗易懂的介绍
计算机视觉life
113+阅读 · 2018年12月20日
统计学常用数据类型
论智
19+阅读 · 2018年7月6日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月26日
Arxiv
0+阅读 · 5月18日
Arxiv
0+阅读 · 5月17日
Arxiv
0+阅读 · 5月12日
Arxiv
14+阅读 · 2024年5月28日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
8+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
10+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关VIP内容
多模态模型架构的演变
专知会员服务
71+阅读 · 2024年5月29日
【经典书】模式识别概率理论,654页pdf
专知会员服务
88+阅读 · 2021年1月21日
专知会员服务
149+阅读 · 2020年9月6日
相关论文
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员