Skip to main content
QUICK REVIEW

[论文解读] Danger Invariants

Cristina David, Daniel Kroening|arXiv (Cornell University)|Mar 18, 2015
Formal Methods in Verification参考文献 17被引用 5
一句话总结

本文提出了危险不变量——安全不变量的对偶概念——用于总结那些必然导致错误状态的程序执行轨迹集合,从而在无需展开循环的情况下,实现对深层错误的可扩展、精确检测。通过在二阶逻辑中形式化危险不变量,并利用二阶SAT求解器,该方法兼具抽象解释的可扩展性与有界模型检测的精确性,成功检测到真实程序中的复杂错误。

ABSTRACT

Static analysers search for overapproximating proofs of safety commonly known as safety invariants. Fundamentally, such analysers summarise traces into sets of states, thus trading the ability to distinguish traces for computational tractability. Conversely, static bug finders (e.g. Bounded Model Checking) give evidence for the failure of an assertion in the form of a counterexample, which can be inspected by the user. However, static bug finders fail to scale when analysing programs with bugs that require many iterations of a loop as the computational effort grows exponentially with the depth of the bug. We propose a novel approach for finding bugs, which delivers the performance of abstract interpretation together with the concrete precision of BMC. To do this, we introduce the concept of danger invariants -- the dual to safety invariants. Danger invariants summarise sets of traces that are guaranteed to reach an error state. This summarisation allows us to find deep bugs without false alarms and without explicitly unwinding loops. We present a second-order formulation of danger invariants and use the Second-Order SAT solver described in previous work to compute danger invariants for intricate programs taken from the literature.

研究动机与目标

  • 解决有界模型检测(BMC)在检测需要大量循环迭代的深层错误时的可扩展性限制。
  • 通过支持基于轨迹的精确推理而无需显式展开循环,克服抽象解释的不精确性。
  • 提出安全不变量的对偶概念——危险不变量——以总结导致错误状态的执行轨迹。
  • 通过结合抽象解释与BMC的优势,实现在复杂程序中精确且可扩展的错误检测。
  • 展示利用二阶逻辑与二阶SAT求解器计算危险不变量的可行性。

提出的方法

  • 将危险不变量形式化为刻画必然导致错误状态的程序轨迹集合的二阶逻辑谓词。
  • 使用二阶SAT求解器,自动计算具有复杂控制流与深层循环的程序的危险不变量。
  • 通过抽象程序状态的逻辑不变量来表示程序行为,同时保留对错误状态的可达性。
  • 通过对安全不变量逻辑的对偶化构造危险不变量,聚焦于导致断言失败的轨迹。
  • 利用现有的二阶逻辑求解技术,将分析扩展至文献中真实存在的非平凡复杂程序。
  • 在传统BMC因深度呈指数增长而失败、抽象解释又无法检测深层错误的基准程序上验证该方法。

实验结果

研究问题

  • RQ1危险不变量能否被形式化为安全不变量的对偶,以捕捉导致错误状态的执行轨迹?
  • RQ2危险不变量的二阶逻辑表述能否被现有二阶SAT求解器有效求解?
  • RQ3该危险不变量方法能否扩展到BMC因深度过大而失效的深层循环程序?
  • RQ4危险不变量能否检测到因过度近似而被标准抽象解释遗漏的错误?
  • RQ5该方法能否在无误报且无需显式循环展开的情况下识别复杂深层错误?

主要发现

  • 危险不变量成功总结了导致错误状态的轨迹集合,实现了无需显式循环展开的深层错误检测。
  • 该方法在可扩展性上可与抽象解释相媲美,同时保持了有界模型检测的精确性。
  • 二阶SAT求解使复杂程序的危险不变量能够自动计算,适用于文献中的实际程序。
  • 该方法可检测到传统BMC因深度要求呈指数增长而失败的程序中的错误。
  • 危险不变量的对偶形式提供了一种系统化的方法来推理程序失败,而无需依赖反例轨迹。
  • 该技术成功识别出真实基准程序中传统静态分析方法无法检测的深层复杂错误。

更好的研究,从现在开始

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

无需绑定信用卡

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