Extending Liquid Types to Arrays

Manuel Montenegro, S. Nieva, R. Peña, Clara Segura
{"title":"Extending Liquid Types to Arrays","authors":"Manuel Montenegro, S. Nieva, R. Peña, Clara Segura","doi":"10.1145/3362740","DOIUrl":null,"url":null,"abstract":"A liquid type is an ordinary Hindley-Milner type annotated with a logical predicate that states the properties satisfied by the elements of that type. Liquid types are a powerful tool for program verification, as programmers can use them to specify pre- and post conditions of their programs, whereas the predicates of intermediate variables and auxiliary functions are inferred automatically. Type inference is feasible in this context, as the logical predicates within liquid types are constrained to a quantifier-free logic to maintain decidability. In this article, we extend liquid types by allowing them to contain quantified properties on arrays so that they can be used to infer invariants on array-related programs (e.g., implementations of sorting algorithms). Although quantified logic is, in general, undecidable, we restrict properties on arrays to a decidable subset introduced by Bradley et al. We describe in detail the extended type system, the verification condition generator, and the iterative weakening algorithm for inferring invariants. After proving the correctness and completeness of these two algorithms, we apply them to find invariants on a set of algorithms involving array manipulations.","PeriodicalId":191685,"journal":{"name":"ACM Transactions on Computational Logic (TOCL)","volume":"100 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-01-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM Transactions on Computational Logic (TOCL)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3362740","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

A liquid type is an ordinary Hindley-Milner type annotated with a logical predicate that states the properties satisfied by the elements of that type. Liquid types are a powerful tool for program verification, as programmers can use them to specify pre- and post conditions of their programs, whereas the predicates of intermediate variables and auxiliary functions are inferred automatically. Type inference is feasible in this context, as the logical predicates within liquid types are constrained to a quantifier-free logic to maintain decidability. In this article, we extend liquid types by allowing them to contain quantified properties on arrays so that they can be used to infer invariants on array-related programs (e.g., implementations of sorting algorithms). Although quantified logic is, in general, undecidable, we restrict properties on arrays to a decidable subset introduced by Bradley et al. We describe in detail the extended type system, the verification condition generator, and the iterative weakening algorithm for inferring invariants. After proving the correctness and completeness of these two algorithms, we apply them to find invariants on a set of algorithms involving array manipulations.
将液体类型扩展到数组
液体类型是一种普通的Hindley-Milner类型,它带有一个逻辑谓词,说明了该类型的元素所满足的属性。液体类型是程序验证的强大工具,因为程序员可以使用它们来指定程序的前置和后置条件,而中间变量和辅助函数的谓词是自动推断的。在这种情况下,类型推断是可行的,因为液体类型中的逻辑谓词被限制为无量词的逻辑以保持可判决性。在本文中,我们扩展了液态类型,允许它们包含数组上的量化属性,以便它们可以用于推断与数组相关的程序(例如,排序算法的实现)上的不变量。虽然量化逻辑通常是不可判定的,但我们将数组的属性限制为Bradley等人引入的可判定子集。详细描述了扩展类型系统、验证条件生成器和推断不变量的迭代弱化算法。在证明了这两种算法的正确性和完备性之后,我们将它们应用到一组涉及数组操作的算法上寻找不变量。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信
小红书