Skip to content
Conference

LLM-Based Invariant Generation for Multi-Loop Programs via Forward and Backward Iterative Refinement

Jul 2026 · Fall Joint Computer Conference · pp. 345-350 · 0 citations · 15 references

Abstract

Cloud computing infrastructure increasingly relies on cloud services where correctness is critical. Ensuring their correctness requires formal verification techniques grounded in rigorous mathematical reasoning. In practice, formal models of cloud services frequently exhibit multiple loop structures, and verifying such models depends on the ability to automatically generate sufficient and accurate loop invariants. In this paper, we present an LLM-based invariant generation method for multi-loop programs via forward and backward iterative refinement. The approach is built upon the recent generate-combine-check framework. First, we employ a multiloop structure-guided strategy to instruct the LLM to produce clause expressions without logical connectives, which are then combined via counterexample-driven refinement to form candidate invariants. After that, we use a backward iterative refinement mechanism to adjust the invariants in reverse order, that is, from post-condition at the end of the program, to the inter-loop invariants, and finally to the pre-condition at the beginning of the program. We implemented a prototype tool named MultiInvGen. Evaluation results show that, MultiInvGen successfully solves 71 tasks (65.7%) on a benchmark of 108 C programs, significantly outperforming the state-of-the-art LLMbased and Multi-loop invariant generation tool.

View source

Similar papers

Jul 2026

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

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 v...

Guangsheng Fan, Liqian Chen, Pei-Sen Yao et al. · 0 citations
Conference Open access Sep 2026

QiMeng-VPID: Verification-Grounded Port-Level Iterative Decomposition for Complex Verilog Generation

This work proposes VPID, a multi-agent framework for generating complex Verilog that achieves monotonic functional improvement and introduces an experience-guided refinement strategy that distills historical waveform mismatches into constraints, guiding the targeted debugging for the unverified ports.

Hong-Guang Wang, Jiaming Guo, Rui Zhang et al. · 0 citations
Jul 2026

LimICE: Integrating LLM into ICE Framework for Efficient Loop Invariant Inference

The proposed Incremental ICE framework integrates the incremental philosophy of IC3 into the general invariant learning framework ICE and instantiate a loop invariant synthesis tool, LimICE, which leverages LLMs to generate the ordered sequence of lemmas and incorporates ICE-DT as a fallback mechanism to complement the...

Kai Fan, Shiwen Yu, Guangsheng Fan et al. · 0 citations
#artificial intelligence Preprint Sep 2026

SOVER: Formal Certification of Optimization Reformulations via LLM-Assisted SMT Verification

SOVER, an LLM-assisted SMT framework that separates semantic mapping from formal certification, is introduced, and Z3 checks domain cross-feasibility and global objective-order preservation for mixed-integer linear formulations, while dReal provides tolerance-aware feasibility/range and $\epsilon$-argmin checks for con...

Swapnil Bhattacharyya, Mayank Baranwal · 0 citations
#software testing Book Open access Oct 2026

Towards a Vertically Integrated Compiler Infrastructure to Improve Solver Time during Symbolic Execution

The potential of integrating the compiler infrastructure with symbolic execution, thereby obtaining a program representation optimized for SMT solving, is illustrated by contributing conditional representation, a novel compiler transformation tailored to symbolic execution that results in a solver-efficient representat...

Sören Tempel, Christian Dietrich · 0 citations
#artificial intelligence Preprint Sep 2026

Dynamic Adaptation of the LLM Context for Generating Routines with Coupled Semantics

LLM-based code generation fails when correctness depends on execution-dependent coupling: the meaning of one routine is defined by the runtime behavior of another, a relationship that cannot be resolved from textual descriptions alone. This limitation, which we call static binding, is not confined to explicitly coupled...

Gnaneswar Villuri, Hashmath Shaik, Alex Doboli · 1 citation

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