Shape-Constrained Array Programming with Size-Dependent Types

Lubin Bailly, Troels Henriksen, M. Elsman
{"title":"Shape-Constrained Array Programming with Size-Dependent Types","authors":"Lubin Bailly, Troels Henriksen, M. Elsman","doi":"10.1145/3609024.3609412","DOIUrl":null,"url":null,"abstract":"We present a dependent type system for enforcing array-size consistency in an ML-style functional array language. Our goal is to enforce shape-consistency at compile time and allow nontrivial transformations on array shapes, without the complexity such features tend to introduce in dependently typed languages. Sizes can be arbitrary expressions and size equality is purely syntactical, which fits naturally within a scheme that interprets size-polymorphic functions as having implicit arguments. When non-syntactical equalities are needed, we provide dynamic checking. In contrast to other dependently typed languages, we automate the book-keeping involved in tracking existential sizes, such as when filtering arrays. We formalise a large subset of the presented type system and prove it sound. We also discuss how to adapt the type system for a real implementation, including type inference, within the Futhark programming language.","PeriodicalId":424755,"journal":{"name":"Proceedings of the 11th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing","volume":"11 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-08-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 11th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3609024.3609412","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

We present a dependent type system for enforcing array-size consistency in an ML-style functional array language. Our goal is to enforce shape-consistency at compile time and allow nontrivial transformations on array shapes, without the complexity such features tend to introduce in dependently typed languages. Sizes can be arbitrary expressions and size equality is purely syntactical, which fits naturally within a scheme that interprets size-polymorphic functions as having implicit arguments. When non-syntactical equalities are needed, we provide dynamic checking. In contrast to other dependently typed languages, we automate the book-keeping involved in tracking existential sizes, such as when filtering arrays. We formalise a large subset of the presented type system and prove it sound. We also discuss how to adapt the type system for a real implementation, including type inference, within the Futhark programming language.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
具有大小依赖类型的形状约束数组编程
我们提出了一个依赖类型系统,用于在ml风格的函数数组语言中强制数组大小的一致性。我们的目标是在编译时强制形状一致性,并允许对数组形状进行重要的转换,而不需要在依赖类型语言中引入这些特性所带来的复杂性。大小可以是任意表达式,大小相等纯粹是语法上的,这自然适合将大小多态函数解释为具有隐式参数的模式。当需要非语法等式时,我们提供动态检查。与其他依赖类型语言相比,我们自动化了跟踪存在大小所涉及的簿记,例如在过滤数组时。我们形式化了所提出的类型系统的一个大子集,并证明它是合理的。我们还讨论了如何在Futhark编程语言中为实际实现调整类型系统,包括类型推断。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Rank-Polymorphism for Shape-Guided Blocking Shape-Constrained Array Programming with Size-Dependent Types Efficient GPU Implementation of Affine Index Permutations on Arrays Proceedings of the 11th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1