Paper commentary
ProofCoder: Continuous Reasoning for Automated Software Verification
ProofCoder reasons continuously while it writes and repairs Rocq proofs
- Problem Rigid tactic loops leave premise retrieval and backtracking to a fixed controller, so the model cannot easily repair proofs.
- Method ProofCoder treats the proof script as editable and writes a short reasoning note before each tool call. Rocq rechecks every edit, so the agent can revise a suffix or backtrack.
- Results ProofCoder-WP proves 113 SV-COMP lemmas with claude-sonnet-4.5, 27 more than AutoRocq.
Where tactic loops get stuck
Interactive proof assistants give strong guarantees, but writing proof scripts takes time and expertise. Proof scripts also break when the program or its specification changes, so the proofs must be adapted or rebuilt as the software evolves. LLM-based proof synthesis is attractive because the proof assistant rejects wrong candidates, so a bad output costs an attempt rather than correctness.
Most earlier systems, however, place the model inside a controller-driven loop that decides when to retrieve context, backtrack, or repair.
AutoRocq is the closest agentic system, and it gives the model more say over proof search. Its autonomy is still bounded, because a semi-constrained protocol limits tool use and guides the next action. A loop-invariant example shows where this bites, since AutoRocq finds the right case split but then fails to close the boundary case. AutoRocq rewrites i1 to i and then has the needed hypothesis is_sint32 in context, yet it doesn't unfold that definition.
Instead, it explores rewrites and unfoldings of shift and tries to prove equalities between terms, which moves the proof away from the fact that closes the branch. The failure happens at the level of local proof-state interpretation, not at the level of the global proof idea.
A coding agent that reasons between edits
ProofCoder treats the proof script as an editable artifact, much as a coding agent treats source code. The agent gets a tool, edit_proof, that is the only call able to change the script. Each edit is rechecked by Rocq, and the response reports either the updated proof state or the failing tactic index with its state. After each round of this feedback, the agent can extend the script or revise a suffix it wrote earlier.
The agent can also replay earlier states with check_state before deciding where to repair.
The central addition is a short natural-language reasoning note written before every tool call. That note records the model's reading of the current proof state, the local objective, and the intended action. The tool call then carries out the action described in that note. The authors expect this note to matter most during repair, because the agent can judge whether a failure calls for a small fix or an abandoned prefix.
Because the note carries the diagnosis forward, the agent can keep a prefix that still works and change only the failing part. AutoRocq, by contrast, organizes its reasoning around an initial plan, whereas ProofCoder's model controls both the edits and the reasoning around them. The authors call the result coding-agent repair: edit, observe the outcome, diagnose the failure, and revise.
How a session and its tools fit together during one attempt
Each attempt runs inside a preconfigured Rocq session bound to one proof obligation, its theorem name, source file and workspace. The agent starts from the initial proof state, with hypotheses and goals, and builds an ordered list of tactic lines. Rocq acts as the verifier after every edit, and a session ends successfully only when Rocq accepts the script and all goals are discharged.
The agent can't use placeholders such as admit or shelve/unshelve, so only fully checked proofs count as successes. The setup also stops the agent from changing the theorem statement.
The agent reaches Rocq only through four tools, and three of them only read the session. The check_state tool replays the script up to a chosen tactic index and returns that proof state. Index 0 is the initial goal, so the agent can revisit earlier states before deciding where to repair. The call_command tool runs Rocq commands such as Search, Print and Locate, and its output joins the model context.
The read_proof_file tool lets the agent inspect files in the workspace when the compact proof-state display isn't enough. The edit_proof tool is the only one that changes the script, appending a fragment by default. Given an edit index n, edit_proof keeps the first n lines, drops the suffix and appends the new fragment.

Fig. 1 . Overview of ProofCoder’s workflow.
Original paper · CC BY 4.0 · Martim Afonso, Inês Lynce, Maurizio Morisio, João F. Ferreira · ProofCoder: Continuous Reasoning for Automated Software Verification · Original paper figure · Extracted the figure area from page 5 of the original PDF.After each edit, Rocq rechecks the script and returns its feedback to the agent. The same edit tool serves both granularities, since a tactic-level run sends one tactic per call while a whole-proof run may send a full attempt. Continuous reasoning sits on top of these calls, with a note explaining the diagnosis before each action.
Repairing one loop-invariant proof
The first attempt applies the loop invariant directly at index i1, and the proof state exposes a gap. The remaining subgoal is i1 < i, but the context only contains i1 <= i, so the invariant's strict inequality is missing. ProofCoder reads this feedback and revises its plan through continuous reasoning instead of dropping the proof. The repair doesn't restart the proof, because it keeps the introductions and the unfolding of x.
It replaces only the unconditional application with an assert that splits the goal into i1 < i or i1 = i.
In the i1 < i branch, the agent reuses the original idea and applies H_forall. The apply and assumption steps close that branch, because the invariant covers it directly. The boundary case i1 = i is the branch that still needs work. Rewriting with H_eq gives a bound on t (shift a i), but assumption fails there. The matching hypothesis H_sint32_i_val uses the predicate is_sint32, not the explicit bounds.
ProofCoder queries the definition of is_sint32, which expands to bounds with a strict upper limit of 2147483648. The agent notes that these bounds are equivalent for integers, so it replaces the failed assumption step.
The local fix is an unfold of is_sint32 in H_sint32_i_val, followed by lia. The repair touches two places: a new case split and one changed closing tactic. The final script combines the case split, the apply and assumption steps, and the rewrite with H_eq. The paper counts this repaired script as a completed proof of the lemma.
The failed steps don't invalidate the whole proof, because the introduced context and the solved branch remain useful. ProofCoder keeps this prefix and replaces only the failing fragment. Inspired by coding agents, the agent treats the proof script as an editable artifact.
Benchmarks, baselines and budgets
No ground-truth proofs exist, so the benchmark doesn't say which lemmas are provable.
The authors reuse published results from Rango, PALM, COPRA, Proverbot9001 and QEDCartographer for broader context. AutoRocq has four tools: Plan, Query, Tactic and Rollback. Rollback wasn't evaluated in the original work, yet early experiments showed it improved performance with newer models. AutoRocq was first evaluated with gpt-4.1, so the authors re-ran it with claude-sonnet-4.5 and gpt-6-sol.
The agent gives up when further search looks unlikely to succeed, and the authors give AutoRocq the same mechanism.
ProofCoder runs as a thin integration layer on the OpenCode agent runtime. A custom Model Context Protocol server of about 3,100 lines of Python connects it to Rocq. Both claude-sonnet-4.5 and gpt-6-sol run with temperature 0. The primary budget is 200k non-cached tokens, because tool-call counts would favor some granularities over others.
A cap of 5M total tokens and a 30-minute wall-clock timeout per lemma act as secondary limits. These limits leave typical proof attempts largely unaffected, according to the authors.
SV-COMP results against AutoRocq
ProofCoder beats AutoRocq on SV-COMP with both models, and both of its configurations do so. With claude-sonnet-4.5, ProofCoder-WP proves 113 lemmas, 27 more than AutoRocq, which is a 31.4% relative improvement. Table 1 shows the pass counts behind these comparisons on the 200 SV-COMP lemmas. Every lemma that AutoRocq proved was also proved by at least one ProofCoder configuration, as Figures 2a and 2b show.

Table 1 . Pass rates, average cost, and average time on 200 SV-COMP lemmas. The last three columns are solved lemmas of each obligation type (49 assert reachability, 30 signed int overflow, and 121 loop invariant).
Original paper · CC BY 4.0Most of the gain comes from loop invariant lemmas, which is where the SV-COMP advantage sits. With claude-sonnet-4.5, AutoRocq solves 34 loop invariant lemmas (28.1%), while ProofCoder-TL and ProofCoder-WP each solve 58 (47.9%). On the other two categories, AutoRocq is already close: 30 against 31 and 32 against 49 assert reachability lemmas.
Signed overflow is close too, at 22 against 22 and 23 of the 30 lemmas.
With gpt-6-sol the same concentration holds, although AutoRocq is a stronger baseline there. AutoRocq solves 45 loop invariants (37.2%), while both agents solve 61 (50.4%). Loop invariant lemmas aren't more complex by syntactic metrics, so the gain has another source. Manual inspection suggests that ProofCoder doesn't mainly find new proof strategies, since AutoRocq tried the same key steps.
The difference lies in execution: ProofCoder keeps promising prefixes and repairs localized failures.
Cost and time favour the agents on SV-COMP with gpt-6-sol. With claude-sonnet-4.5, however, Whole-Proof was the slowest configuration, at 895 s on SV-COMP. Time doesn't track cost in that setting, since ProofCoder-TL ran faster than Whole-Proof there.
Verker results against AutoRocq
On the 80 Verker lemmas, the advantage over AutoRocq holds with both models, though the margins are smaller than on SV-COMP. With claude-sonnet-4.5, AutoRocq solved 29 of 80 lemmas (36.2%), Tactic-Level solved 34 (42.5%), and Whole-Proof solved 31 (38.8%). With gpt-6-sol, AutoRocq solved 38 (47.5%), Tactic-Level 46 (57.5%), and Whole-Proof 48 (60.0%).
The paper reads the jump from claude-sonnet-4.5 to gpt-6-sol as a sign that the agentic design benefits from a stronger underlying LLM.
The two approaches don't solve the same lemmas, so each has some lemmas the other misses. The best configuration solved three lemmas that AutoRocq didn't, while AutoRocq alone solved one lemma. With claude-sonnet-4.5, the Verker gains come from assert reachability rather than loop invariants, where AutoRocq solved 17 of 53 lemmas (32.1%).
On loop invariants with claude-sonnet-4.5, AutoRocq solved 12 of 27 lemmas (44.4%), compared to 11 for Tactic-Level and 9 for Whole-Proof. With gpt-6-sol, both configurations surpass AutoRocq on loop invariants, reaching 15 lemmas against AutoRocq's 11.
Which design choices carry the gains
ProofCoder has four ablations, all run with gpt-6-sol, each removing or swapping one design element. TL-NoCR replaces continuous reasoning with a plan tool, while TL-NoCR+Rollback also backtracks only through Rollback. WP-NoCR applies the same plan-tool swap to whole-proof generation, and WP-Reset restarts the proof after every failed generation.

Table 3 . ProofCoder ablations withgpt-6-sol: proof success, cost, and time on SV-COMP and Verker.
Original paper · CC BY 4.0Removing continuous reasoning from ProofCoder-TL drops SV-COMP solves from 119 to 115 and Verker solves from 46 to 40. ProofCoder-WP falls from 120 to 113 on SV-COMP and from 48 to 43 on Verker, with cost rising 55% and 79%. Swapping in the rollback tool leaves TL-NoCR+Rollback at 115 on SV-COMP, but Verker falls to 35.
The reset ablation causes the largest drop: SV-COMP solves fall from 120 to 81, and Verker solves fall from 48 to 24. Its SV-COMP cost also rises from $0.084 to $0.192, so restarting costs more and solves less. The authors take this as support for preserving the existing proof and repairing only the failing suffix. Each removal lowers success, but the ablations don't isolate whether each component helps on its own.
How backtracking changes
Backtracking frequency is where continuous reasoning shows its clearest effect on the tactic-level variants. On SV-COMP with gpt-6-sol, ProofCoder-TL backtracks 0.45 times per task, compared to 2.4 for ProofCoder-TL-NoCR and 3.05 for ProofCoder-TL-NoCR+Rollback. On Verker the figures are 1.39 for ProofCoder-TL, 5.8 for ProofCoder-TL-NoCR and 7.6 for the rollback variant.
The authors describe this as roughly 4 to 6 times fewer backtracks than both ablations.

Fig. 3 . Comparison of backtrack depth and frequency across tactic-level approaches.
Original paper · CC BY 4.0Depth separates the variants by how much of the proof each backtrack discards. Without reasoning, ProofCoder-TL-NoCR makes shallow, local edits, with median depth near 43% on SV-COMP and 22% on Verker. ProofCoder-TL-NoCR+Rollback tends toward near-complete restarts on SV-COMP, with median depth near 90%. ProofCoder-TL sits between them, with median depth near 67% on SV-COMP and 50% on Verker.
The authors suggest that reasoning about a failure lets the agent choose one well-placed resumption point. The agent then avoids patching locally or discarding most of the proof.
On SV-COMP, the mean preservation of backtracks is 88.7% for ProofCoder-TL. Preservation drops to 65.0% for ProofCoder-TL-NoCR and to 48.5% for the rollback variant. The distributions also widen, with interquartile ranges of 80 to 100%, 33 to 100% and 21 to 67%. On Verker the ordering holds, with 77.6%, 72.0% and 68.2%, but the differences are smaller.
ProofCoder-TL-NoCR's shallow backtracks are often overridden later, while the rollback variant's restarts discard earlier revisions by construction.
Because the final backtrack is always preserved, ProofCoder-TL's higher rate partly reflects its lower backtrack frequency. The authors also note that the rollback tool produces the most frequent and least stable backtracks.
Whole-proof versus tactic-level
Granularity barely moves the pass count, because ProofCoder-WP and ProofCoder-TL solve nearly the same lemmas. On Verker with claude-sonnet-4.5, ProofCoder-TL leads with 34 lemmas (42.5%) against 31 (38.8%) for ProofCoder-WP. With gpt-6-sol on Verker, ProofCoder-WP leads with 48 lemmas (60.0%) against 46 (57.5%) for ProofCoder-TL. ProofCoder-WP stays cheaper, for instance $0.352 against $0.516 on SV-COMP with claude-sonnet-4.5.
Larger fragments need fewer model turns, which explains the lower cost of ProofCoder-WP.
ProofCoder-WP sees the proof state only once per fragment, so it calls check_state more often. With gpt-6-sol on SV-COMP, ProofCoder-WP makes 206 check_state calls, while ProofCoder-TL makes only 6. With claude-sonnet-4.5 on SV-COMP, the gap is small: 567 calls for ProofCoder-WP against 521 for ProofCoder-TL. ProofCoder-WP backtracked on 70.0% of SV-COMP lemmas with claude-sonnet-4.5, averaging 5.35 backtracks.
ProofCoder-TL backtracked on 65.0% of those lemmas, averaging 3.69 backtracks.
On SV-COMP with claude-sonnet-4.5, ProofCoder-WP averaged 14.7 tactics per proof and ProofCoder-TL averaged 12.9. Mean Jaccard similarity between the two proofs of a lemma was 0.41 with claude-sonnet-4.5 and 0.40 with gpt-6-sol. Only 3 and 8 proof pairs were identical, so the two granularities mostly build distinct proofs.
Granularity leaves success almost unchanged, but it reshapes how the search runs and how the agent repairs. The paper's RQ3 answer puts the gap at no more than three lemmas per setting.
Limits of the evidence
The benchmark doesn't establish which lemmas are provable, because no ground-truth proofs are available for the AutoRocq lemmas. So the subset keeps most obligations known to be solvable, but provability isn't established for the full subset. Verker lemmas come from Linux kernel code, and the paper reuses them from AutoRocq's own case study.
On Verker, the two systems don't solve exactly the same lemmas, so the results aren't strictly nested. Our best configuration proves three lemmas that AutoRocq doesn't, while AutoRocq alone solves one lemma. The paper reports these counts only for Verker, with 80 lemmas in that benchmark.
The ablations use gpt-6-sol alone, so the ablation effects are shown for that one model. They didn't run the ablations with claude-sonnet-4.5, so the effects for that model stay untested. Both models ran at temperature 0, which the paper states for both claude-sonnet-4.5 and gpt-6-sol. The 200k non-cached token budget came from practical cost constraints and preliminary experiments, with a 30-minute timeout per lemma.
The mechanism explanations rest on manual inspection and tool-call traces, which the authors describe as interpretive evidence. Their manual inspection of loop-invariant tasks found that AutoRocq attempted the same key proof steps in more than half of the ProofCoder-only solutions.
Paper info
- Authors
- Martim Afonso, Inês Lynce, Maurizio Morisio, João F. Ferreira
- Venue
- arXiv · Preprint
- First published
- 2026-11-10
- Added
- 2026-11-11
- Updated
- 2026-11-10
- Version
- v1
- arXiv
- 2611.14106
- Category
- cs.SE · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Formal verification using proof assistants provides strong correctness guarantees for software, but constructing proofs remains labor-intensive and requires significant expertise. Recent approaches based on large language models (LLMs) have shown promise in automating proof synthesis. However, these approaches typically constrain the model to a rigid tactic-generation loop, in which the surrounding system controls premise retrieval, proof-state management, and backtracking. We introduce ProofCoder, an agentic proof-synthesis system for Rocq that approaches theorem proving from a coding-agent perspective. Rather than generating tactics within a fixed loop, ProofCoder reasons continuously throughout proof search and uses proof-assistant feedback to decide when to gather additional information, inspect proof states, revise previously generated proof fragments, or backtrack to an earlier point in the proof. This allows it to iteratively construct, repair, and refine proofs, at either tactic-level or whole-proof granularity. We evaluate ProofCoder on 280 challenging verification tasks from the AutoRocq Benchmark. On the best-performing configurations, ProofCoder increases proof success from 47% to 60% over the state-of-theart AutoRocq system, corresponding to a 27.7% relative improvement at approximately half the cost. Our ablations identify continuous reasoning as a key design choice: without it, the agent solves fewer lemmas at substantially higher cost, backtracks four to six times more often, and more frequently discards its own revisions. Whole-proof and tactic-level generation achieve similar success rates but follow distinct search and repair strategies. These results suggest that effective automated software verification requires more than improved tactic selection: continuous reasoning and feedback-guided proof revision are critical ingredients for robust proof synthesis.
Quote from the paper
Martim Afonso, Inês Lynce, Maurizio Morisio, João F. Ferreira (2026). ProofCoder: Continuous Reasoning for Automated Software Verification. arXiv:2611.14106v1. https://arxiv.org/abs/2611.14106v1
BibTeX
@misc{afonso2026proofcoder,
title = {{ProofCoder: Continuous Reasoning for Automated Software Verification}},
author = {Martim Afonso and Inês Lynce and Maurizio Morisio and João F. Ferreira},
year = {2026},
eprint = {2611.14106},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.14106v1}
}