Structural refinement types

David Binder, Ingo Skupin, David Läwen, K. Ostermann
{"title":"Structural refinement types","authors":"David Binder, Ingo Skupin, David Läwen, K. Ostermann","doi":"10.1145/3546196.3550163","DOIUrl":null,"url":null,"abstract":"Static types are a great form of lightweight static analysis. But sometimes a type like List is too coarse – we would also like to work with its refinements like non-empty lists, or lists containing exactly 42 elements. Dependent types allow for this, but they impose a heavy proof burden on the programmer. We want the checking and inference of refinements to be fully automatic. In this article we present a simple refinement type system and inference algorithm which uses only variants of familiar concepts from constraint-based type inference. Concretely, we build on the algebraic subtyping approach and extend it with typing rules which combine properties of nominal and structural type systems in a novel way. Despite the simplicity of our approach, the resulting type system is very expressive and allows to specify and infer non-trivial properties of programs.","PeriodicalId":417117,"journal":{"name":"Proceedings of the 7th ACM SIGPLAN International Workshop on Type-Driven Development","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-09-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 7th ACM SIGPLAN International Workshop on Type-Driven Development","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3546196.3550163","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Static types are a great form of lightweight static analysis. But sometimes a type like List is too coarse – we would also like to work with its refinements like non-empty lists, or lists containing exactly 42 elements. Dependent types allow for this, but they impose a heavy proof burden on the programmer. We want the checking and inference of refinements to be fully automatic. In this article we present a simple refinement type system and inference algorithm which uses only variants of familiar concepts from constraint-based type inference. Concretely, we build on the algebraic subtyping approach and extend it with typing rules which combine properties of nominal and structural type systems in a novel way. Despite the simplicity of our approach, the resulting type system is very expressive and allows to specify and infer non-trivial properties of programs.
结构细化类型
静态类型是轻量级静态分析的一种很好的形式。但是有时像List这样的类型太粗糙了——我们也想使用它的改进,比如非空列表,或者只包含42个元素的列表。依赖类型允许这样做,但是它们给程序员带来了沉重的证明负担。我们希望改进的检查和推断是全自动的。在本文中,我们提出了一个简单的细化类型系统和推理算法,该算法仅使用基于约束的类型推理中熟悉概念的变体。具体地说,我们在代数子类型方法的基础上,用一种新的方式结合了名义类型系统和结构类型系统的性质的类型规则对其进行了扩展。尽管我们的方法很简单,但是生成的类型系统非常具有表现力,并且允许指定和推断程序的重要属性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信