Inductive Deductive Synthesis: Co-Evolving Code-and-Proof Generation

Shubham Agarwal, Alexander Krentsel, Shu Liu, Mert Cemri, Audrey Cheng, Rui Meng, Tomas Pfister, Chun-Liang Li, Sylvia Ratnasamy, Aditya Parameswaran, Matei Zaharia, Ion Stoica, Mohsen LesaniNeurIPS 2026

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.

Figure 1: Code and proof advance jointly and incrementally with IDS; the proof assistant grades each partial 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).
IDS Agentic Architecture

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 Admitted lemmas 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.
Table 1: IDS succeeds on all seven specifications (≥2/3 runs) versus only 2 of 7 each for Codex and Claude Code, while using less total wall-clock and fewer total dollars; on every spec where any method succeeds, IDS is also faster and cheaper. pass rate = # successes out of 3 (green: ≥2/3; red: < 2/3); hours = median wall-clock until a successful run (Rocq Qed accepted, audit step passed, extracted OCaml runs on the harness); cost = median dollars per run. All methods share the same model, verifier, pass criterion, and per-spec budget; relative std across runs is ≤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

Abstract

AI agents increasingly excel at generating, testing, and refining code. However, they fall short on tasks requiring formal guarantees of full coverage that testing alone cannot provide. Distributed systems are a prime example: properties such as consistency between reads and writes must hold under every possible interleaving of events. Mechanized formal verification can guarantee such correctness, but typically demands months to years of expert effort. As evidence, even SOTA coding agents (Codex with GPT-5.4 and Claude Code with Opus 4.6) succeed on only 2/7 distributed key-value-store specifications. In this paper, we present the first effective approach to addressing this gap, Inductive Deductive Synthesis (IDS), which incrementally co-evolves implementation and proof, and learns from failed attempts to systematically try promising strategies. Built as an agentic LLM system, IDS achieves 7/7 in about 6.9 hours and $106 per spec on average, roughly 200× faster than expert effort and 17% cheaper than SOTA agents. IDS further incorporates performance feedback into the same loop, yielding implementations up to 3× faster than published verified systems.
BibTeX
@inproceedings{agarwal2026inductive,
  author = {Shubham Agarwal and Alexander Krentsel and Shu Liu and Mert Cemri and Audrey Cheng and Rui Meng and Tomas Pfister and Chun-Liang Li and Sylvia Ratnasamy and Aditya Parameswaran and Matei Zaharia and Ion Stoica and Mohsen Lesani},
  title = {{Inductive Deductive Synthesis: Co-Evolving Code-and-Proof Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=jp8UqwXlAw},
}
Figure