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】可达性约束强化学习
专知会员服务
24+阅读 · 2022年5月18日
专知会员服务
34+阅读 · 2021年9月7日
专知会员服务
79+阅读 · 2021年3月16日
【经典书】线性代数,Linear Algebra,525页pdf
专知会员服务
80+阅读 · 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会员
相关主题
最新内容
刚刚!Jev中文教程项目发布了
专知会员服务
0+阅读 · 10月4日
《人工智能赋能的适应性多功能电磁战》
专知会员服务
12+阅读 · 9月29日
俄乌战场实验室:全面战争如何重塑现代作战
专知会员服务
8+阅读 · 9月29日
2026年美空军协会会议上的无人机系统趋势
专知会员服务
11+阅读 · 9月28日
反制无人机:乌克兰提供的五点启示
专知会员服务
17+阅读 · 9月23日
《各指挥层级均亟需红队能力》报告
专知会员服务
11+阅读 · 9月23日
相关VIP内容
【ICML2022】可达性约束强化学习
专知会员服务
24+阅读 · 2022年5月18日
专知会员服务
34+阅读 · 2021年9月7日
专知会员服务
79+阅读 · 2021年3月16日
【经典书】线性代数,Linear Algebra,525页pdf
专知会员服务
80+阅读 · 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会员