用SMT求解提高精度来验证浮点程序的稳定性

Gabriele Paganelli, Wolfgang Ahrendt
{"title":"用SMT求解提高精度来验证浮点程序的稳定性","authors":"Gabriele Paganelli, Wolfgang Ahrendt","doi":"10.1109/SYNASC.2013.35","DOIUrl":null,"url":null,"abstract":"When computing with floating-point numbers, programmers choose a certain floating-point precision (like, for instance, float or double) upfront, for each variable. However, whether the chosen precision is appropriate for the computation at hand, and vice versa, is difficult to judge. One way is to increase the precision, and observe whether the result of the computation changes too much, in which case the computation with the original precisions is considered 'unstable'. This effect may be exhibited with certain inputs, and not with others. With a classical testing approach, inputs that show instability can be very difficult to find. Moreover, testing can only show instability, not stability. In this paper, we present an approach, and its implementation, which can formally prove that an increased precision causes only a limited (quantified) change of the result. Alternatively, if the computation is not stable, the method returns inputs that exhibit this. We use methods from program verification, connecting to a novel SMT (sat- isfiability modulo theories) solver for floating-point number constraints. The user augments the program P with asser- tions on the expected stability bound. The system then creates a new program P', a certain kind of merge of P with a higher precision copy of P, computes the weakest precondition of P' w.r.t. these assertions, and feeds the resulting formula to the SMT solver, which then proves stability or alternatively returns data for a test exhibiting unstability, to be used for further analysis. The implemen- tation of the system targets a toy language but supports the IEEE standard in a realistic manner. The paper describes the method and its implementation, reports experiments, and discusses the results.","PeriodicalId":293085,"journal":{"name":"2013 15th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing","volume":"2012 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"12","resultStr":"{\"title\":\"Verifying (In-)Stability in Floating-Point Programs by Increasing Precision, Using SMT Solving\",\"authors\":\"Gabriele Paganelli, Wolfgang Ahrendt\",\"doi\":\"10.1109/SYNASC.2013.35\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"When computing with floating-point numbers, programmers choose a certain floating-point precision (like, for instance, float or double) upfront, for each variable. However, whether the chosen precision is appropriate for the computation at hand, and vice versa, is difficult to judge. One way is to increase the precision, and observe whether the result of the computation changes too much, in which case the computation with the original precisions is considered 'unstable'. This effect may be exhibited with certain inputs, and not with others. With a classical testing approach, inputs that show instability can be very difficult to find. Moreover, testing can only show instability, not stability. In this paper, we present an approach, and its implementation, which can formally prove that an increased precision causes only a limited (quantified) change of the result. Alternatively, if the computation is not stable, the method returns inputs that exhibit this. We use methods from program verification, connecting to a novel SMT (sat- isfiability modulo theories) solver for floating-point number constraints. The user augments the program P with asser- tions on the expected stability bound. The system then creates a new program P', a certain kind of merge of P with a higher precision copy of P, computes the weakest precondition of P' w.r.t. these assertions, and feeds the resulting formula to the SMT solver, which then proves stability or alternatively returns data for a test exhibiting unstability, to be used for further analysis. The implemen- tation of the system targets a toy language but supports the IEEE standard in a realistic manner. The paper describes the method and its implementation, reports experiments, and discusses the results.\",\"PeriodicalId\":293085,\"journal\":{\"name\":\"2013 15th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing\",\"volume\":\"2012 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2013-09-23\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"12\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2013 15th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/SYNASC.2013.35\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2013 15th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SYNASC.2013.35","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 12

摘要

当使用浮点数进行计算时,程序员会预先为每个变量选择一个特定的浮点精度(例如,float或double)。然而,所选择的精度是否适合手头的计算,反之亦然,很难判断。一种方法是提高精度,观察计算结果是否变化太大,在这种情况下,原始精度的计算被认为是“不稳定的”。这种效应可能与某些输入有关,而与其他输入无关。使用经典的测试方法,很难找到显示不稳定的输入。此外,测试只能显示不稳定性,而不是稳定性。在本文中,我们提出了一种方法及其实现,可以正式证明精度的增加只会导致结果的有限(量化)变化。或者,如果计算不稳定,该方法返回的输入也会显示这种情况。我们使用程序验证的方法,连接到浮点数约束的新颖SMT(可寻模理论)求解器。用户用期望稳定界上的参数对程序P进行增广。然后系统创建一个新的程序P', P的某种合并与更高精度的P副本,计算P' w.r.t.这些断言的最弱先决条件,并将结果公式提供给SMT求解器,然后证明稳定性或返回显示不稳定性的测试数据,用于进一步分析。该系统的实现以一种玩具语言为目标,但以一种现实的方式支持IEEE标准。本文介绍了该方法及其实现,报告了实验结果并对结果进行了讨论。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Verifying (In-)Stability in Floating-Point Programs by Increasing Precision, Using SMT Solving
When computing with floating-point numbers, programmers choose a certain floating-point precision (like, for instance, float or double) upfront, for each variable. However, whether the chosen precision is appropriate for the computation at hand, and vice versa, is difficult to judge. One way is to increase the precision, and observe whether the result of the computation changes too much, in which case the computation with the original precisions is considered 'unstable'. This effect may be exhibited with certain inputs, and not with others. With a classical testing approach, inputs that show instability can be very difficult to find. Moreover, testing can only show instability, not stability. In this paper, we present an approach, and its implementation, which can formally prove that an increased precision causes only a limited (quantified) change of the result. Alternatively, if the computation is not stable, the method returns inputs that exhibit this. We use methods from program verification, connecting to a novel SMT (sat- isfiability modulo theories) solver for floating-point number constraints. The user augments the program P with asser- tions on the expected stability bound. The system then creates a new program P', a certain kind of merge of P with a higher precision copy of P, computes the weakest precondition of P' w.r.t. these assertions, and feeds the resulting formula to the SMT solver, which then proves stability or alternatively returns data for a test exhibiting unstability, to be used for further analysis. The implemen- tation of the system targets a toy language but supports the IEEE standard in a realistic manner. The paper describes the method and its implementation, reports experiments, and discusses the results.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信