mlsanityData to 14 Oct 2026

Integrating Symbolic Execution with LLMs for Automated Generation of Program Specifications

arXiv 2506.09550 ↗First posted 11 Jun 2025cs.SEcited by 4

Not on the map. Why?

Abstract (arXiv)

Automatically generating formal specifications including loop invariants, preconditions, and postconditions for legacy code is critical for program understanding, reuse and verification. However, the inherent complexity of control and data structures in programs makes this task particularly challenging. This paper presents a novel framework that integrates symbolic execution with large language models (LLMs) to automatically synthesize formally verified program specifications. Our method first employs symbolic execution to derive precise strongest postconditions for loop-free code segments. These symbolic execution results, along with automatically generated invariant templates, then guide the LLM to propose and iteratively refine loop invariants until a correct specification is obtained. The template-guided generation process robustly combines symbolic inference with LLM reasoning, significantly reducing hallucinations and syntactic errors by structurally constraining the LLM's output space. Furthermore, our approach can produce strong specifications without relying on externally provided verification goals, enabled by the rich semantic context supplied by symbolic execution, overcoming a key limitation of prior goal-dependent tools. Extensive evaluation shows that our tool SESpec outperforms the existing state-of-the-art tools across numerical and data-structure benchmarks, demonstrating both high precision and broad applicability.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 11 Jun 2025.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 3.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Enhancing LLM-based Specification Generation via Program Slicing and Logical Deletion
  2. 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference
  3. 2026Teaching LLMs Program Semantics via Symbolic Execution Traces
  4. 2025Understanding Formal Reasoning Failures in LLMs as Abstract Interpreters
  5. 2026Inferring Code Correctness from Specification
  6. 2025Loop Invariant Generation: A Hybrid Framework of Reasoning optimised LLMs and SMT Solvers
  7. 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
  8. 2026Teaching Code LLMs to Reason with Intermediate Formal Specifications