Skip to content

Path-Sensitive Loop Invariant Inference via Large Language Models and Abstract Interpretation

Jul 2026 · ACM Transactions on Software Engineering and Methodology · 0 citations · 72 references

TL;DR

A path-sensitive loop invariant inference approach based on Large Language Models and abstract interpretation that constructs candidate invariants as disjunctions of clause conjunctions satisfied by counterexamples across loop paths and iteratively refines them using counterexamples generated by the SMT solver during verification.

Abstract

Loop invariant inference remains a core challenge in program verification, particularly when disjunctive invariants are required. In this paper, we present a path-sensitive loop invariant inference approach based on Large Language Models (LLMs) and abstract interpretation. We apply abstract interpretation to derive initial invariants, which, if insufficient to verify the program, guide an LLM-based agent to generate more precise, path-specific clauses. The core of our method is Counterexample-Guided Clause Combination (CEGCC), a novel strategy that constructs candidate invariants as disjunctions of clause conjunctions satisfied by counterexamples across loop paths, and iteratively refines them using counterexamples generated by the SMT solver during verification. This shifts the focus of invariant synthesis from blind enumeration to semantic refinement driven by genuine counterexample verification and generation. To further refine this approach, we leverage dependencies across different loop paths, apply abstract interpretation to improve SMT solving, and deploy a second LLM-based agent for counterexample verification and mutation. Results show PAL2Inv matches state-of-the-art LLM methods on linear benchmarks and verifies 53–142% more programs on multi-phase benchmarks, while remaining competitive with specialized symbolic multi-phase verifiers.

View source

Similar papers

#software testing Open access Oct 2026

Random Testing via Runtime Abstract Interpretation

Property-based testing of C programs can be automated by synthesizing random input generators from separation-logic specifications. Existing work in this space, such as the Bennet testing tool, uses randomized backtracking search, generating random values and checking them against constraints, backtracking on failure....

Zain K. Aamer, Benjamin C. Pierce · 0 citations
Preprint Sep 2026

Enhancing Word-Level Property Directed Reachability with LLM-Driven Semantic Guidance

Property Directed Reachability (PDR) is a prominent algorithm for hardware formal verification. However, bit-level PDR often struggles with datapath-heavy designs because bit-blasting obscures high-level semantics. While word-level PDR addresses this by reasoning over bit-vector and array theories, its performance rema...

Guang-Yu Hu, Ming-Kai Miao, Zhi-Yuan Yan et al. · 0 citations
#small language model Preprint Sep 2026

Path2Spec: Path-Aware Specification Generation via Large Language Models

This work introduces Path2Spec, a divide-and-conquer framework that leverages LLMs to extract all execution paths from an input program, generates path-specific specifications for each, and merges them into a comprehensive overall specification.

Dan Huang, Zhensu Sun, Hui-Hui Huang et al. · 0 citations
Preprint Sep 2026

Agentic-IC3: Enabling Semantic Proof Search in IC3 Model Checking

IC3 is a state-of-the-art algorithm for hardware model checking that proves safety properties by incrementally constructing an inductive invariant consisting of a set of lemmas. Its effectiveness depends on generalization heuristics that identify useful lemmas and guide proof search. However, many leading IC3 hardware...

Yu-Wei Fan, SooHyuk Cho, Aarti Gupta et al. · 0 citations
Open access Oct 2026

Steering Tree-of-Thought Reasoning via Deductive Verification

Large language models (LLMs) have demonstrated great potential in code reasoning tasks, but their reasoning processes lack reliable verification mechanisms, making it difficult to ensure logical correctness. The Tree of Thoughts (ToT) framework improves reasoning by exploring multiple paths and employing backtracking,...

Hao-Liang Cheng, En-Yi Tang, Shuo-Xiao Zhang et al. · 0 citations
Preprint Aug 2026

DualMine: Static-Dynamic REST API Constraint Discovery with Dual Validation

REST API constraints capture semantic properties of API responses and are essential for automated test oracle generation, but they are difficult to discover reliably. Static approaches infer constraints from API specifications and documentation, but their results may be affected by incomplete, ambiguous, or outdated sp...

Tuong Nguyen, Huy Nguyen, J. C. A. Valenzuela et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.