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
下载
关闭预览

相关内容

[ICML2024]消除偏差:微调基础模型以进行半监督学习
专知会员服务
17+阅读 · 2024年5月23日
[CVPR 2021] 序列到序列对比学习的文本识别
专知
10+阅读 · 2021年4月14日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
读论文Discriminative Deep Metric Learning for Face and KV
统计学习与视觉计算组
12+阅读 · 2018年4月6日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
VIP会员
相关资讯
[CVPR 2021] 序列到序列对比学习的文本识别
专知
10+阅读 · 2021年4月14日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
读论文Discriminative Deep Metric Learning for Face and KV
统计学习与视觉计算组
12+阅读 · 2018年4月6日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员