Formalising bitonic sort in type theory

  • Authors:
  • Ana Bove;Thierry Coquand

  • Affiliations:
  • Department of Computer Science and Engineering, Chalmers University of Technology, Göteborg, Sweden;Department of Computer Science and Engineering, Chalmers University of Technology, Göteborg, Sweden

  • Venue:
  • TYPES'04 Proceedings of the 2004 international conference on Types for Proofs and Programs
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

We discuss two complete formalisations of bitonic sort in constructive type theory. Bitonic sort is one of the fastest sorting algorithms where the sequence of comparisons is not data-dependent. In addition, it is a general recursive algorithm. In the formalisation we face two main problems: only structural recursion is allowed in type theory, and a formal proof of the correctness of the algorithm needs to consider quite a number of cases. In our first formalisation we define bitonic sort over dependently-typed binary trees with information in the leaves and we make use of the 0-1-principle to prove that the algorithm sorts inputs of arbitrary types. In our second formalisation we use notions from linear orders, lattice theory and monoids. The correctness proof is directly performed for any ordered set and not only for Boolean values.