[Paper Review] Array-Carrying Symbolic Execution for Function Contract Generation
A symbolic execution framework that carries array invariants and contiguous array segments to synthesize function contracts in ACSL/Frama-C, implemented on LLVM and integrating external invariant generators.
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.
Motivation & Objective
- Automate generation of function pre-/post-conditions and assigns for array-manipulating functions.
- Leverage external invariant generators to supply loop invariants and summaries during symbolic execution.
- Maintain and propagate contiguous array segments and disjunctive invariants across program paths.
- Enable precise contracts that capture array segment modifications and loop exits.
- Integrate the prototype with ACSL and Frama-C for end-to-end verification.
Proposed method
- Propose a symbolic execution framework that carries invariants and contiguous array segments along execution paths.
- Use external invariant generators to supply loop invariants and loop summaries during analysis.
- Represent arrays with a memory model and a Seg structure that tracks contiguous array segments and content patterns.
- Handle disjunction, splitting, and merging of array segments to preserve precise segment-level information.
- Implement a C++ LLVM prototype (≈19000 lines) and integrate with ACSL/Frama-C for external verification.
- Infer function contracts from final symbolic configurations by deriving pre/post conditions and assigns from path conditions and memory changes.

Experimental results
Research questions
- RQ1How can function contracts be automatically synthesized for array-manipulating functions using symbolic execution?
- RQ2Can external invariant generators be effectively integrated to carry loop invariants and summaries during symbolic execution?
- RQ3How can contiguous array segments be represented, merged, and split to yield precise assigns information?
- RQ4To what extent can the approach generate accurate preconditions and postconditions for real-world libraries?
Key findings
- The framework generates precise function contracts that describe array-manipulating behavior by carrying disjunctive loop invariants and contiguous array segments.
- An extended memory model and a Seg structure enable tracking of contiguous array segments and their content patterns.
- The method integrates with ACSL and Frama-C, allowing verification by external verifiers.
- Experimental evaluation shows the framework handles array-manipulating functions beyond existing approaches.
- Prototype demonstrates the feasibility of combining LLVM implementation with external invariant back-ends for contract synthesis.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.