Skip to main content

Formalising Bitonic Sort in Type Theory

  • Conference paper
Types for Proofs and Programs (TYPES 2004)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3839))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agda homepage, http://www.cs.chalmers.se/~catarina/agda

  2. Alfa homepage, http://www.cs.chalmers.se/~hallgren/Alfa/

  3. Batcher, K.E.: Sorting networks and their applications. In: Spring Joint Computer Conference, AFIPS Proc., vol. 32, pp. 307–314 (1968)

    Google Scholar 

  4. Birkhoff, G.: Lattice theory. Amer. Math. Soc., Providence (1967)

    MATH  Google Scholar 

  5. 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

  6. Coquand, T., Huet, G.: The Calculus of Constructions. Information and Computation 76, 95–120 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  7. Couturier, R.: Formal engenieering of the bitonic sort using pvs. In: 2nd. Irish Workshop on Formal Method, Cork, Ireland (1998)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. Epigram homepage, http://www.dur.ac.uk/CARG/epigram/

  10. Haiyan, Q.: Testing and Proving in Dependent Type Theory. PhD thesis, Department of Computing Science, Chalmers University of Technology (2003)

    Google Scholar 

  11. Horn, A., Tarski, A.: Measures in Boolean algebras. Trans. Amer. Math. Soc. (64), 467–497 (1948)

    Google Scholar 

  12. Peyton Jones, S. (ed.): Haskell 1998 Language and Libraries The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  13. Knuth, D.E.: The Art of Computer Programming: Sorting and Searching. Addison-Wesley, Reading (1973)

    Google Scholar 

  14. Martin-Löf, P.: Intuitionistic Type Theory. Bibliopolis, Napoli (1984)

    MATH  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. Rushby, J.: The pvs verification system (1998), www.csl.sri.com/pvs.html

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics