Skip to main content
QUICK REVIEW

[论文解读] Exact Separation Logic (Extended Version)

Petar Maksimović, Caroline Cronjäger|arXiv (Cornell University)|Aug 15, 2022
Software Testing and Debugging Techniques被引用 2
一句话总结

本文提出精确分离逻辑(ESL),一种新颖的程序逻辑,通过确保所有终止行为均被完整刻画且所有已建立的结果与错误均可被触及,从而统一验证与真实错误检测。ESL 在互 recursive 函数上实现 soundness,并证明了对下近似逻辑的函数组合性,使得关键堆操作代码的可处理、抽象规格成为可能。

ABSTRACT

Over-approximating (OX) program logics, such as separation logic (SL), are used for verifying properties of heap-manipulating programs: all terminating behaviour is characterised, but established results and errors need not be reachable. OX function specifications are thus incompatible with true bug-finding supported by symbolic execution tools such as Pulse and Pulse-X. In contrast, under-approximating (UX) program logics, such as incorrectness separation logic, are used to find true results and bugs: established results and errors are reachable, but there is no mechanism for understanding if all terminating behaviour has been characterised. We introduce exact separation logic (ESL), which provides fully-verified function specifications compatible with both OX verification and UX true bug-funding: all terminating behaviour is characterised and all established results and errors are reachable. We prove soundness for ESL with mutually recursive functions, demonstrating, for the first time, function compositionality for a UX logic. We show that UX program logics require subtle definitions of internal and external function specifications compared with the familiar definitions of OX logics. We investigate the expressivity of ESL and, for the first time, explore the role of abstraction in UX reasoning by verifying abstract ESL specifications of various data-structure algorithms. In doing so, we highlight the difference between abstraction (hiding information) and over-approximation (losing information). Our findings demonstrate that abstraction cannot be used as freely in UX logics as in OX logics, but also that it should be feasible to use ESL to provide tractable function specifications for self-contained, critical code, which would then be used for both verification and true bug-finding.

研究动机与目标

  • 弥合程序逻辑中验证(上近似)与真实错误检测(下近似)之间的差距。
  • 开发一种逻辑,确保所有终止行为均被完整刻画,且所有结果与错误均可被触及,从而结合两种范式的优点。
  • 证明下近似逻辑的函数组合性,这是此前错误逻辑中尚未解决的关键挑战。
  • 探讨抽象在下近似推理中的作用,将其与上近似区分开来。
  • 证明 ESL 可用于自包含、关键代码(如数据结构库)的规格化,实现精确、可重用的规格。

提出的方法

  • 提出精确分离逻辑(ESL)作为结合上近似与下近似特性的新型程序逻辑。
  • 在 ESL 中定义函数规格,确保其 sound 且完全可达,从而保证所有结果与错误均为真实。
  • 证明 ESL 在互 recursive 函数上的 soundness,首次建立下近似逻辑的组合性推理框架。
  • 在 UX 逻辑中引入内部与外部函数规格之间的微妙区别,其定义与标准 OX 逻辑存在本质不同。
  • 为数据结构算法开发抽象 ESL 规格,证明在不引入上近似的情况下实现抽象是可行的。
  • 使用符号执行与框架推理验证复杂的堆操作代码,包括 BST 插入与链表长度算法。

实验结果

研究问题

  • RQ1能否设计一种程序逻辑,同时实现对终止行为的完整刻画与对结果及错误的完全可达性?
  • RQ2下近似逻辑中是否可实现函数组合性?若可,其规格定义与上近似逻辑相比应有何不同?
  • RQ3如何在下近似逻辑中合理应用抽象,而不丢失信息或损害可达性?
  • RQ4框架性质与局部性在下近似推理中扮演何种角色?它们如何与可达性保证相互作用?
  • RQ5ESL 是否可用于自包含、关键代码的规格化,实现可处理、可重用的规格,适用于验证与真实错误检测?

主要发现

  • ESL 在互 recursive 函数上实现了 soundness,首次证明下近似逻辑中函数组合性是可能的。
  • 本文确立了 UX 逻辑中内部与外部函数规格的定义必须与 OX 逻辑有根本性不同,原因在于缺乏前向推论,且必须保持可达性。
  • UX 逻辑中的抽象不能像在 OX 逻辑中那样自由使用,因为其必须保留信息而非允许信息丢失,凸显了隐藏信息与上近似之间的关键区别。
  • 作者成功验证了数据结构算法的抽象 ESL 规格,证明精确、可重用且可处理的规格在关键代码中是可行的。
  • 链表长度与 BST 插入示例表明,ESL 支持带有可达性保证的符号推理,使同一框架内同时实现验证与真实错误检测成为可能。
  • arXiv 的扩展版本(arXiv:2208.07200)提供了完整证明与详细案例研究,证实 ESL 在真实世界验证场景中的实际可行性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

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