Type classes for efficient exact real arithmetic in CoQ

Robbert Krebbers*, Bas Spitters

*Corresponding author for this work

Research output: Contribution to journal/Conference contribution in journal/Contribution to newspaperJournal articleResearchpeer-review

22 Citations (Scopus)

Abstract

Floating point operations are fast, but require continuous effort by the user to ensure correctness. This burden can be shifted to the machine by providing a library of exact analysis in which the computer handles the error estimates. Previously, we provided a fast implementation of the exact real numbers in the Coq proof assistant. This implementation incorporates various optimizations to speed up the basic operations of O'Connor's implementation by a 100 times. We implemented these optimizations in a modular way using type classes to define an abstract specification of the underlying dense set from which the real numbers are built. This abstraction does not hurt the efficiency. This article is a substantially expanded version of (Krebbers/Spitters, Calculemus 2011) in which the implementation is extended in the various ways. First, we implement and verify the sine and cosine function. Secondly, we create an additional implementation of the dense set based on Coq's fast rational numbers. Thirdly, we extend the hierarchy to capture order on undecidable structures, while it was limited to decidable structures before. This hierarchy, based on type classes, allows us to share theory on the naturals, integers, rationals, dyadics, and reals in a convenient way. Finally, we obtain another dramatic speed-up by avoiding evaluation of termination proofs at runtime.

Original languageEnglish
JournalLogical Methods in Computer Science
Volume9
Issue1
ISSN1860-5974
DOIs
Publication statusPublished - 25 Feb 2013
Externally publishedYes

Keywords

  • Coq
  • Exact real arithmetic
  • Type classes
  • Type theory
  • Verified computation

Fingerprint

Dive into the research topics of 'Type classes for efficient exact real arithmetic in CoQ'. Together they form a unique fingerprint.

Cite this