DafnyProver: Agentic Verified Code Generation in Dafny
Benjamin BreenAustin LetsonBRBorja RequenaLSLeopoldo Sarra
Benjamin Breen
Austin Letson
BRBorja Requena
LSLeopoldo Sarra
+4
DafnyProver is a verifier-guided repair framework for agentic code generation in Dafny that iteratively generates implementations, invariants, assertions, and termination arguments. Evaluated on LCB-Pro-Dafny, a new benchmark of 250 competition-style problems with formal Dafny specifications, DafnyProver substantially improves verification success over baseline GPT-5.5. On DafnyBench, it achieves 92.7% verification success, 6 percentage points above the previous proof-hint baseline. The paper also highlights that verification success and runtime test performance measure distinct aspects of generated code.

OpenReview · May 26, 2026