Proving correctness of imperative programs by linearizing constrained Horn clauses

EMANUELE DE ANGELIS, FABIO FIORAVANTI, ALBERTO PETTOROSSI, MAURIZIO PROIETTI
2015 Theory and Practice of Logic Programming  
AbstractWe present a method for verifying the correctness of imperative programs which is based on the automated transformation of their specifications. Given a programprog, we consider a partial correctness specification of the form {ϕ},prog{ψ}, where the assertions ϕ and ψ are predicates defined by a setSpecof possibly recursive Horn clauses with linear arithmetic (LA) constraints in their premise (also calledconstrained Horn clauses). The verification method consists in constructing a
more » ... constrained Horn clauses whose satisfiability implies that {ϕ},prog, {ψ} is valid. We highlight some limitations of state-of-the-art constrained Horn clause solving methods, here calledLA-solving methods, which prove the satisfiability of the clauses by looking for linear arithmetic interpretations of the predicates. In particular, we prove that there exist some specifications that cannot be proved valid by any of thoseLA-solving methods. These specifications require the proof of satisfiability of a setPCof constrained Horn clauses that containnonlinear clauses(that is, clauses with more than one atom in their premise). Then, we present a transformation, calledlinearization, that convertsPCinto a set oflinearclauses (that is, clauses with at most one atom in their premise). We show that several specifications that could not be proved valid byLA-solving methods, can be proved valid after linearization. We also present a strategy for performing linearization in an automatic way and we report on some experimental results obtained by using a preliminary implementation of our method.
doi:10.1017/s1471068415000289 fatcat:3avbtyt3tjhshad3tnq4pcwv4i