Manuscript Offprint

arXiv:2610.39435

Verifiable LLM-Guided Focal SMT Solving for Quantified Arrays

Kunhang Lv, Rui Han, Fuqi Jia, Yuhang Dong, Feifei Ma, Jian Zhang

Abstract

Large language models can often identify useful semantic structure in formal artifacts, but their outputs cannot be trusted as proofs or solver decisions. We study whether LLMs can instead guide formal reasoning systems through a narrow, solver-verifiable interface. We instantiate this idea in quantified array SMT solving, where modern instantiation-based techniques can fail when key ground terms and equalities are hidden by auxiliary variables, axiom guards, and nested array terms. We observe that many instances are largely driven by a small set of focal ground terms or constraints, similar to the backdoor sets in SAT solving. Building on this, we present LINGUAARRAY, a framework where an LLM proposes a small Semantic Focus Set (ground terms/constraints), while a conventional SMT solver remains the sole proof engine and certifies all results. LINGUAARRAY uses these LLM-suggested, solver-validated finite sets to significantly enhance solver capability, solving additional satisfiable and unsatisfiable instances that the backend alone fails to solve. It interacts within a finite time and then falls back to the backend solver to mitigate potential regressions. Evaluation on 1015 SMT-LIB instances across five logics under 1200s timeout (including LLM latency) shows that LINGUAARRAY solves up to 69.1% of instances and increases solved-instance counts by 105%–397% over the corresponding backends.

1 Introduction

Large language models have shown promise in reasoning over structured symbolic inputs, but formal reasoning tasks require correctness guarantees beyond what unverified LLM outputs provide. This motivates a restricted form of LLM assistance: using LLMs to propose semantic guidance while leaving all correctness-critical decisions to a trusted symbolic solver. We study this question in the context of Satisfiability Modulo Theories (SMT) [17, 2], a key computational foundation for software verification, program analysis, model checking, and automated test generation [4, 12, 9, 25]. Among them, quantified arrays are widely used to express loop invariants, memory safety conditions, and relational specifications over data structures, but remain challenging for modern solvers. The combination of arrays and quantifiers is generally complex and undecidable [7], which is particularly challenging for SMT solvers.

Modern SMT solvers primarily handle quantified formulas through quantifier instantiation, such as trigger-based E-matching [10, 11] and model-based quantifier instantiation (MBQI) [13]. Selecting effective triggers and diagnosing missing instantiations remain major bottlenecks [3], and even recent refinements [27, 23, 28] still depend on identifying a small set of proof-relevant ground terms early. For array theory, solvers typically use the read-over-write and extensional axiom for simplification.

∗^{*}Corresponding authors.

Preprint.

and reasoning [31, 8]. However, when quantifiers are present and combined with complex operations such as these, key indexes and relationships are often obscured, which can lead to insufficient instantiation [26, 3].

Consider a simple quantified formula over arrays:

∀i. (0≤i<n⇒A[t↦x][i]≥0).\forall i.\ (0\leq i<n\Rightarrow A[t\mapsto x][i]\geq0).

This uses the write operation on A and verifies under the universal quantifier. It's obvious we need to locate the assignment x at position t to determine satisfiability; the solver must ultimately instantiate the universal quantifier at the witness index i = t. In realistic benchmarks, such witness terms are rarely presented as simple variables: they are buried under auxiliary definitions, and can even be array-valued terms when quantifiers range over arrays (cf. Example 2). As a result, it's hard for the solvers to find the exact instantiation candidates, leading to timeouts or abandonment.

Therefore, the difficulty of quantified array solving does not lie in the inference rules of arrays themselves. Instead, a few decisive semantic focusing choices are often sufficient to render the problem readily tractable for the solver. However, traditional solvers rely solely on fixed syntactic triggers. This prevents them from exploiting the diverse and deep semantic information in real-world formulas. Our insight is that this missing capability cannot be systematically recovered through trigger engineering or hard-coded rules; instead, it can be supplied by a large language model (LLM) and the solving process can be safely accelerated by limiting it to a focus object that is verifiable by the solver.

To surface such focal points, we propose LINGUAARRAY, a framework that leverages LLMs to provide semantic guidance for quantified array solving. The key idea is that LLM identifies and proposes relevant focal points, which we call the semantic focus set, while using an SMT solver as the backend engine to validate all candidates and prove the final result. We realize this idea with a two-branch architecture. The UNSAT branch uses LLM-proposed Instantiation Focus Sets, i.e., a small collection of candidate ground instantiation tuples for universally quantified variables, to steer quantifier instantiation. The SAT branch uses Constraint Focus Sets, i.e., salient ground constraints, to guide model construction. Each branch constructs a derived formula, and once its satisfiability state is determined by the backend solver, yields a certified answer to the original problem. Since all conclusions are verified by the solver, soundness is preserved regardless of suggestion quality. To preserve baseline coverage, the LLM-guided interaction runs under a bounded budget and the framework falls back to the backend solver on the original formula under the remaining timeout.

We evaluate LINGUAARRAY on 1015 quantified array instances from SMT-LIB across five logics (ALIA, ABV, ABVFP, ABVFPLRA, ANIA) with a 1200-second end-to-end timeout per instance (including LLM latency). With Z3 as the backend solver, LINGUAARRAY solves 701 instances (69.1%) versus 141 instances (13.9%) for Z3 alone; with CVC5 it solves 659 instances (64.9%) versus 321 instances (31.6%) for CVC5 alone. Overall, LINGUAARRAY substantially improves solver effectiveness, raising the overall solve rate from 32% to roughly 70%.

Contributions. This paper makes three contributions:

• We introduce Semantic Focus Sets as a principled interface between LLMs and SMT solvers for quantified array reasoning, and implement this idea in the LINGUAARRAY framework with formal soundness guarantees and graceful degradation.

• We design a two-branch strategy, focused instantiation for UNSAT reasoning and focused strengthening for SAT reasoning, that exploits LLM-proposed focal points while preserving solver-certified correctness.

• We conduct extensive experiments on SMT benchmarks, demonstrating 105%-397% improvements over SOTA solvers, with evaluations confirming the effectiveness of our approach across different LLMs and configurations.

References (33)