跳到正文
arXiv cs.AI· Han Zhou, Yu Luo, Dianxiang Xu·· 13 小时前AI 评分23

AutoFraming:用 LLM 为 C 代码合成动态 frame 规约

AutoFraming: Synthesizing Dynamic Frames of C Code with LLMs

AI 导读

AutoFraming 提出一种基于 LLM 的方法,从 C 代码中同时合成 ACSL frame 规约与功能契约,通过分析代码属性图(CPG)提取 frame 相关信息来引导 LLM 生成准确的 frame 条件。

正文 · 原文

View PDF HTML (experimental)

Abstract:Large language models (LLMs) have shown considerable promise in synthesizing formal specifications from source code. However, existing approaches primarily focus on functional contracts and loop invariants, while largely neglecting frame conditions, which specify the memory locations that may or may not be modified during execution and constitute an essential part of formal specifications. To address this limitation, we propose an LLM-based approach for synthesizing ACSL frame specifications alongside functional contracts from C code. Our approach analyzes code property graphs (CPGs) to extract frame-relevant information from the input code and leverages this information to guide the LLM in generating accurate frame conditions. The resulting specifications capture both region-separation constraints and data dependencies that govern variable modifications. Experimental results demonstrate the effectiveness of our approach. On a benchmark of 84 ACSL-compliant functions from non-trivial real-world systems, our method successfully synthesizes error-free frame specifications for 92.9% of the functions, representing a 179% relative improvement over state-of-the-art techniques. On a second benchmark consisting of 51 functions, the success rate increases from 80.4% to 96.1%. Furthermore, when integrated as an auxiliary component into existing LLM-based ACSL-synthesis frameworks, our approach improves frame-specification generation performance by up to 61.9%.
Comments: 12 pages, 1 figure, 6 tables
Subjects: Artificial Intelligence (cs.AI)
Cite as: arXiv:2610.29046 [cs.AI]
  (or arXiv:2610.29046v1 [cs.AI] for this version)
  https://doi.org/10.48550/arXiv.2610.29046

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Yu Luo [view email]
[v1] Wed, 21 Oct 2026 01:22:00 UTC (501 KB)

来源:arXiv cs.AI · arxiv.org