Skip to main content

Computer Certified Efficient Exact Reals in Coq

  • Conference paper
Intelligent Computer Mathematics (CICM 2011)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 6824))

Included in the following conference series:

Abstract

Floating point operations are fast, but require continuous effort on the part of the user in order to ensure that the results are correct. This burden can be shifted away from the user by providing a library of exact analysis in which the computer handles the error estimates. We provide an implementation of the exact real numbers in the Coq proof assistant. This improves on the earlier Coq-implementation by O’Connor in two ways: we use dyadic rationals built from the machine integers and we optimize computation of power series by using approximate division. Moreover, we use type classes for clean mathematical interfaces. This appears to be the first time that type classes are used in heavy computation. We obtain over a 100 times speed up of the basic operations and indications for improving the Coq system.

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. Bishop, E.A.: Foundations of constructive analysis. McGraw-Hill, New York (1967)

    MATH  Google Scholar 

  2. O’Connor, R.: A Monadic, Functional Implementation of Real Numbers. MSCS 17(1), 129–159 (2007)

    MathSciNet  MATH  Google Scholar 

  3. O’Connor, R.: Certified Exact Transcendental Real Number Computation in Coq. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 246–261. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. O’Connor, R., Spitters, B.: A computer verified, monadic, functional implementation of the integral. TCS 411(37), 3386–3402 (2010)

    Article  MathSciNet  MATH  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  6. Coquand, T., Paulin, C.: Inductively defined types. In: Martin-Löf, P., Mints, G. (eds.) COLOG 1988. LNCS, vol. 417, pp. 50–66. Springer, Heidelberg (1990)

    Chapter  Google Scholar 

  7. Coq Development Team: The Coq Proof Assistant Reference Manual. INRIA-Rocquencourt (2008)

    Google Scholar 

  8. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Texts in TCS. Springer, Heidelberg (2004)

    Book  MATH  Google Scholar 

  9. Martin-Löf, P.: An intuitionistic theory of types. In: Twenty-five years of constructive type theory. Oxford Logic Guides, vol. 36, pp. 127–172. OUP (1998)

    Google Scholar 

  10. Martin-Löf, P.: Constructive Mathematics and Computer Science. In: Logic, Methodology and the Philosophy of Science VI. Studies in Logic and the Foundations of Mathematics, vol. 104, pp. 153–175 (1982)

    Google Scholar 

  11. Letouzey, P.: Extraction in Coq: An Overview. In: Beckmann, A., Dimitracopoulos, C., Löwe, B. (eds.) CiE 2008. LNCS, vol. 5028, pp. 359–369. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  12. Cruz-Filipe, L., Spitters, B.: Program Extraction from Large Proof Developments. In: Basin, D., Wolff, B. (eds.) TPHOLs 2003. LNCS, vol. 2758, pp. 205–220. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  13. Cruz-Filipe, L., Letouzey, P.: A Large-Scale Experiment in Executing Extracted Programs. Electronic Notes in Theoretical Computer Science 151(1), 75–91 (2006)

    Article  MATH  Google Scholar 

  14. Hofmann, M.: Extensional constructs in intensional type theory. CPHC/BCS Distinguished Dissertations. Springer, Heidelberg (1997)

    Book  Google Scholar 

  15. Palmgren, E.: Constructivist and Structuralist Foundations: Bishops and Lawveres Theories of Sets. Technical Report 4, Mittag-Leffler (2009)

    Google Scholar 

  16. Sozeau, M.: A New Look at Generalized Rewriting in Type Theory. Journal of Formalized Reasoning 2(1), 41–62 (2009)

    MathSciNet  MATH  Google Scholar 

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

  18. 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 (2011)

    Google Scholar 

  19. Grégoire, B., Leroy, X.: A compiled implementation of strong reduction. In: ICFP, pp. 235–246 (2002)

    Google Scholar 

  20. Armand, M., Grégoire, B., Spiwack, A., Théry, L.: Extending Coq with imperative features and its application to SAT verification. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 83–98. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  21. Spiwack, A.: Verified Computing in Homological Algebra, A Journey Exploring the Power and Limits of Dependent Type Theory. PhD thesis, INRIA (2011)

    Google Scholar 

  22. Richman, F.: Real numbers and other completions. Mathematical Logic Quarterly 54(1), 98–108 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  23. Moggi, E.: Computational lambda-calculus and monads. In: LICS, pp. 14–23 (1989)

    Google Scholar 

  24. Wadler, P.: Monads for functional programming. In: Proceedings of the Marktoberdorf Summer School on Program Design Calculi (August 1992)

    Google Scholar 

  25. Garillot, F., Gonthier, G., Mahboubi, A., Rideau, L.: Packaging mathematical structures. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 327–342. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  26. Gonthier, G., Mahboubi, A., Tassi, E.: A Small Scale Reflection Extension for the Coq system. Technical Report RR-6455, INRIA (2008)

    Google Scholar 

  27. Bauer, A., Kavkler, I.: A constructive theory of continuous domains suitable for implementation. Annals of Pure and Applied Logic 159(3), 251–267 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  28. O’Connor, R.: Incompleteness and Completeness: Formalizing Logic and Analysis in Type Theory. PhD thesis, Radboud University Nijmegen (2009)

    Google Scholar 

  29. Wolfram, S.: A new kind of science. Wolfram Media (2002)

    Google Scholar 

  30. Gonthier, G., Ziliani, B., Nanevski, A., Dreyer, D.: Making ad hoc proof automation less ad hoc (2011)

    Google Scholar 

  31. Asperti, A., Ricciotti, W., Coen, C., Tassi, E.: Hints in Unification. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 84–98. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  32. Boldo, S., Melquiond, G.: Flocq: A unified library for proving floating-point algorithms in Coq. In: Proc 20th IEEE Symposium on Computer Arithmetic (2011)

    Google Scholar 

  33. Julien, N., Pasca, I.: Formal Verification of Exact Computations Using Newton’s Method. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 408–423. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  34. Bertot, Y.: Affine functions and series with co-inductive real numbers. MSCS 17(1), 37–63 (2007)

    MathSciNet  MATH  Google Scholar 

  35. Julien, N.: Certified Exact Real Arithmetic Using Co-induction in Arbitrary Integer Base. In: Garrigue, J., Hermenegildo, M.V. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 48–63. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  36. Berger, U.: From coinductive proofs to exact real arithmetic. In: Grädel, E., Kahle, R. (eds.) CSL 2009. LNCS, vol. 5771, pp. 132–146. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Krebbers, R., Spitters, B. (2011). Computer Certified Efficient Exact Reals in Coq . In: Davenport, J.H., Farmer, W.M., Urban, J., Rabe, F. (eds) Intelligent Computer Mathematics. CICM 2011. Lecture Notes in Computer Science(), vol 6824. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22673-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22673-1_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22672-4

  • Online ISBN: 978-3-642-22673-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics