Verification of the ShearSort algorithm

This page gives a description of the verification of the ShearSort algorithm with KIV, that sorts a matrix using parallel sorts of rows and columns. The verification of this algorithm was one of the challenges of the VerifyThis competition 2021. A description of the challenge can be found at: Challenge 3 - ShearSort ⤓ (PDF) (external link to ETH Zürich)

An earlier proof with KIV that uses a sequence of sequential sorts instead of a parallel sort has already been uploaded earlier as part of the KIV solutions for VerifyThis 2021. This is now a full solution, that also verifies a concurrent version, including a version of the BubbleSort-Algorithm that is verified with Rely-Guarantee calculus (the old version just had a specification of the sorting algorithm used for a row/column). The solution also has been changed from using monomorphic data types to polymorphic ones, which removes some of the actualized specifications that were used earlier.

More details on the concepts used here are now given in the submitted paper [KIV21] (a copy can be obtained by mailing the authors).

Check the overview over the specifications first. From there you can also find links to the theorem base of each specification, and to all proofs. Here is a description of the main important ones:

The toplevel specification ShearSort contains the algorithm to sort a matrix (named pshearsort#). The basic program to sort a single column in ascending order (psortcol#) is given in specification Bubblesort. It is a version of Bubblesort (the most optimized version given on the Wikipedia page) adjusted to sort one column of a matrix. It has been verified to be correct using Rely-Guarantee calculus (the rely used is to assume that other parallel sorts do not modify the respective column) The necessary invariant is shown as an annotation. To demonstrate the (small) overhead of using RG calculus and sorting a column instead of an array, specification Bubblesort contains the standard version for arrays and a correctness proof using wp-calculus. The main proof of the ShearSort algorithm basically reduces to the following lemmas: The proof effort for the sequential version of the case study was about two weeks. Proving the two versions of bubblesort and setting up the instances needed a few hours. The main effort in adding concurrency was then defining and implementing the forall-operator, the corresponding rule, and the rule used to combine wp-calculus reasoning for the main algorithm with reasoning using RG-calculus for the parallel sorts (see [KIV21] for more details).

Bibliography

[Hagerup16] T. Hagerup
Course notes: Introduction to Parallel Algorithms

[KIV21] G, Schellhorn, S. Bodenmüller, M. Bitterlich, W .Reif
Software & System Verification with KIV
submitted to : Symposium on the occasion of Reiner Hähnle's 60th Birthday
will appear in Springer LNCS


Used basic libraries:

Back to the overview of all KIV projects.
For general informations on KIV and a download site for the whole system refer to this page.


[Imprint] [Data Privacy Statement]