TL;DR
Writing bug-free distributed systems is notoriously difficult, and even state-of-the-art AI coding agents fail to generate formally verified code because they treat verification as an afterthought. This paper introduces Inductive Deductive Synthesis (IDS), an agentic framework that jointly and incrementally constructs code and mathematical proofs side-by-side. By leveraging continuous feedback from a proof assistant and performance benchmarks, IDS autonomously generates verified distributed systems 200× faster than human experts while delivering up to 3× the performance.
What Problem Does This Paper Address?
Distributed systems (like databases and file systems) are backbone infrastructure, but they are incredibly prone to subtle bugs. Because concurrent messages, network partitions, and node failures can interleave in a combinatorially massive number of ways, traditional software testing cannot guarantee full coverage.
Formal verification solves this by using mathematical proofs to guarantee that a system behaves correctly under every possible scenario. However, writing these machine-checkable proofs typically requires months or years of grueling manual labor by human experts.
When we task modern AI coding agents with this challenge, they almost always fail. The authors observe a fundamental structural flaw in how current agents operate: they write the entire implementation first and treat verification as a downstream check. This approach forces the AI to generate massive, complex proofs all at once without any intermediate feedback, leading to dead ends.
Methods
IDS re-engineers the synthesis process by advancing code and proof jointly and incrementally. Instead of writing a complete program, the system breaks the problem down step-by-step, using the Rocq (formerly Coq) proof assistant as an absolute oracle of correctness.
The framework orchestrates a multi-agent architecture coordinated by a central system:
- Deductive Synthesis Agent (DSA): This agent handles the step-by-step implementation. When it makes a design decision (e.g., defining a data structure), it pairs it with a corresponding partial proof, leaving unfinished sub-goals stubbed out with placeholders (
Admitted). - Inductive Synthesis Agent (ISA): If the DSA gets stuck or stalls, the ISA steps in with two distinct roles:
- Proposer (Tactical): Analyzes local proof failures and suggests specific helper lemmas or structural decompositions.
- Reloader (Strategic): Recognizes when a high-level design is a dead end, abandons the workspace, and respawns the DSA with an entirely fresh architectural strategy.
- Continuous Feedback Loops: The system doesn't just check for correctness; it compiles valid partial code and runs it in a distributed benchmark harness. If a design is correct but slow, the performance metrics steer the ISA toward faster implementation alternatives.
- Audit Step: A deterministic safety gate that ensures the AI hasn't "cheated" by generating vacuous proofs (e.g., creating a guard condition that unconditionally returns
falseto satisfy a theorem trivially).
Datasets
The authors evaluated IDS on two main categories of benchmarks:
- The IDS Suite (Distributed Key-Value Stores): A newly introduced benchmark dataset consisting of six new formal Rocq specifications co-developed with a distributed systems expert, alongside Chapar’s classic causal-consistency specification. These cover various session consistency models (Read-Your-Writes, Monotonic Reads, Monotonic Writes, Labeled Causal Consistency, etc.).
- General Verification Benchmarks: To test its capabilities as a general-purpose theorem prover, the authors ran the DSA component against public cross-language verification datasets including DafnyBench, miniCodeProps, Verus-Bench, CoqStoq, VERINA, AlgoVeri, and CloverBench.
Key Insights and Ideas
- The Power of the Partial-Proof Oracle: By allowing the proof assistant to grade incomplete code containing placeholders, the AI receives immediate localization signals. If a proof fails, the agent knows exactly which line of code caused the issue before wasting compute on a broken architecture.
- Proof-Driven Data Structure Selection: Human developers often default to abstract representations (like unbounded closure chains) that are intuitive to write but nightmare-inducing to formally verify and slow to execute. IDS discovered that breaking global states into per-key tables or balanced trees made the mathematical proofs split into simpler, independent cases, which naturally resulted in massive runtime performance gains.
Key Results
IDS achieved definitive state-of-the-art results across all evaluations:
- 100% Success Rate: IDS successfully generated fully verified implementations for 7 out of 7 distributed key-value store specifications. In contrast, standard state-of-the-art LLM agents only managed to solve 2 out of 7.
- Radical Speedup and Cost Efficiency: On average, IDS completed a verified specification in 6.8 hours at a cost of $106, making it roughly 200× faster than human expert effort and 17% cheaper than vanilla LLM baselines.
- Super-Human Performance: Because the performance-feedback loop allowed IDS to search a broader design space than human proof-writers typically dare to explore, the AI-generated systems achieved up to 3× the throughput of previously published expert-written verified systems.
- General Prover SOTA: When decoupled from the distributed systems loop and applied to general code-and-proof benchmarks, IDS beat existing agentic baselines by margins ranging from +10% to +51%, achieving perfect scores on miniCodeProps (100/100) and CloverBench (62/62).
Limitations and Future Work
Despite its success, IDS currently faces a few notable limitations:
- The Specification Bottleneck: The system requires a highly precise, human-written formal specification as an input. Writing these specifications remains incredibly difficult and requires deep domain expertise.
- Simplified Operational Scope: The evaluated key-value stores focus strictly on core consistency properties. They do not yet implement full production envelopes like dynamic node reconfigurations (scaling out), fault recovery protocols, or logging endpoints.
To address the specification bottleneck, the authors point toward promising future work in adversarial specification synthesis (where an LLM collaborates with a human to extract formal specs from natural language) and specification extraction from pre-existing legacy codebases.
Summary updated