DafnyPro: LLM-Assisted Automated Verification for Dafny Programs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Banerjee, Debangshu, Bouissou, Olivier, Zetzsche, Stefan
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915718176440320
author Banerjee, Debangshu
Bouissou, Olivier
Zetzsche, Stefan
author_facet Banerjee, Debangshu
Bouissou, Olivier
Zetzsche, Stefan
contents We present DafnyPro, an inference-time framework that enhances LLMs for generating verification annotations in Dafny. DafnyPro comprises three key components: a diff-checker that prevents modifications to base program logic, a pruner that removes unnecessary invariants, and a hint-augmentation system that retrieves and applies predefined, problem-independent proof strategies. We evaluate DafnyPro using Claude Sonnet 3.5 and 3.7 on four benchmarks: Clover, MBPP-Dafny, HumanEval-Dafny, and DafnyBench, achieving consistent performance gains in all cases. Notably, on DafnyBench, the most challenging benchmark, Claude Sonnet 3.5 enhanced with DafnyPro achieves 86% correct proofs, a 16 pp improvement over the base model. We also fine-tune two Qwen models on training data derived from verification attempts by larger models enhanced with DafnyPro. Our 7B and 14B models achieve 68% and 70% correct proofs on DafnyBench, respectively, demonstrating that smaller models can maintain high verification accuracy.
format Preprint
id arxiv_https___arxiv_org_abs_2601_05385
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle DafnyPro: LLM-Assisted Automated Verification for Dafny Programs
Banerjee, Debangshu
Bouissou, Olivier
Zetzsche, Stefan
Software Engineering
We present DafnyPro, an inference-time framework that enhances LLMs for generating verification annotations in Dafny. DafnyPro comprises three key components: a diff-checker that prevents modifications to base program logic, a pruner that removes unnecessary invariants, and a hint-augmentation system that retrieves and applies predefined, problem-independent proof strategies. We evaluate DafnyPro using Claude Sonnet 3.5 and 3.7 on four benchmarks: Clover, MBPP-Dafny, HumanEval-Dafny, and DafnyBench, achieving consistent performance gains in all cases. Notably, on DafnyBench, the most challenging benchmark, Claude Sonnet 3.5 enhanced with DafnyPro achieves 86% correct proofs, a 16 pp improvement over the base model. We also fine-tune two Qwen models on training data derived from verification attempts by larger models enhanced with DafnyPro. Our 7B and 14B models achieve 68% and 70% correct proofs on DafnyBench, respectively, demonstrating that smaller models can maintain high verification accuracy.
title DafnyPro: LLM-Assisted Automated Verification for Dafny Programs
topic Software Engineering
url https://arxiv.org/abs/2601.05385