Automated Synthesis of Formally Verified Multi-Abstraction Function Summaries

📅 2025-06-11
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Legacy C code in safety-critical domains often lacks formal specifications and exhibits complex features—such as loops and pointer aliasing—that impede rigorous verification. Method: This paper introduces the first multi-abstraction-level framework for generating function summaries by synergistically integrating symbolic execution (VST-A), deductive verification (Frama-C), and large language models (LLMs). It pioneers automated generation of relatively strongest postconditions (RSPs), combines LLM-driven templated loop invariant inference with domain-specific-language (DSL)-based synthesis of non-redundant postconditions, and employs iterative refinement to ensure soundness and precision. Results: Evaluated on multiple embedded C benchmarks, our generated summaries achieve 100% formal correctness—fully satisfying verification obligations—while simultaneously attaining both the precision required for mechanized proof and the readability essential for human comprehension. The approach significantly outperforms existing state-of-the-art methods in both correctness guarantees and usability.

Technology Category

Application Category

📝 Abstract
Function summaries, which characterize the behavior of code segments (typically functions) through preconditions and postconditions, are essential for understanding, reusing, and verifying software, particularly in safety-critical domains like aerospace embedded systems. However, these mission-critical legacy code serving as a valuable reused asset often lacks formal specifications. It is challenging to automatically generate function summaries for C programs, due to the existence of complex features such as loops, nested function calls, pointer aliasing, and so on. Moreover, function summaries should support multiple abstraction levels to meet diverse requirements, e.g. precise summaries capturing full functionality for formal verification and intuitive summaries for human understanding. To address these challenges, we first propose a novel framework that combines symbolic execution, large language models (LLMs), and formal verification to generate Relatively Strongest Postconditions (RSPs) and build function summaries that fully capture program behavior. Our approach leverages VST-A's symbolic execution to precisely track program execution paths and state transitions, employs LLMs to infer loop invariants based on predefined templates, and uses Frama-C to guarantee soundness of generated summaries in an iterative refinement loop. Furthermore, from generated RSPs, we automatically synthesize strongest non-redundant postconditions expressed within given domain specific language. We compare our approach with existing work through extensive experiments.
Problem

Research questions and friction points this paper is trying to address.

Automatically generate verified function summaries for complex C programs
Support multiple abstraction levels for diverse verification needs
Address challenges like loops, pointers, and missing specifications
Innovation

Methods, ideas, or system contributions that make the work stand out.

Combines symbolic execution, LLMs, formal verification
Generates strongest postconditions via iterative refinement
Synthesizes non-redundant summaries in domain language
🔎 Similar Papers
No similar papers found.
F
Fanpeng Yang
Institute of Software, Chinese Academy of Sciences, UCAS, Beijing, China
X
Xu Ma
Institute of Software, Chinese Academy of Sciences, UCAS, Beijing, China
S
Shuling Wang
Institute of Software, Chinese Academy of Sciences, UCAS, Beijing, China
X
Xiong Xu
Institute of Software, Chinese Academy of Sciences, Beijing, China
Q
Qinxiang Cao
Sch. of Computer Science & Sch. of Artificial Intelligence, Shanghai Jiao Tong University, Shanghai, China
Naijun Zhan
Naijun Zhan
School of Computer Science, Peking University
Formal MethodsReal-timeembedded and hybrid systemsProgram Verification
X
Xiaofeng Li
Beijing Institute of Control Engineering, Beijing, China
B
Bin Gu
Beijing Institute of Control Engineering, Beijing, China