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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Agda homepage, http://www.cs.chalmers.se/~catarina/agda
Alfa homepage, http://www.cs.chalmers.se/~hallgren/Alfa/
Batcher, K.E.: Sorting networks and their applications. In: Spring Joint Computer Conference, AFIPS Proc., vol. 32, pp. 307–314 (1968)
Birkhoff, G.: Lattice theory. Amer. Math. Soc., Providence (1967)
Bove, A.: Formalising bitonic sort using dependent types. Technical Report, Chalmers University of Technology (October 2004), Available on the WWW: www.cs.chalmers.se/~bove/Papers/dt_bit_sort.ps.gz
Coquand, T., Huet, G.: The Calculus of Constructions. Information and Computation 76, 95–120 (1988)
Couturier, R.: Formal engenieering of the bitonic sort using pvs. In: 2nd. Irish Workshop on Formal Method, Cork, Ireland (1998)
Day, N.A., Launchbury, J., Lewis, J.: Logical abstractions in haskell. In: Proceedings of the 1999 Haskell Workshop, Technical Report UU-CS-1999-28 (October 1999)
Epigram homepage, http://www.dur.ac.uk/CARG/epigram/
Haiyan, Q.: Testing and Proving in Dependent Type Theory. PhD thesis, Department of Computing Science, Chalmers University of Technology (2003)
Horn, A., Tarski, A.: Measures in Boolean algebras. Trans. Amer. Math. Soc. (64), 467–497 (1948)
Peyton Jones, S. (ed.): Haskell 1998 Language and Libraries The Revised Report. Cambridge University Press, Cambridge (2003)
Knuth, D.E.: The Art of Computer Programming: Sorting and Searching. Addison-Wesley, Reading (1973)
Martin-Löf, P.: Intuitionistic Type Theory. Bibliopolis, Napoli (1984)
Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: Mason, R.E.A. (ed.) Information Processing 1983, Proceedings of the 9th IFIP World Computer Congress, Paris, France, pp. 513–523. North-Holland, Amsterdam (1983)
Rota, G.: The valuation ring of a distributive lattice. In: Proceedings of the University of Houston Lattice Theory Conference, Houston, Tex., pp. 574–628 (1973)
Rushby, J.: The pvs verification system (1998), www.csl.sri.com/pvs.html
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bove, A., Coquand, T. (2006). Formalising Bitonic Sort in Type Theory. In: Filliâtre, JC., Paulin-Mohring, C., Werner, B. (eds) Types for Proofs and Programs. TYPES 2004. Lecture Notes in Computer Science, vol 3839. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11617990_6
Download citation
DOI: https://doi.org/10.1007/11617990_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-31428-8
Online ISBN: 978-3-540-31429-5
eBook Packages: Computer ScienceComputer Science (R0)