LLM-Assisted Bi-Approximate CHC Solving
Organizations: Tsinghua University, China
Abstract
Constrained Horn clause (CHC) solvers often struggle to discover deep counterexamples whose derivations may require extensive rule unfolding. Although large language models (LLMs) can propose long-range symbolic relations, prior work on formally checked LLM-assisted verification has mainly focused on generating inductive invariants and concrete traces. We exploit this broader capability through Derivation Power Under-approximations (DPUs). Each DPU is a solver-certified under-approximation of the relation induced by a multi-step CHC derivation. An LLM proposes each DPU with symbolic intermediate-state witnesses that enable SMT validation without introducing additional quantifiers. Validated DPUs can be composed and reused soundly. Building on this mechanism, our LLM-assisted framework HornCraft combines invariant generation for over-approximation with DPU generation for under-approximation in CHC solving. On 260 linear and nonlinear integer-arithmetic CHC-COMP benchmarks left unresolved by a 30-minute Spacer run, HornCraft returns certified verdicts for 228 instances. It certifies 42 instances as unsafe, compared with 22 when DPU construction and reuse are disabled.
Figures & tables
| 1 | |
|---|---|
| 2 | for each in submission order while permits certification do |
| 3 | if not then |
| 4 | record rejection in ; continue |
| 5 | end if |
| 6 | if is a DPU candidate then |
| 7 |
| 1 | ; |
|---|---|
| 2 | |
| 3 | if then return |
| 4 | while permits interaction do |
| 5 | |
| 6 | if is a mixed candidate batch then |
| 7 |
| Track | Expected safe | Expected unsafe | Expected unknown | Overall |
|---|---|---|---|---|
| LIA-Lin | 137/149 (92%) | 32/32 (100%) | 17/21 (81%; 11 S + 6 U) | 186/202 (92%) |
| LIA | 30/36 (83%) | 3/3 (100%) | 9/19 (47%; 8 S + 1 U) | 42/58 (72%) |
| Total | 167/185 (90%) | 35/35 (100%) | 26/40 (65%; 19 S + 7 U) | 228/260 (88%) |
| Solver and track | Cases | Expected safe | Expected unsafe | Expected unknown | Overall |
|---|---|---|---|---|---|
| LoAT–LIA-Lin | 52 | 18/21 (86%) | 10/10 (100%) | 17/21 (81%; 11 S + 6 U) | 45/52 (87%) |
| Golem–LIA-Lin | 118 | 80/91 (88%) | 6/6 (100%) | 17/21 (81%; 11 S + 6 U) | 103/118 (87%) |
| Eldarica–LIA | 35 | 10/15 (67%) | 1/1 (100%) | 9/19 (47%; 8 S + 1 U) | 20/35 (57%) |
| Tested | Maximum solved | Full at maximum | ||||
|---|---|---|---|---|---|---|
| Family | (instances) | Spacer | Without DPU | Full | Time (s) | Tokens (M) |
| Hanoi (linear) | 4–20 (9) | 4 | 12 | 20 | 207.5 | 0.63 (93%) |
| Hanoi (path) | 4–20 (9) | 4 | 12 | 20 | 238.3 | 0.59 (91%) |
| Ackermann | 3–10 (8) | 4 | 6 | 8 | 841.3 | 3.34 (96%) |
| Chinese Rings | 4–20 (9) | 6 | 12 | 20 | 682.5 | 3.24 (95%) |
| Pascal | 10–10,000 (7) | 100 | 300 | 1,000 | 601.5 | 2.38 (96%) |
| Family | Used DPUs | Compact proof source uses | Expanded original clause uses | Largest used DPU expanded span | |
|---|---|---|---|---|---|
| Hanoi (path) | 20 | 20 | 82 | 2,097,153 | 2,097,150 |
| Ackermann | 8 | 122 | 3,922 | 2,785,999 | 40,630 |
| Chinese Rings | 20 | 83 | 213 | 1,398,103 | 1,398,100 |
| Pascal | 1,000 | 282 | 4,275 | 998,999 | 61,024 |
| Tarai | 20 | 0 | 3,478 | — |
| Track | Configuration | Safe | Unsafe | Solved / Cases |
|---|---|---|---|---|
| LIA-Lin | Full | 148 | 38 | 186/202 (92%) |
| Without DPU | 146 | 17 | 163/202 (81%) | |
| LIA | Full | 38 | 4 | 42/58 (72%) |
| Without DPU | 34 | 5 | 39/58 (67%) | |
| Total | Full | 186 | 42 | 228/260 (88%) |
| Without DPU | 180 | 22 | 202/260 (78%) |
Formal Verification
Formal verification uses mathematical models and machine-checked proofs to establish whether software and systems satisfy precise specifications.
See all 345 papers