AxDafny: Agentic Verified Code Generation in Dafny
The paper introduces AxDafny, a verifier-guided repair framework that improves verification success in Dafny by generating implementations, invariants, assertions, and termination arguments.
Introduces AxDafny, a verifier-guided repair framework for Dafny that improves verification success over baseline GPT-5.5 performance.
Before reading this…
Applications
- →Formal verification of programming problems
To understand this paper, make sure you know these concepts first:
- Familiarity with programming languages and formal verificationfind papers →
Abstract
More Like ThisWe study agentic code generation in Dafny, where a model must generate both executable code and the proof artifacts for verification. We present AxDafny, a verifier-guided repair framework that iteratively generates implementations, invariants, assertions, and termination arguments. We also introduce LiveCodeBench-Pro-Dafny (LCB-Pro-Dafny), a benchmark of 250 competition-style programming problems translated into Dafny with formal specifications and a verifier-based evaluation harness. On LCB-Pro-Dafny, AxDafny substantially improves verification success over baseline GPT-5.5 performance. On DafnyBench, AxDafny achieves 92.7\% verification success, outperforming the strongest previously reported proof-hint baseline by 6.5 percentage points. Lastly, we show that verification success and runtime test performance measure different aspects of generated code.