Skip to main content
QUICK REVIEW

[论文解读] Why Just Boogie? Translating Between Intermediate Verification Languages

Michael Ameri, Carlo A. Furia|arXiv (Cornell University)|Jan 4, 2016
Logic, programming, and type systems参考文献 17被引用 4
一句话总结

本文提出了一种语义保持的 Boogie 到 WhyML 的翻译方法,使能够使用 Why3 更为灵活的后端验证器来验证 Boogie 程序。工具 b2w 翻译了 194 个 Boogie 程序,Why3 对其中 83% 的程序成功验证,且结果与 Boogie 一致,证明了该方法的实用性以及跨工具验证的潜力。

ABSTRACT

The verification systems Boogie and Why3 use their respective intermediate languages to generate verification conditions from high-level programs. Since the two systems support different back-end provers (such as Z3 and Alt-Ergo) and are used to encode different high-level languages (such as C# and Java), being able to translate between their intermediate languages would provide a way to reuse one system's features to verify programs meant for the other. This paper describes a translation of Boogie into WhyML (Why3's intermediate language) that preserves semantics, verifiability, and program structure to a large degree. We implemented the translation as a tool and applied it to 194 Boogie-verified programs of various sources and sizes; Why3 verified 83% of the translated programs with the same outcome as Boogie. These results indicate that the translation is often effective and practically applicable.

研究动机与目标

  • 使 Why3 的高级验证后端(例如 Alt-Ergo、CVC4、Coq)能够复用于原本在 Boogie 中验证的程序。
  • 在 Boogie 与 WhyML 之间进行翻译时,保持语义正确性、可验证性以及程序结构。
  • 通过在 Why3 中重新检查翻译后的程序,为 Boogie 的验证结果提供一种实用的验证机制。
  • 通过利用 Why3 更强大且多样的验证器支持,解决 Boogie 验证栈中的局限性,例如对实数算术和循环不变量的错误处理。
  • 证明在中间验证语言(IVL)之间进行翻译是可行且有益的,可提升自动化验证结果的信心。

提出的方法

  • 设计一个从 Boogie 程序到等价 WhyML 程序的翻译函数 𝒯,以保持语义和结构。
  • 将翻译实现为名为 b2w 的工具,支持 Boogie 的核心功能,包括过程、断言和命令式结构。
  • 通过将 Boogie 的类型系统和逻辑表达式映射到 WhyML 的 ML 家族语法及其表达性类型系统,处理其类型系统和逻辑表达式。
  • 通过限制实例化和使用保守编码方式,应对翻译复杂特性(如泛型映射和位向量)的挑战。
  • 利用 Why3 将验证条件分发给多个后端的能力,包括交互式验证器,以克服 Boogie 默认基于 SMT 的验证的局限性。
  • 将该工具应用于来自不同来源的 194 个已由 Boogie 验证的程序,以评估正确性、可验证性和可读性。

实验结果

研究问题

  • RQ1从 Boogie 到 WhyML 的翻译是否能在广泛范围的程序中保持语义正确性和可验证性?
  • RQ2Why3 在翻译后对 Boogie 程序的验证能力如何,特别是在 Boogie 因其后端限制(如 Z3)失败时?
  • RQ3该翻译在多大程度上保持了程序结构和可读性,以支持可维护性和调试?
  • RQ4该翻译能否作为交叉验证机制,用于检测 Boogie 验证结果中的假阳性?
  • RQ5将 Boogie 的特性(如位向量和泛型映射)翻译为 WhyML 时存在哪些实际限制?

主要发现

  • 工具 b2w 将 194 个 Boogie 程序成功翻译为 WhyML,其中 161 个(83%)被 Why3 验证,且结果与 Boogie 一致。
  • Why3 正确拒绝了有问题的 Boogie 程序 'not_verify'(其后置条件矛盾),而 Boogie 和 Z3 错误地验证了它。
  • Why3 正确验证了 'lemma_yes'(2³ > 0),并拒绝了 'lemma_no'(2³ < 0),表明其在实数算术处理上优于 Boogie 的 Z3 集成。
  • 对于 'trivial_inv' 中的循环不变量,Why3 使用其 CVC4 后端或交互式验证器成功验证了该不变量,而 Boogie 因 Z3 中的触发启发式规则失败。
  • 尽管在处理复杂泛型映射和位向量操作方面存在限制,翻译仍保持有效,这些特性或被限制,或以语义近似方式处理。
  • 结果证实,IVL 之间的翻译是实用的,并可通过跨工具验证增强验证信心。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。