arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1610.07390cs.PLcs.LOcs.SE
收藏

一种实用的math.h/cmath函数区间精化方法

A Practical Approach to Interval Refinement for math.h/cmath Functions

Roberto Bagnara, Michele Chiari, Roberta Gori, Abramo Bagnara

摘要:

C++程序的验证已经在几个领域取得了相当大的进展,但对于使用这些语言的数学库的程序来说却没有。原因是,所有广泛使用的库都不能保证计算结果。这似乎阻止了对使用它们的程序进行形式化验证的任何尝试:没有函数的规范,就不能静态地得出关于程序行为的结论。我们提出一个投降的替代方案。我们引入了一种实用的方法,利用大多数math.h/cmath函数几乎是分段单调的这一事实:正如我们通过详尽测试发现的那样,它们可能会出现小故障,通常大小非常小,数量也很少。我们开发的间隔细化技术,这些功能的基础上修改的二分法搜索,使验证通过符号执行基于模型检验,抽象的解释,和测试数据生成。我们的细化算法是文献中第一个能够处理非正确舍入函数实现的算法,能够在最常见的实现中进行验证。我们实验评估我们的方法在现实世界的代码,显示其检测或排除异常行为的能力。

英文摘要:

Verification of C++ programs has seen considerable progress in several areas, but not for programs that use these languages' mathematical libraries. The reason is that all libraries in widespread use come with no guarantees about the computed results. This would seem to prevent any attempt at formal verification of programs that use them: without a specification for the functions, no conclusion can be drawn statically about the behavior of the program. We propose an alternative to surrender. We introduce a pragmatic approach that leverages the fact that most math.h/cmath functions are almost piecewise monotonic: as we discovered through exhaustive testing, they may have glitches, often of very small size and in small numbers. We develop interval refinement techniques for such functions based on a modified dichotomic search, that enable verification via symbolic execution based model checking, abstract interpretation, and test data generation. Our refinement algorithms are the first in the literature to be able to handle non-correctly rounded function implementations, enabling verification in the presence of the most common implementations. We experimentally evaluate our approach on real-world code, showing its ability to detect or rule out anomalous behaviors.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑