We gratefully acknowledge support from
the Simons Foundation and member institutions.
Full-text links:

Download:

Current browse context:

cs

Change to browse by:

References & Citations

DBLP - CS Bibliography

Bookmark

(what is this?)
CiteULike logo BibSonomy logo Mendeley logo del.icio.us logo Digg logo Reddit logo

Computer Science > Logic in Computer Science

Title: Verifying Catamorphism-Based Contracts using Constrained Horn Clauses

Authors: Emanuele De Angelis (1), Fabio Fioravanti (2), Alberto Pettorossi (3), Maurizio Proietti (1) ((1) IASI-CNR, Rome, Italy, (2) DEc, University 'G. d'Annunzio', Chieti-Pescara, Pescara, Italy, (3) DICII, University of Rome 'Tor Vergata', Rome, Italy)
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.
Comments: Paper presented at the 38th International Conference on Logic Programming (ICLP 2022), 16 pages; added Journal reference and related DOI
Subjects: Logic in Computer Science (cs.LO); Programming Languages (cs.PL)
Journal reference: Theory and Practice of Logic Programming, 22(4), 555-572, July 2022
DOI: 10.1017/S1471068422000175
Cite as: arXiv:2205.06236 [cs.LO]
  (or arXiv:2205.06236v2 [cs.LO] for this version)

Submission history

From: Emanuele De Angelis [view email]
[v1] Thu, 12 May 2022 17:25:42 GMT (51kb)
[v2] Wed, 7 Sep 2022 07:37:53 GMT (51kb)

Link back to: arXiv, form interface, contact.