Proving Properties of Sorting Programs: A Case Study in Horn Clause Verification

07/09/2019
by   Emanuele De Angelis, et al.
0

The proof of a program property can be reduced to the proof of satisfiability of a set of constrained Horn clauses (CHCs) which can be automatically generated from the program and the property. In this paper we have conducted a case study in Horn clause verification by considering several sorting programs with the aim of exploring the effectiveness of a transformation technique which allows us to eliminate inductive data structures such as lists or trees. If this technique is successful, we derive a set of CHCs with constraints over the integers and booleans only, and the satisfiability check can often be performed in an effective way by using state-of-the-art CHC solvers, such as Eldarica or Z3. In this case study we have also illustrated the usefulness of a companion technique based on the introduction of the so-called difference predicates, whose definitions correspond to lemmata required during the verification. We have considered functional programs which implement the following kinds of sorting algorithms acting on lists of integers: (i) linearly recursive sorting algorithms, such as insertion sort and selection sort, and (ii) non-linearly recursive sorting algorithms, such as quicksort and mergesort, and we have considered the following properties: (i) the partial correctness properties, that is, the orderedness of the output lists, and the equality of the input and output lists when viewed as multisets, and (ii) some arithmetic properties, such as the equality of the sum of the elements before and after sorting.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/07/2020

Transformational Verification of Quicksort

Many transformation techniques developed for constraint logic programs, ...
research
08/20/2019

Lemma Generation for Horn Clause Satisfiability: A Preliminary Study

It is known that the verification of imperative, functional, and logic p...
research
04/25/2018

Shape Neutral Analysis of Graph-based Data-structures

Malformed data-structures can lead to runtime errors such as arbitrary m...
research
04/23/2021

Monitoring Cumulative Cost Properties

This paper considers the problem of decentralized monitoring of a class ...
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
07/07/2020

Strong Generalization and Efficiency in Neural Programs

We study the problem of learning efficient algorithms that strongly gene...
research
03/15/2022

QUBOs for Sorting Lists and Building Trees

We show that the fundamental tasks of sorting lists and building search ...

Please sign up or login with your details

Forgot password? Click here to reset