Verifying Catamorphism-Based Contracts using Constrained Horn Clauses

05/12/2022
by   Emanuele De Angelis, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/22/2022

Contract Strengthening through Constrained Horn Clause Verification

The functional properties of a program are often specified by providing ...
research
11/28/2022

Multiple Query Satisfiability of Constrained Horn Clauses

We address the problem of checking the satisfiability of a set of constr...
research
08/02/2021

Analysis and Transformation of Constrained Horn Clauses for Program Verification

This paper surveys recent work on applying analysis and transformation t...
research
08/04/2017

Predicate Pairing for Program Verification

It is well-known that the verification of partial correctness properties...
research
04/24/2018

Solving Horn Clauses on Inductive Data Types Without Induction

We address the problem of verifying the satisfiability of Constrained Ho...
research
04/16/2020

Removing Algebraic Data Types from Constrained Horn Clauses Using Difference Predicates

We address the problem of proving the satisfiability of Constrained Horn...
research
11/23/2021

Satisfiability of Constrained Horn Clauses on Algebraic Data Types: A Transformation-based Approach

We address the problem of checking the satisfiability of Constrained Hor...

Please sign up or login with your details

Forgot password? Click here to reset