Linear constraints are the linear counterpart of Haskell's class constraints. Linearly typed parameters allow the programmer to control resources such as file handles and manually managed memory as linear arguments. Indeed, a linear type system can verify that these resources are used safely. However, writing code with explicit linear arguments requires bureaucracy. Linear constraints address this shortcoming: a linear constraint acts as an implicit linear argument that can be filled in automatically by the compiler. We present this new feature as a qualified type system, together with an inference algorithm which extends GHC's existing constraint solver algorithm. Soundness of linear constraints is ensured by the fact that they desugar into Linear Haskell. This paper is a revised and extended version of a previous paper by the same authors (arXiv:2103.06127). The formal system and the constraint solver have been significantly simplified and numerous additional applications are described.


翻译:线性约束是Haskell类约束的线性对应物。线性类型参数允许程序员将文件句柄和手动管理内存等资源作为线性参数进行控制。事实上,线性类型系统可以验证这些资源是否被安全使用。然而,使用显式线性参数编写代码需要繁琐的手续。线性约束解决了这一缺陷:线性约束充当隐式线性参数,可由编译器自动填充。我们将此新功能呈现为一种限定类型系统,并附带一种推理算法,该算法扩展了GHC现有的约束求解器算法。线性约束的正确性通过它们被去糖化为Linear Haskell来确保。本文是同一作者先前论文(arXiv:2103.06127)的修订和扩展版本。形式系统和约束求解器已显著简化,并描述了大量额外应用。

0
下载
关闭预览

相关内容

【ICML2022】可达性约束强化学习
专知会员服务
23+阅读 · 2022年5月18日
专知会员服务
33+阅读 · 2021年9月7日
专知会员服务
78+阅读 · 2021年3月16日
【经典书】线性代数,Linear Algebra,525页pdf
专知会员服务
79+阅读 · 2021年1月29日
【经典书】线性代数,352页pdf教你应该这样学
专知会员服务
107+阅读 · 2020年12月20日
【CMU】深度学习模型中集成优化、约束和控制,33页ppt
专知会员服务
46+阅读 · 2020年5月23日
MIT线性代数(Linear Algebra)中文笔记
专知
53+阅读 · 2019年11月4日
那些值得推荐和收藏的线性代数学习资源
入门 | 这是一份文科生都能看懂的线性代数简介
机器之心
14+阅读 · 2018年3月31日
【干货】​深度学习中的线性代数
专知
21+阅读 · 2018年3月30日
线性回归:简单线性回归详解
专知
12+阅读 · 2018年3月10日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 4月23日
VIP会员
相关主题
最新内容
重新思考无人机时代的生存能力
专知会员服务
2+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
2+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
3+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
3+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
5+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关VIP内容
【ICML2022】可达性约束强化学习
专知会员服务
23+阅读 · 2022年5月18日
专知会员服务
33+阅读 · 2021年9月7日
专知会员服务
78+阅读 · 2021年3月16日
【经典书】线性代数,Linear Algebra,525页pdf
专知会员服务
79+阅读 · 2021年1月29日
【经典书】线性代数,352页pdf教你应该这样学
专知会员服务
107+阅读 · 2020年12月20日
【CMU】深度学习模型中集成优化、约束和控制,33页ppt
专知会员服务
46+阅读 · 2020年5月23日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员