The Dafny verifier provides strong correctness guarantees but often requires numerous manual helper assertions, creating a significant barrier to adoption. We investigate the use of Large Language Models (LLMs) to automatically infer missing helper assertions in Dafny programs, with a primary focus on cases involving multiple missing assertions. To support this study, we extend the DafnyBench benchmark with curated datasets where one, two, or all assertions are removed, and we introduce a taxonomy of assertion types to analyze inference difficulty. Our approach refines fault localization through a hybrid method that combines LLM predictions with error-message heuristics. We implement this approach in a new tool called DAISY (Dafny Assertion Inference SYstem). While our focus is on multiple missing assertions, we also evaluate DAISY on single-assertion cases. DAISY verifies 63.4% of programs with one missing assertion and 31.7% with multiple missing assertions. Notably, many programs can be verified with fewer assertions than originally present, highlighting that proofs often admit multiple valid repair strategies and that recovering every original assertion is unnecessary. These results demonstrate that automated assertion inference can substantially reduce proof engineering effort and represent a step toward more scalable and accessible formal verification.


翻译:Dafny验证器虽能提供强大的正确性保证,但通常需要大量手动编写的辅助断言,这构成了其应用的重要障碍。本研究探索利用大型语言模型(LLMs)自动推断Dafny程序中缺失的辅助断言,重点关注涉及多个断言缺失的情况。为支持此项研究,我们扩展了DafnyBench基准测试集,构建了精心设计的数据集,其中分别移除一个、两个或全部断言,并引入断言类型分类法以分析推断难度。我们的方法通过结合LLM预测与错误消息启发式规则的混合策略,改进了故障定位机制。我们将该方法实现在名为DAISY(Dafny断言推断系统)的新工具中。在聚焦多断言缺失场景的同时,我们也评估了DAISY在单断言缺失案例上的表现。DAISY在单断言缺失程序中实现了63.4%的验证成功率,在多断言缺失程序中达到31.7%。值得注意的是,许多程序可以通过比原始版本更少的断言完成验证,这表明证明过程通常允许多种有效的修复策略,且无需完全恢复所有原始断言。这些结果证明,自动化断言推断能显著降低证明工程的工作量,是朝着更具可扩展性和易用性的形式化验证迈出的重要一步。

0
下载
关闭预览

相关内容

检索增强生成(RAG)与推理的协同作用:一项系统综述
专知会员服务
33+阅读 · 2025年4月27日
大规模语言模型的个性化:综述
专知会员服务
43+阅读 · 2024年11月4日
[ICML2024]消除偏差:微调基础模型以进行半监督学习
专知会员服务
18+阅读 · 2024年5月23日
【AAAI2024】使用大型语言模型的生成式多模态知识检索
专知会员服务
58+阅读 · 2024年1月19日
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
【NAACL2021】信息解缠正则化持续学习的文本分类
专知会员服务
22+阅读 · 2021年4月11日
[CVPR 2021] 序列到序列对比学习的文本识别
专知
10+阅读 · 2021年4月14日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
使用CNN生成图像先验实现场景的盲图像去模糊
统计学习与视觉计算组
10+阅读 · 2018年6月14日
读论文Discriminative Deep Metric Learning for Face and KV
统计学习与视觉计算组
12+阅读 · 2018年4月6日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
NLP自然语言处理(二)——基础文本分析
乐享数据DataScientists
12+阅读 · 2017年2月7日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Arxiv
18+阅读 · 2024年12月27日
Arxiv
175+阅读 · 2023年4月20日
A Survey of Large Language Models
Arxiv
499+阅读 · 2023年3月31日
Arxiv
83+阅读 · 2023年3月26日
VIP会员
相关资讯
[CVPR 2021] 序列到序列对比学习的文本识别
专知
10+阅读 · 2021年4月14日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
使用CNN生成图像先验实现场景的盲图像去模糊
统计学习与视觉计算组
10+阅读 · 2018年6月14日
读论文Discriminative Deep Metric Learning for Face and KV
统计学习与视觉计算组
12+阅读 · 2018年4月6日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
NLP自然语言处理(二)——基础文本分析
乐享数据DataScientists
12+阅读 · 2017年2月7日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
相关基金
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员