arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2001.02981cs.PLcs.NAmath.NA
收藏

测试稳定浮点代码的自动生成与验证

Automatic generation and verification of test-stable floating-point code

Laura Titolo, Mariano Moscato, Cesar A. Muñoz

摘要:

浮点程序中的测试不稳定性发生在程序的控制流偏离其理想执行(假设为实数运算)时。这种现象是由于在条件语句中存在影响算术表达式计算的舍入错误而引起的。不稳定的测试可能会导致严重的错误,在安全关键的应用程序,依赖于数值计算。编写考虑测试不稳定性的程序是一项艰巨的任务,需要有限精度计算和舍入误差方面的专业知识。本文提出了一个工具链,自动生成和验证一个可证明正确的测试稳定的浮点程序,从一个功能规格在真正的算术。输入是用原型验证系统(PVS)规约语言编写的实值程序,输出是用ANSI/ISO C规约语言(ACSL)契约注释的转换后的浮点C程序。这些契约将浮点程序与其在实数算术中的功能规范联系起来。转换后的程序检测是否可能发生不稳定的测试,在这些情况下,发出警告并终止。提出了一种方法,它结合了框架-C分析器,PRECiSA舍入误差估计,和PVS自动验证生成的程序代码是正确的,在这个意义上说,如果程序终止没有警告,它遵循相同的计算路径作为其实值功能规范。

英文摘要:

Test instability in a floating-point program occurs when the control flow of the program diverges from its ideal execution assuming real arithmetic. This phenomenon is caused by the presence of round-off errors that affect the evaluation of arithmetic expressions occurring in conditional statements. Unstable tests may lead to significant errors in safety-critical applications that depend on numerical computations. Writing programs that take into consideration test instability is a difficult task that requires expertise on finite precision computations and rounding errors. This paper presents a toolchain to automatically generate and verify a provably correct test-stable floating-point program from a functional specification in real arithmetic. The input is a real-valued program written in the Prototype Verification System (PVS) specification language and the output is a transformed floating-point C program annotated with ANSI/ISO C Specification Language (ACSL) contracts. These contracts relate the floating-point program to its functional specification in real arithmetic. The transformed program detects if unstable tests may occur and, in these cases, issues a warning and terminate. An approach that combines the Frama-C analyzer, the PRECiSA round-off error estimator, and PVS is proposed to automatically verify that the generated program code is correct in the sense that, if the program terminates without a warning, it follows the same computational path as its real-valued functional specification.

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

↑