论文标题

使用约束角子句验证基于血清的合同

Verifying Catamorphism-Based Contracts using Constrained Horn Clauses

论文作者

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

论文摘要

我们解决了验证计划的功能符合其合同的问题,该功能由前/后条件指定。我们遵循一种基于限制的角条款(CHC)的方法,通过该方法将验证问题减少到检查给定程序和合同的一组条款的满意度的问题。我们考虑操纵代数数据类型(ADT)的程序和一类由语态性指定的合同,也就是说,在给定的ADT上由简单的递归模式定义的函数。通过几个示例,我们表明,最先进的CHC满意度工具无效地解决了通过将合同直接转换为CHC获得的可满足性问题。为了克服这一困难,我们提出了一种转换技术,该技术可以从CHC中删除ADT术语,并得出仅在基本种类上使用的新条款集,例如整数和布尔值。因此,当使用派生的CHC时,不需要对ADT的归纳规则。我们证明了转换是声音的,也就是说,如果派生的CHC集令人满意,那么原始集合也是如此。我们还证明,转型始终终止由语态性指定的合同类别。最后,在验证许多用于操纵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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源