[论文解读] Compositional Symbolic Execution for Correctness and Incorrectness Reasoning
本文提出了一种形式化基础的、组合式的符号执行(CSE)引擎,通过为 'consume' 和 'produce' 操作提供一个可靠的公理化接口,统一了正确性与错误性推理。受 Gillian 启发,该引擎使用分离逻辑支持过逼近(正确性)和欠逼近(错误性)推理,其统一的语义基于可满足性或有效性,并通过将 Gillian-C 扩展为原生支持通过错误性双归纳实现真正错误检测的方式评估了该方法。
The introduction of separation logic has led to the development of symbolic execution techniques and tools that are (functionally) compositional with function specifications that can be used in broader calling contexts. Many of the compositional symbolic execution tools developed in academia and industry have been grounded on a formal foundation, but either the function specifications are not validated with respect to the underlying separation logic of the theory, or there is a large gulf between the theory and the implementation of the tool. We introduce a formal compositional symbolic execution engine which creates and uses function specifications from an underlying separation logic and provides a sound theoretical foundation for, and indeed was partially inspired by, the Gillian symbolic execution platform. This is achieved by providing an axiomatic interface which describes the properties of the consume and produce operations used in the engine to update compositionally the symbolic state, for example when calling function specifications. This consume-produce technique is used by VeriFast, Viper, and Gillian, but has not been previously characterised independently of the tool. As part of our result, we give consume and produce operations inspired by the Gillian implementation that satisfy the properties described by our axiomatic interface. A surprising property is that our engine semantics provides a common foundation for both correctness and incorrectness reasoning, with the difference in the underlying engine only amounting to the choice to use satisfiability or validity. We use this property to extend the Gillian platform, which previously only supported correctness reasoning, with incorrectness reasoning and automatic true bug-finding using incorrectness bi-abduction. We evaluate our new Gillian platform by using the Gillian instantiation to C. This instantiation is the first tool grounded on a common formal compositional symbolic execution engine to support both correctness and incorrectness reasoning.
研究动机与目标
- 通过为组合式符号执行提供一个可靠的形式化理论基础,弥合形式化分离逻辑与实际符号执行工具之间的差距。
- 在单一形式化语义下统一正确性与错误性推理,二者仅在使用可满足性或有效性上有所不同。
- 通过将函数规格基于形式化分离逻辑,实现工具间的规格互操作性。
- 扩展 Gillian 平台,支持错误性推理与通过双归纳实现的自动真正错误检测。
- 通过将 CSE 引擎的形式化实例化为 C 语言(基于 Gillian-C)来评估该方法,展示其对正确性与错误性推理的支持。
提出的方法
- 使用 'consume' 和 'produce' 操作定义一种组合式符号操作语义,通过函数规格更新符号状态。
- 引入一个公理化接口,规定 consume 和 produce 操作所需属性,且独立于任何特定工具。
- 证明一个通用的可靠性结果:若公理化属性成立且函数规格在分离逻辑中为有效,则 CSE 引擎是可靠的。
- 通过受 Gillian 启发的操作实例化公理化接口,并证明其满足所需属性。
- 通过在底层逻辑中从有效性切换到可满足性,将 Gillian 平台扩展以支持错误性推理。
- 在 Gillian-C 上实现并评估该方法,使用双归纳生成 C 代码的正确与错误函数规格。
实验结果
研究问题
- RQ1能否设计一种形式化的组合式符号执行引擎,使其基于统一的语义基础,同时支持正确性与错误性推理?
- RQ2‘consume’ 和 ‘produce’ 操作必须满足哪些公理化属性,以确保在过逼近与欠逼近推理中均保持可靠性?
- RQ3如何在保持形式化基础于分离逻辑的前提下,实现工具间函数规格的互操作性?
- RQ4Gillian 平台能否在不牺牲可靠性的前提下,被扩展以支持错误性推理与自动真正错误检测?
- RQ5CSE 引擎对 C 语言(通过 Gillian-C 实例化)的实现,在多大程度上展示了其在实际程序分析中的可行性?
主要发现
- CSE 引擎为正确性与错误性推理提供了统一的语义基础,二者之间的唯一区别在于使用有效性(正确性)或可满足性(错误性)。
- 对 consume 和 produce 操作的公理化接口已形式化表征,并通过受 Gillian 启发的操作实例化,其满足所需属性。
- 该引擎实现了规格互操作性,使得来自不同来源的函数规格可在不同工具中可靠使用。
- 评估结果表明,扩展了 CSE 引擎的 Gillian-C 为单个 C 函数生成了 9 个不同的规格,包括 4 个正确与 5 个错误情况,证明了对两种推理模式的支持。
- 当前 Gillian-C 的实现因编码限制导致规格爆炸,但这是一种实际限制,而非理论框架的缺陷。
- 该方法成功实现了通过错误性双归纳实现的自动真正错误检测,一个关键示例检测到了会导致段错误的空指针解引用。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。