arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2205.06236cs.LOcs.PL
收藏

基于约束Horn子句的可变形合同

Verifying Catamorphism-Based Contracts using Constrained Horn Clauses

Emanuele De Angelis, Fabio Fioravanti, Alberto Pettorossi, Maurizio Proietti

摘要:

我们解决的问题,验证程序的功能满足他们的合同,指定的前/后条件。我们遵循一种基于约束Horn子句(CHCs)的方法,通过该方法,验证问题被简化为检查来自给定程序和合同的一组子句的可满足性的问题。我们认为程序,操作代数数据类型(ADT)和一类合同指定的蜕变,即简单的递归模式定义的给定ADT的功能。我们通过几个例子表明,国家的最先进的CHC可满足性工具是不能有效地解决可满足性问题的合同直接翻译成CHCs。为了克服这个困难,我们提出了一种转换技术,删除ADT条款的CHCs和派生新的条款,工作在基本排序,如整数和布尔。因此,当使用衍生的CHC时,不需要关于ADT的归纳规则。我们证明了变换是合理的,也就是说,如果CHCs的导出集是可满足的,那么原来的集合也是可满足的。我们还证明了转换总是终止的合同指定的类的蜕变。最后,我们提出了我们的技术的实现时,验证许多非平凡的合同ADT操纵程序所获得的实验结果。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑