Coq中高效精确实数算术的类型类
Type classes for efficient exact real arithmetic in Coq
AI总结:
本文通过类型类扩展了Coq中精确实数算术的实现,包括正弦余弦函数、基于快速有理数的稠密集实现、不可判定结构上的序层次以及运行时终止证明的避免,从而显著提升性能。
摘要:
浮点运算速度快,但需要用户持续努力以确保结果正确。通过提供精确分析的库,由计算机处理误差估计,可以减轻用户的负担。此前,我们[Krebbers/Spitters 2011]在Coq证明助手中提供了精确实数的一个快速实现。我们的实现改进了O'Connor的早期实现,通过使用类型类来描述构建实数的基础稠密集的抽象规范。特别地,我们使用了基于Coq机器整数的二进有理数,已经将基本操作加速了100倍。本文是[Krebbers/Spitters 2011]的实质性扩展版本,在多个方面扩展了实现。首先,我们实现并验证了正弦和余弦函数。其次,我们基于Coq的快速有理数创建了稠密集的另一个实现。第三,我们将层次结构扩展到捕捉不可判定结构上的序,而之前仅限于可判定结构。这个基于类型类的层次结构允许我们以方便的方式共享自然数、整数、有理数、二进有理数和实数的理论。最后,我们通过避免在运行时评估终止证明,获得了另一个显著的加速。
英文摘要:
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. Previously, we [Krebbers/Spitters 2011] provided a fast implementation of the exact real numbers in the Coq proof assistant. Our implementation improved on an earlier implementation by O'Connor by using type classes to describe an abstract specification of the underlying dense set from which the real numbers are built. In particular, we used dyadic rationals built from Coq's machine integers to obtain a 100 times speed up of the basic operations already. This article is a substantially expanded version of [Krebbers/Spitters 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。