← All papers
First page of AutoSpec: Towards Verifiable Software Development via Automated Theorem Proving

AutoSpec: Towards Verifiable Software Development via Automated Theorem Proving

Guchan Li, Hongning Wang

cs.SE Nov 27, 2026 · v1 cs.AI cs.CL
Extends the Aeneas Rust-to-Lean translation with numeric retargeting to Mathlib types, and benchmarks coding agents proving specifications in Lean 4.
Formal verification offers guarantees beyond software testing, but brings significant technical challenges as trade off. We present AutoSpec, a Rust-to-Lean toolchain and benchmark that enables coding agents to prove mathematical specifications of existing program implementations. Our toolchain extends translation-based verification to numerical algorithms, by connecting program computation with Lean's mathematical abstraction. Our benchmark comprises 159 testcases across nine algorithmic domains and, to our knowledge, is the first to decouple implementation from specification proving and evaluate strong interactive coding agents. We further provide the first systematic analysis of proof structure and agent behaviour in this setting, identifying structural reasoning and verification-specific knowledge acquisition as key challenges. Based on these findings, we provide valuable insights suggesting concrete directions for future vericoding systems.

Coding agents increasingly write software, but testing cannot rule out bugs. Interactive provers like Lean support rich specifications but normally require programs to be written in the prover's language. Existing vericoding benchmarks also do not separate implementation from specification proving.

AutoSpec extends the Aeneas Rust-to-Lean pipeline in two ways. Numeric retargeting at the LLBC level maps f64 and fixed-width integers to mathematical types (Rat, Real, Int, Nat). Term simplification makes the generated definitions easier to reason about with Mathlib. On this toolchain, a two-tier benchmark of 159 Rust programs across nine algorithmic domains was built, each with a manually written Lean specification. Eight coding agents were evaluated in isolated Lean workspaces with an LSP MCP server, with proofs checked by Lean Comparator; the study also analyzes proof-tree structure, tactic usage, and agent behaviour.

Figure 2: Proof tree of a Lean proof of 12\mid 4^{n+1}+20 .

Claude Opus 5.5 solves 73.0% of testcases overall but only 50.0% of Tier 2; the other agents score between 2.5% and 18.9%. Graph, matrix, and DP tasks are hardest. The analysis identifies two bottlenecks: reasoning about loops and recursion, and acquiring Aeneas- and library-specific knowledge. A guidance ablation helps with the latter.

Figure 1: Proof-tree size by benchmark category.
Figure 3: Agent-specific transition matrices (%).
AgentTotalTier 1Tier 2
Claude Opus 5.573.089.250.0
GPT 6 Sol18.925.89.1
GPT 5.6 Sol12.617.26.1
DeepSeek V4.1 Flash10.716.13.0
Leanstral 1.52.54.30.0
Overall accuracy (%) of selected agents on AutoSpec