Skip to main content
QUICK REVIEW

[论文解读] Array-Carrying Symbolic Execution for Function Contract Generation

Weijie Lu, Jingyu Ke|arXiv (Cornell University)|Feb 26, 2026
Logic, programming, and type systems被引用 0
一句话总结

一个符号执行框架,携带数组不变量和连续数组段,以在 ACSL/Frama-C 中合成函数契约,基于 LLVM 实现并集成外部不变性生成器。

ABSTRACT

Function contract generation is a classical problem in program analysis that targets the automated analysis of functions in a program with multiple procedures. The problem is fundamental in inter-procedural analysis where properties of functions are first obtained via the generation of function contracts and then the generated contracts are used as building blocks to analyze the whole program. Typical objectives in function contract generation include pre-/post-conditions and assigns information (that specifies the modification information over program variables and memory segments during function execution). In programs with array manipulations, a crucial point in function contract generation is the treatment of array segments that imposes challenges in inferring invariants and assigns information over such segments. To address this challenge, we propose a novel symbolic execution framework that carries invariants and assigns information over contiguous segments of arrays. We implement our framework as a prototype within LLVM, and further integrate our prototype with the ACSL assertion format and the Frama-C software verification platform. Experimental evaluation over a variety of benchmarks from the literature and functions from realistic libraries shows that our framework is capable of handling array manipulating functions that indeed involve the carry of array information and are beyond existing approaches.

研究动机与目标

  • 自动生成对数组操作函数的前置/后置条件和赋值。
  • 利用外部不变性生成器在符号执行过程中提供循环不变量与摘要。
  • 在程序路径中维护并传播连续数组段和析取不变量。
  • 实现能精确描述数组段修改和循环退出的契约。
  • 将原型与 ACSL 和 Frama-C 集成,实现端到端验证。

提出的方法

  • 提出一个符号执行框架,在执行路径上携带不变量和连续数组段。
  • 在分析过程中使用外部不变性生成器提供循环不变量和循环摘要。
  • 用记忆模型表示数组,并用 Seg 结构跟踪连续数组段及内容模式。
  • 处理析取、分裂和合并数组段,以保持精确的段级信息。
  • 实现 C++ 的 LLVM 原型(约 19000 行),并与 ACSL/Frama-C 集成进行外部验证。
  • 通过路径条件和内存变化推导,从最终符号配置中推断函数契约(前置/后置条件和赋值)。
Figure 1: Array program examples
Figure 1: Array program examples

实验结果

研究问题

  • RQ1如何利用符号执行自动合成数组操作函数的契约?
  • RQ2是否可以有效地将外部不变性生成器集成以在符号执行中携带循环不变量和摘要?
  • RQ3如何表示、合并和拆分连续数组段以获得精确的赋值信息?
  • RQ4在多大程度上该方法能够为真实世界的库生成准确的前置条件和后置条件?

主要发现

  • 该框架通过携带析取型循环不变量与连续数组段,生成描述数组操作行为的精确函数契约。
  • 扩展的内存模型和 Seg 结构使得对连续数组段及其内容模式的跟踪成为可能。
  • 该方法与 ACSL 和 Frama-C 集成,允许由外部验证器进行验证。
  • 实验证据表明该框架能够处理超越现有方法的数组操作函数。
  • 原型证明了将 LLVM 实现与外部不变后端结合用于契约合成的可行性。
Figure 2: General workflow of array-carrying symbolic execution
Figure 2: General workflow of array-carrying symbolic execution

更好的研究,从现在开始

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

无需绑定信用卡

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