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中形式化。形式化以句法Kripke逻辑关系为核心,并基于前期工作,建立了主体归约、一致性、归一化以及定义性等式的可判定性等主要元理论性质。我们还证明了分级赋值的代入定理以及归约下分级的保持性。此外,我们研究了一种提取函数,它可将项转换为无类型λ-演算并移除可擦除内容,特别是带有“可擦除”分级的函数参数。对于某类模态,我们证明了提取的可靠性能:自然数类型程序在提取前后具有相同的值。对于开放式程序,只要上下文所有变量均为可擦除、上下文一致,且弱Σ-类型不允许擦除匹配,则提取的可靠性同样成立。

0
下载
关闭预览

相关内容

多模态模型架构的演变
专知会员服务
71+阅读 · 2024年5月29日
【经典书】模式识别概率理论,654页pdf
专知会员服务
88+阅读 · 2021年1月21日
专知会员服务
149+阅读 · 2020年9月6日
这可能是「多模态机器学习」最通俗易懂的介绍
计算机视觉life
113+阅读 · 2018年12月20日
用模型不确定性理解模型
论智
11+阅读 · 2018年9月5日
统计学常用数据类型
论智
19+阅读 · 2018年7月6日
【紫冬精选】国内近三年模式分类研究现状综述
中国科学院自动化研究所
14+阅读 · 2018年4月3日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Arxiv
0+阅读 · 5月26日
Arxiv
0+阅读 · 5月18日
Arxiv
0+阅读 · 5月17日
Arxiv
0+阅读 · 5月12日
Arxiv
14+阅读 · 2024年5月28日
VIP会员
最新内容
综述 | 从问答到任务完成:Agent系统与Harness设计
专知会员服务
2+阅读 · 今天16:54
Agentic RL:框架、实践与长程智能体训练
专知会员服务
1+阅读 · 今天16:52
重新思考无人机时代的生存能力
专知会员服务
5+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
4+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
4+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
4+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
6+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关资讯
相关论文
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员