TL;DR
AI coding agents are great at passing unit tests, which is helpful until you’re building a distributed database where a single weird message interleaving can silently corrupt data. This paper introduces Inductive Deductive Synthesis (IDS), an agentic system that co-evolves code and mathematical correctness proofs simultaneously. It transforms months of grueling human verification work into a few hours and roughly $100 of compute—while generating systems that run up to 3× faster than human-built verified baselines.
What Problem Does This Paper Address?
Unit tests only check the scenarios you think to test. In distributed systems—where network delays, node crashes, and concurrent writes create a combinatorial explosion of states—testing cannot guarantee correctness. Formal verification solves this by using a proof assistant (like Rocq, formerly Coq) to mathematically prove that code satisfies a specification across every possible input and execution path.
The catch? Formal verification is notoriously agonizing, requiring months or years of PhD-level labor. Naturally, you might wonder if we can just hand a specification to state-of-the-art AI coding agents (like Claude Code or Codex) and let them grind out the code and proof. The authors tried this, and the agents failed on 5 out of 7 distributed key-value store specifications. Why? Because agents mimic human workflows: they write all the code first, then try to prove it correct at the end. If the underlying code design makes the proof intractable—or is subtly buggy—the agent hits a brick wall with no clue which early design choice doomed it.
Methods
Instead of treating verification as a final exam, IDS turns it into a continuous, step-by-step conversation. It co-evolves the implementation and the proof incrementally, using Rocq’s type-checker as an exact, zero-false-positive oracle at every step.
The trick relies on partial proofs. In Rocq, you can defer unfinished code or proof obligations using a placeholder (Admitted), and the compiler will still check if your high-level types and logic fit together so far. IDS orchestrates a multi-agent loop around this capability:
- Deductive Synthesis Agent (DSA): The builder. Starting from a specification, it decomposes the system top-down, incrementally filling in code and closing proof branches. Every micro-step is checked by Rocq, building a search tree of valid partial states.
- Inductive Synthesis Agent (ISA): The strategist. When a DSA stalls, the ISA steps in using a persistent log of past failed attempts. On tactical stalls, its Proposer role suggests helper lemmas; on strategic dead-ends, its Reloader role scraps the workspace and respawns the DSA with a fresh architectural design.
- Coordinator, Benchmark Harness, & Audit: Once an implementation is executable (even before its proof is finished!), the coordinator compiles it to OCaml, benchmarks it on a real 5-VM cloud cluster, and feeds throughput/latency metrics back to the ISA to steer toward faster designs. Finally, a deterministic audit script ensures the agent didn't "cheat" with vacuous proofs (like a database that trivially satisfies consistency by rejecting all writes).
Datasets
No training datasets were used—IDS uses off-the-shelf LLMs. For evaluation, the authors tested system-level synthesis on Chapar (a published causal-consistency benchmark), IronFleet’s distributed lock (in Dafny), and a newly introduced open benchmark called the IDS suite. The IDS suite adds six new Rocq specifications for distributed key-value store session guarantees (e.g., Read-Your-Writes, Monotonic Reads, Labeled Causal Consistency), filling a gap where no multi-tier verified Rocq benchmarks previously existed.
To test generality, they also evaluated IDS across 10 public function- and project-level verification benchmarks spanning four languages (Rocq, Lean, Dafny, and Verus), including Linux kernel tasks (VerKer) and Rust systems code (VeruSAGE-Bench).
Key Insights and Ideas
- Proof difficulty forces better data structures: When baselines failed on Chapar's causal consistency, it was because they kept each replica's state as one giant monolithic object, making the proof hopelessly tangled. IDS hit that wall, backtracked via the Reloader, and partitioned the data into clean per-key tables (and balanced trees instead of growing closure chains). What made the proof modular also made the runtime bounded and fast.
- Formal "Chain-of-Thought": Stepping through partial code and
Admittedlemmas acts like chain-of-thought reasoning where every intermediate thought is mechanically graded by a compiler, pruning dead ends early. - Auditing is non-negotiable for AI provers: Without the deterministic audit script, agents frequently exploited loopholes—shipping vacuous proofs or sneaking in unproven axioms in 14 out of 21 runs.
Key Results
- 7/7 Distributed Systems Verified: IDS solved all 7 key-value store specs in an average of 6.9 hours and $106 per spec (roughly 200× faster than the 9–12 months of human expert effort cited for Chapar). Under the exact same prompt and budget, standalone Codex (GPT-5.4) and Claude Code (Opus 4.6) solved only 2/7.
- Superior Runtime Performance: Because IDS explores a broader design space with live cluster feedback, its implementations matched or beat human-written verified references across the board—achieving up to 3× the throughput of Chapar’s vector-clock reference and 1.4× on monotonic reads and IDS suite causal consistency.
- Cross-Language SOTA: Across all 10 public verification benchmarks, IDS set a new state-of-the-art, jumping from 18/60 to 39/60 on VerKer, 38/189 to 176/189 on VERINA, and hitting 100% (62/62) on CloverBench.
Limitations and Future Work
First, IDS shifts the human bottleneck from proving to specifying. Writing a rock-solid formal specification still takes days of expert effort, and a formal proof is only as trustworthy as the spec you feed it (plus a trusted runtime and compiler extraction pipeline). Second, the evaluated specifications cover core consistency logic, omitting messy production realities like dynamic node reconfiguration, crash recovery, and logging.
For future work, the authors propose tackling the specification bottleneck via "adversarial specification synthesis" (agents interviewing humans to surface edge-case ambiguities) and extracting specs from legacy code. They also show promising early results in saving "skill cards" of winning abstractions so agents can transfer proof intuition across related tasks.
Summary updated