arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.06346cs.LO
收藏

基于共享溯因和双向溯因循环加速的组合形状分析(扩展版)

Compositional Shape Analysis with Shared Abduction and Biabductive Loop Acceleration (Extended Version)

Florian Sextl, Adam Rogalewicz, Tomáš Vojnar, Florian Zuleger

AI总结:

本文针对基于双向溯因的形状分析存在的分支安全要求无法合并、循环加速不可靠等问题,提出共享溯因框架和双向溯因循环加速方法(含形状外推启发式),实验表明其在精度和效率上均优于现有技术。

摘要:

基于双向溯因的形状分析是一种组合验证与分析技术,能够在存在复杂链接数据结构的情况下证明内存安全性。尽管其有用性显著,但这类分析仍存在若干未解决的问题;本文针对其中两个问题展开研究。一方面,原始分析具有路径敏感性,但无法合并相关分支的安全要求,这导致分析需要额外的可靠性检查,并降低了分析的精度。我们扩展了底层的符号执行,提出了一个共享溯因框架,为相关计算分支维护一个公共前置条件。另一方面,先前的实现通过分别在前置条件和后置条件上应用循环加速方法,将其从正向分析迁移到双向溯因分析,这可能导致不精确甚至不可靠的加速结果,无法形成循环不变式。相比之下,我们提出了双向溯因循环加速方法,明确构建并检查候选循环不变式。为此,我们还引入了一种名为形状外推的新型启发式方法。该启发式利用处理类列表数据结构(低级代码中最常见的数据结构)时的局部性,通过外推相关形状来联合加速前置条件和后置条件。除了提高分析精度外,我们的技术还使双向溯因分析更高效,因为它们在一个分析阶段内即可保证可靠性。相比之下,先前的技术始终需要两个阶段(因为第一阶段可能生成不可靠的契约,因此必须进行验证)。我们通过实验证实,我们的技术在分析精度和运行时间方面均优于先前的技术。

英文摘要:

Biabduction-based shape analysis is a compositional verification and analysis technique that can prove memory safety in the presence of complex, linked data structures. Despite its usefulness, several open problems persist for this kind of analysis; two of which we address in this paper. On the one hand, the original analysis is path-sensitive but cannot combine safety requirements for related branches. This causes the analysis to require additional soundness checks and decreases the analysis' precision. We extend the underlying symbolic execution and propose a framework for shared abduction where a common pre-condition is maintained for related computation branches. On the other hand, prior implementations lift loop acceleration methods from forward analysis to biabduction analysis by applying them separately on the pre- and post-condition, which can lead to imprecise or even unsound acceleration results that do not form a loop invariant. In contrast, we propose biabductive loop acceleration, which explicitly constructs and checks candidate loop invariants. For this, we also introduce a novel heuristic called shape extrapolation. This heuristic takes advantage of locality in the handling of list-like data structures (which are the most common data structures found in low-level code) and jointly accelerates pre- and post-conditions by extrapolating the related shapes. In addition to making the analysis more precise, our techniques also make biabductive analysis more efficient since they are sound in just one analysis phase. In contrast, prior techniques always require two phases (as the first phase can produce contracts that are unsound and must hence be verified). We experimentally confirm that our techniques improve on prior techniques; both in terms of precision and runtime of the analysis.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑