使用受限角子句验证基于变形的契约

IF 1.4 2区 数学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Theory and Practice of Logic Programming Pub Date : 2022-05-12 DOI:10.1017/S1471068422000175
E. DE ANGELIS, M. Proietti, F. Fioravanti, A. Pettorossi
{"title":"使用受限角子句验证基于变形的契约","authors":"E. DE ANGELIS, M. Proietti, F. Fioravanti, A. Pettorossi","doi":"10.1017/S1471068422000175","DOIUrl":null,"url":null,"abstract":"Abstract We address the problem of verifying that the functions of a program meet their contracts, specified by pre/postconditions. We follow an approach based on constrained Horn clauses (CHCs) by which the verification problem is reduced to the problem of checking satisfiability of a set of clauses derived from the given program and contracts. We consider programs that manipulate algebraic data types (ADTs) and a class of contracts specified by catamorphisms, that is, functions defined by simple recursion schemata on the given ADTs. We show by several examples that state-of-the-art CHC satisfiability tools are not effective at solving the satisfiability problems obtained by direct translation of the contracts into CHCs. To overcome this difficulty, we propose a transformation technique that removes the ADT terms from CHCs and derives new sets of clauses that work on basic sorts only, such as integers and booleans. Thus, when using the derived CHCs there is no need for induction rules on ADTs. We prove that the transformation is sound, that is, if the derived set of CHCs is satisfiable, then so is the original set. We also prove that the transformation always terminates for the class of contracts specified by catamorphisms. Finally, we present the experimental results obtained by an implementation of our technique when verifying many non-trivial contracts for ADT manipulating programs.","PeriodicalId":49436,"journal":{"name":"Theory and Practice of Logic Programming","volume":null,"pages":null},"PeriodicalIF":1.4000,"publicationDate":"2022-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"title\":\"Verifying Catamorphism-Based Contracts using Constrained Horn Clauses\",\"authors\":\"E. DE ANGELIS, M. Proietti, F. Fioravanti, A. Pettorossi\",\"doi\":\"10.1017/S1471068422000175\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Abstract We address the problem of verifying that the functions of a program meet their contracts, specified by pre/postconditions. We follow an approach based on constrained Horn clauses (CHCs) by which the verification problem is reduced to the problem of checking satisfiability of a set of clauses derived from the given program and contracts. We consider programs that manipulate algebraic data types (ADTs) and a class of contracts specified by catamorphisms, that is, functions defined by simple recursion schemata on the given ADTs. We show by several examples that state-of-the-art CHC satisfiability tools are not effective at solving the satisfiability problems obtained by direct translation of the contracts into CHCs. To overcome this difficulty, we propose a transformation technique that removes the ADT terms from CHCs and derives new sets of clauses that work on basic sorts only, such as integers and booleans. Thus, when using the derived CHCs there is no need for induction rules on ADTs. We prove that the transformation is sound, that is, if the derived set of CHCs is satisfiable, then so is the original set. We also prove that the transformation always terminates for the class of contracts specified by catamorphisms. Finally, we present the experimental results obtained by an implementation of our technique when verifying many non-trivial contracts for ADT manipulating programs.\",\"PeriodicalId\":49436,\"journal\":{\"name\":\"Theory and Practice of Logic Programming\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":1.4000,\"publicationDate\":\"2022-05-12\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Theory and Practice of Logic Programming\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://doi.org/10.1017/S1471068422000175\",\"RegionNum\":2,\"RegionCategory\":\"数学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theory and Practice of Logic Programming","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1017/S1471068422000175","RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 3

摘要

我们解决的问题是验证程序的函数是否满足由前置/后置条件指定的契约。我们采用了一种基于约束霍恩条款(CHCs)的方法,通过该方法,验证问题被简化为检查从给定计划和合同派生的一组条款的可满足性问题。我们考虑操作代数数据类型(adt)的程序和一类由变形指定的契约,即在给定adt上由简单递归模式定义的函数。我们通过几个例子表明,最先进的CHC可满足性工具在解决直接将合同翻译成CHC所获得的可满足性问题时并不有效。为了克服这个困难,我们提出了一种转换技术,从chc中删除ADT项,并派生出仅适用于基本排序(如整数和布尔值)的新子句集。因此,当使用导出的chc时,不需要对adt进行归纳规则。我们证明了这个变换是可靠的,即如果chc的派生集是可满足的,那么原始集也是可满足的。我们还证明了对于由变形所指定的契约类,变换总是终止的。最后,我们给出了我们的技术在验证ADT操作程序的许多非平凡契约时所获得的实验结果。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Verifying Catamorphism-Based Contracts using Constrained Horn Clauses
Abstract We address the problem of verifying that the functions of a program meet their contracts, specified by pre/postconditions. We follow an approach based on constrained Horn clauses (CHCs) by which the verification problem is reduced to the problem of checking satisfiability of a set of clauses derived from the given program and contracts. We consider programs that manipulate algebraic data types (ADTs) and a class of contracts specified by catamorphisms, that is, functions defined by simple recursion schemata on the given ADTs. We show by several examples that state-of-the-art CHC satisfiability tools are not effective at solving the satisfiability problems obtained by direct translation of the contracts into CHCs. To overcome this difficulty, we propose a transformation technique that removes the ADT terms from CHCs and derives new sets of clauses that work on basic sorts only, such as integers and booleans. Thus, when using the derived CHCs there is no need for induction rules on ADTs. We prove that the transformation is sound, that is, if the derived set of CHCs is satisfiable, then so is the original set. We also prove that the transformation always terminates for the class of contracts specified by catamorphisms. Finally, we present the experimental results obtained by an implementation of our technique when verifying many non-trivial contracts for ADT manipulating programs.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Theory and Practice of Logic Programming
Theory and Practice of Logic Programming 工程技术-计算机:理论方法
CiteScore
4.50
自引率
21.40%
发文量
40
审稿时长
>12 weeks
期刊介绍: Theory and Practice of Logic Programming emphasises both the theory and practice of logic programming. Logic programming applies to all areas of artificial intelligence and computer science and is fundamental to them. Among the topics covered are AI applications that use logic programming, logic programming methodologies, specification, analysis and verification of systems, inductive logic programming, multi-relational data mining, natural language processing, knowledge representation, non-monotonic reasoning, semantic web reasoning, databases, implementations and architectures and constraint logic programming.
期刊最新文献
Metric Temporal Equilibrium Logic over Timed Traces Multi-Shot Answer Set Programming for Flexible Payroll Management Unit Testing in ASP Revisited: Language and Test-Driven Development Environment Evaluating Datalog Tools for Meta-reasoning over OWL 2 QL Model Explanation via Support Graphs
×
引用
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