[论文解读] Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languages
本文提出符号化验证作为自动化度量方法,用于评估Dafny和F*等验证感知语言中用户意图形式化的质量。通过使用符号执行对隐藏测试用例进行形式化规格的测试,该方法在MBPP-DFY基准上与人工标注标签表现出高度一致,证明了其在规格生成基准测试中的可行性。该方法克服了先前基于大语言模型的代码变异技术在静态验证环境中的局限性。
Verification-aware programming languages such as Dafny and F* provide means to formally specify and prove properties of a program. Although the problem of checking an implementation against a specification can be defined mechanically, there is no algorithmic way of ensuring the correctness of the {\it user-intent formalization for programs}, expressed as a formal specification. This is because intent or requirement is expressed {\it informally} in natural language and the specification is a formal artefact. Despite, the advent of large language models (LLMs) has made tremendous strides bridging the gap between informal intent and formal program implementations recently, driven in large parts by benchmarks and automated metrics for evaluation. Recent work has proposed a framework for evaluating the {\it user-intent formalization} problem for mainstream programming languages~\cite{endres-fse24}. However, such an approach does not readily extend to verification-aware languages that support rich specifications (using quantifiers and ghost variables) that cannot be evaluated through dynamic execution. Previous work also required generating program mutants using LLMs to create the benchmark. We advocate an alternate, perhaps simpler approach of {\it symbolically testing specifications} to provide an intuitive metric for evaluating the quality of specifications for verification-aware languages. We demonstrate that our automated metric agrees closely on a human-labeled dataset of Dafny specifications for the popular MBPP code-generation benchmark, yet demonstrates cases where the human labeling is not perfect. We also outline formal verification challenges that need to be addressed to apply the technique more widely. We believe our work provides a stepping stone to enable the establishment of a benchmark and research agenda for the problem of user-intent formalization for programs.
研究动机与目标
- 为解决验证感知语言(如Dafny和F*)中用户意图形式化缺乏自动化评估度量的问题。
- 克服基于代码变异和动态测试的先前基准的局限性,这些方法不适用于具有丰富静态规格的语言。
- 建立一个可扩展的自动化基准测试框架,用于评估从非形式化自然语言意图生成的形式化规格。
- 通过提供一个基于符号化验证的可靠、形式化的度量标准,为未来在规格生成领域的研究提供支持。
提出的方法
- 使用符号执行将形式化规格与一组隐藏的验证测试用例进行对比,将验证视为一种符号化测试形式。
- 将验证过程作为自动化度量,用于评估规格的正确性和完备性,类似于代码生成中的基于测试的评估方法。
- 利用MBPP-DFY基准中已有的测试套件,在无需动态执行的情况下评估Dafny规格。
- 通过将度量结果与人工标注的Dafny规格数据集进行对比,验证该度量的有效性,显示出高度一致性。
- 识别并解决符号化验证中的挑战,如量词实例化和幽灵变量管理问题。
- 提出一个原型实现,以证明该方法在各类验证感知语言构造上的可行性与可扩展性。
实验结果
研究问题
- RQ1符号化验证能否作为评估验证感知语言中从非形式化用户意图生成的形式化规格质量的可靠、自动化度量?
- RQ2所提出的符号化验证度量在真实世界基准上与人工标注的规格质量标签之间的对齐程度如何?
- RQ3为何先前基于大语言模型的代码变异和基于测试的评估技术无法推广到具有丰富规格逻辑的验证感知语言?
- RQ4在扩展符号化验证用于规格评估时,其关键挑战是什么,特别是关于量词实例化和幽灵状态管理方面?
- RQ5该方法能否成为形式化验证中用户意图形式化标准化基准的基础?
主要发现
- 符号化验证度量在MBPP-DFY数据集上与人工标注标签表现出高度一致性,表明其在规格评估中具有高度可靠性。
- 该方法在不依赖动态执行或代码变异的情况下,成功评估了规格的正确性和完备性。
- 该方法识别出人工标注中存在不一致的情况,表明符号化验证能够检测出人工标注规格中的模糊性。
- 量词实例化和幽灵变量管理被识别为关键挑战,需进一步自动化以实现方法的可扩展性。
- 该框架证明了可构建验证感知语言中规格生成标准化基准的可行性。
- 结果表明,符号化验证可作为基于测试的度量在规格评估中的可扩展、形式化的替代方案。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。