TYPE CLASSES FOR EFFICIENT EXACT REAL ARITHMETIC IN COQ

被引:13
作者
Krebbers, Robbert [1 ]
Spitters, Bas [1 ]
机构
[1] Radboud Univ Nijmegen, Inst Comp & Informat Sci, Nijmegen, Netherlands
关键词
Type classes; exact real arithmetic; type theory; Coq; verified computation; FUNCTIONAL IMPLEMENTATION; EXTRACTION; NUMBERS;
D O I
10.2168/LMCS-9(1:01)2013
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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 de fine 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.
引用
收藏
页数:27
相关论文
共 53 条
[1]  
[Anonymous], 2012, The Coq proof assistant reference manual
[2]  
[Anonymous], 2002, A New Kind of Science
[3]  
[Anonymous], 1988, STUDIES LOGIC FDN MA
[4]  
Armand M, 2010, LECT NOTES COMPUT SC, V6172, P83, DOI 10.1007/978-3-642-14052-5_8
[5]   User interaction with the matita proof assistant [J].
Asperti, Andrea ;
Coen, Claudio Sacerdoti ;
Tassi, Enrico ;
Zacchiroli, Stefano .
JOURNAL OF AUTOMATED REASONING, 2007, 39 (02) :109-139
[6]  
Asperti A, 2009, LECT NOTES COMPUT SC, V5674, P84, DOI 10.1007/978-3-642-03359-9_8
[7]   Implementing Real Numbers With RZ [J].
Bauer, Andrej ;
Kavkler, Iztok .
ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2008, 202 (0C) :365-384
[8]   The Dedekind reals in abstract Stone duality [J].
Bauer, Andrej ;
Taylor, Paul .
MATHEMATICAL STRUCTURES IN COMPUTER SCIENCE, 2009, 19 (04) :757-838
[9]  
Berger U, 2009, LECT NOTES COMPUT SC, V5771, P132, DOI 10.1007/978-3-642-04027-6_12
[10]  
Bertot Y., 2004, TEXTS TCS