Verification of Imperative Programs by Constraint Logic Program Transformation

Emanuele De Angelis, Fabio Fioravanti, Alberto Pettorossi, Maurizio Proietti
<span title="2013-09-19">2013</span> <i title="Open Publishing Association"> <a target="_blank" rel="noopener" href="https://fatcat.wiki/container/qzezkwolyvf33pglm2jldjklca" style="color: black;">Electronic Proceedings in Theoretical Computer Science</a> </i> &nbsp;
We present a method for verifying partial correctness properties of imperative programs that manipulate integers and arrays by using techniques based on the transformation of constraint logic programs (CLP). We use CLP as a metalanguage for representing imperative programs, their executions, and their properties. First, we encode the correctness of an imperative program, say prog, as the negation of a predicate 'incorrect' defined by a CLP program T. By construction, 'incorrect' holds in the
more &raquo; ... st model of T if and only if the execution of prog from an initial configuration eventually halts in an error configuration. Then, we apply to program T a sequence of transformations that preserve its least model semantics. These transformations are based on well-known transformation rules, such as unfolding and folding, guided by suitable transformation strategies, such as specialization and generalization. The objective of the transformations is to derive a new CLP program TransfT where the predicate 'incorrect' is defined either by (i) the fact 'incorrect.' (and in this case prog is not correct), or by (ii) the empty set of clauses (and in this case prog is correct). In the case where we derive a CLP program such that neither (i) nor (ii) holds, we iterate the transformation. Since the problem is undecidable, this process may not terminate. We show through examples that our method can be applied in a rather systematic way, and is amenable to automation by transferring to the field of program verification many techniques developed in the field of program transformation.
<span class="external-identifiers"> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.4204/eptcs.129.12">doi:10.4204/eptcs.129.12</a> <a target="_blank" rel="external noopener" href="https://fatcat.wiki/release/ot54j7sol5errm7cryxolqywcy">fatcat:ot54j7sol5errm7cryxolqywcy</a> </span>
<a target="_blank" rel="noopener" href="https://web.archive.org/web/20170705120749/http://www.iasi.cnr.it/%7Eproietti/papers/2013_DFPP_SAIRP.pdf" title="fulltext PDF download" data-goatcounter-click="serp-fulltext" data-goatcounter-title="serp-fulltext"> <button class="ui simple right pointing dropdown compact black labeled icon button serp-button"> <i class="icon ia-icon"></i> Web Archive [PDF] <div class="menu fulltext-thumbnail"> <img src="https://blobs.fatcat.wiki/thumbnail/pdf/b2/40/b240169d009af2f511ac1ac80ad514584063a1a1.180px.jpg" alt="fulltext thumbnail" loading="lazy"> </div> </button> </a> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.4204/eptcs.129.12"> <button class="ui left aligned compact blue labeled icon button serp-button"> <i class="unlock alternate icon" style="background-color: #fb971f;"></i> Publisher / doi.org </button> </a>