Certification of Sorting Algorithms Using Theorema and Coq
Résumé
Sorting is an operation that has very important practical applications, in particular for instance in the storage and analysis of data related to the environment, climat change, etc. We describe experiments of automated certification of various sorting algorithms by using the Theorema as well as Coq and we compare the two techniques. The sorting algorithms are: Quick-Sort, Patience-Sort, Min-Sort, Max-Sort, and Min-Max-Sort. In both systems we construct the appropriate underlying theory, we define the algorithms in functional style, we run them on examples and we produce the proof of their correctness together with proofs of various lemmas that are necessary. In Theorema the proofs are almost completely automatic, are presented in natural style, and the underlying theory uses multisets in order to express the fact that the input and the output have the same elements. Moreover the proofs use a generalized induction scheme based on the well-founded ordering on lists defined by strict inclusion of multisets. In Coq the proofs are based on scripts, they require more additional lemmas, and they use element counts to compare the contents of the list. However, both the algorithm definitions as well as the proofs are absolutely rigurous as Coq cannot accept any elements that are not theoretically correct.
Domaines
Informatique [cs]Origine | Fichiers produits par l'(les) auteur(s) |
---|