Skip to main content

Refinements for Free!

  • Conference paper
Certified Programs and Proofs (CPP 2013)

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

Included in the following conference series:

Abstract

Formal verification of algorithms often requires a choice between definitions that are easy to reason about and definitions that are computationally efficient. One way to reconcile both consists in adopting a high-level view when proving correctness and then refining stepwise down to an efficient low-level implementation. Some refinement steps are interesting, in the sense that they improve the algorithms involved, while others only express a switch from data representations geared towards proofs to more efficient ones geared towards computations. We relieve the user of these tedious refinements by introducing a framework where correctness is established in a proof-oriented context and automatically transported to computation-oriented data structures. Our design is general enough to encompass a variety of mathematical objects, such as rational numbers, polynomials and matrices over refinable structures. Moreover, the rich formalism of the Coq proof assistant enables us to develop this within Coq, without having to maintain an external tool.

The research leading to these results has received funding from the European Union’s 7th Framework Programme under grant agreement nr. 243847 (ForMath).

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. Ahrens, B., Kapulkin, C., Shulman, M.: Univalent categories and the Rezk completion (2013) (Preprint), http://arxiv.org/abs/1303.0584

  2. Barthe, G., Capretta, V., Pons, O.: Setoids in type theory. Journal of Functional Programming 13(2), 261–293 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  3. Bernardy, J.-P., Jansson, P., Paterson, R.: Proofs for free. Journal of Functional Programming 22(2), 107–152 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  4. Chrząszcz, J.: Implementing Modules in the Coq System. In: Basin, D., Wolff, B. (eds.) TPHOLs 2003. LNCS, vol. 2758, pp. 270–286. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  5. Cohen, C.: Pragmatic Quotient Types in Coq. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 213–228. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  6. Coq development team. The Coq Proof Assistant Reference Manual, version 8.4. Technical report, Inria (2012)

    Google Scholar 

  7. Danielsson, N.A., Coquand, T.: Isomorphism is Equality (2013) (Preprint), http://www.cse.chalmers.se/~nad/publications/coquand-danielsson-isomorphism-is-equality.html

  8. Dénès, M., Mörtberg, A., Siles, V.: A Refinement-Based Approach to Computational Algebra in Coq. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 83–98. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  9. Gonthier, G., Mahboubi, A.: A Small Scale Reflection Extension for the Coq system. Technical report, Microsoft Research INRIA (2009)

    Google Scholar 

  10. Grégoire, B., Mahboubi, A.: Proving Equalities in a Commutative Ring Done Right in Coq. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 98–113. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  11. Haftmann, F., Krauss, A., Kunčar, O., Nipkow, T.: Data Refinement in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 100–115. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  12. Karatsuba, A., Ofman, Y.: Multiplication of many-digital numbers by automatic computers. USSR Academy of Sciences 145, 293–294 (1962)

    Google Scholar 

  13. Keller, C., Lasson, M.: Parametricity in an Impredicative Sort. In: CSL, vol. 16, pp. 381–395. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2012)

    Google Scholar 

  14. Lammich, P.: Automatic Data Refinement. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 84–99. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  15. Luo, Z.: Computation and reasoning: a type theory for computer science. Oxford University Press, Inc., New York (1994)

    MATH  Google Scholar 

  16. Magaud, N.: Changing Data Representation within the Coq System. In: Basin, D., Wolff, B. (eds.) TPHOLs 2003. LNCS, vol. 2758, pp. 87–102. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  17. McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14(1), 69–111 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  18. T. U. F. Program: Homotopy Type Theory: Univalent Foundations of Mathematics. Institute for Advanced Study (2013), http://homotopytypetheory.org/book/

  19. Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP Congress, pp. 513–523 (1983)

    Google Scholar 

  20. Rijke, E., Spitters, B.: Sets in homotopy type theory (2013) (Preprint), http://arxiv.org/abs/1305.3835

  21. Sasaki, T., Murao, H.: Efficient Gaussian Elimination Method for Symbolic Determinants and Linear Systems. ACM Trans. Math. Softw. 8(3), 277–289 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  22. Sozeau, M.: A new look at generalized rewriting in type theory. Journal of Formalized Reasoning 2(1), 41–62 (2009)

    MathSciNet  MATH  Google Scholar 

  23. Sozeau, M., Oury, N.: First-Class Type Classes. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 278–293. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  24. Spitters, B., van der Weegen, E.: Type Classes for Mathematics in Type Theory. MSCS, Special Issue on ‘Interactive Theorem Proving and the Formalization of Mathematics’ 21, 1–31 (2011)

    Google Scholar 

  25. Strassen, V.: Gaussian elimination is not optimal. Numerische Mathematik 13(4), 354–356 (1969)

    Article  MathSciNet  MATH  Google Scholar 

  26. Wadler, P.: Views: A way for pattern matching to cohabit with data abstraction. In: POPL, pp. 307–313. ACM Press (1987)

    Google Scholar 

  27. Wadler, P.: Theorems for free? In: Functional Programming Languages and Computer Architecture, pp. 347–359. ACM Press (1989)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer International Publishing Switzerland

About this paper

Cite this paper

Cohen, C., Dénès, M., Mörtberg, A. (2013). Refinements for Free!. In: Gonthier, G., Norrish, M. (eds) Certified Programs and Proofs. CPP 2013. Lecture Notes in Computer Science, vol 8307. Springer, Cham. https://doi.org/10.1007/978-3-319-03545-1_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-03545-1_10

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-03544-4

  • Online ISBN: 978-3-319-03545-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics