# LLM-Assisted Verification in Dafny

arXiv: https://arxiv.org/abs/2611.16886 · HTML: https://mlsanity.com/paper/2611.16886/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 16 of its 59 references that are in the map.
- Submitted 12 Nov 2026.

## Builds on (most cited first, 16 of 16)

- [SpecGen: Automated Generation of Formal Program Specifications via Large Language Models](https://mlsanity.com/paper/2401.08807/) (2024)
- [A benchmark for vericoding: formally verified program synthesis](https://mlsanity.com/paper/2509.22908/) (2025)
- [Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference](https://mlsanity.com/paper/2503.04779/) (2025)
- [DafnyPro: LLM-Assisted Automated Verification for Dafny Programs](https://mlsanity.com/paper/2601.05385/) (2026)
- [dafny-annotator: AI-Assisted Verification of Dafny Programs](https://mlsanity.com/paper/2411.15143/) (2024)
- [Leveraging Large Language Models to Boost Dafny's Developers Productivity](https://mlsanity.com/paper/2401.00963/) (2024)
- [ATLAS: Automated Toolkit for Large-Scale Verified Code Synthesis](https://mlsanity.com/paper/2512.10173/) (2025)
- [Specification-Guided Repair of Arithmetic Errors in Dafny Programs using LLMs](https://mlsanity.com/paper/2507.03659/) (2025)
- [Automatic Generation of Formal Specification and Verification Annotations Using LLMs and Test Oracles](https://mlsanity.com/paper/2601.12845/) (2026)
- [Case studies of development of verified programs with Dafny for accessibility assessment](https://mlsanity.com/paper/2301.03224/) (2023)
- [MINIF2F-DAFNY: LLM-Guided Mathematical Theorem Proving via Auto-Active Verification](https://mlsanity.com/paper/2512.10187/) (2025)
- [What Challenges Do Developers Face When Using Verification-Aware Programming Languages?](https://mlsanity.com/paper/2506.23696/) (2025)
- [Correct and Efficient Antichain Algorithms for Refinement Checking](https://mlsanity.com/paper/1902.09880/) (2019)
- [A simpler O(m log n) algorithm for branching bisimilarity on labelled transition systems](https://mlsanity.com/paper/1909.10824/) (2019)
- [Incremental Proof Development in Dafny with Module-Based Induction](https://mlsanity.com/paper/2401.16233/) (2024)
- [A Formal Correctness Proof of Edmonds' Blossom Shrinking Algorithm](https://mlsanity.com/paper/2412.20878/) (2024)

## Abstract (arXiv)

Formal verification of complex algorithms requires expertise in program specification, invariant construction, mathematical proof, and the management of automated theorem provers. Although large language models (LLMs) can generate program code and proof fragments, reliably developing complete machine-checked verifications remains challenging: it requires an iterative process of constructing and validating specifications and invariants, building proofs, diagnosing solver failures, and optimizing verification performance. This paper presents a systematic ten-step workflow for LLM-assisted verification of scientific algorithms using the Dafny verification system. The workflow integrates algorithm formalization, contract development, empirical invariant validation, proof construction, bottleneck profiling, and resource-driven proof optimization. We applied the workflow using Antrhopic's Claude Opus 5 and Opus 5.5 models, combining LLM-driven development with automated testing and verification feedback, while retaining human oversight for correctness-critical decisions and strategic interventions. We evaluate the approach on 37 complex algorithms from graph theory and labelled transition systems. Notably, we verified the Hopfcroft-Tarjan triconnectivity test, demonstrating that even highly challenging algorithmic verification tasks can be carried out through a structured LLM-assisted workflow. Many of our machine-checked verifications were obtained within hours to a few days of interactive development. Our results suggest that LLM-assisted workflows can shift the role of the human verifier from detailed proof construction toward supervision, specification review, and strategic guidance.
