arXiv:2604.00280cs.SEcs.AI2026-04被引 2

用智能体循环验证生成更准确完整的软件规范

VeriAct: Beyond Verifiability -- Agentic Synthesis of Correct and Complete Formal Specifications

论文配图:VeriAct: Beyond Verifiability -- Agentic Synthesis of Correct and Complete Formal Specifications
图 1 · 摘自论文原文
  • 通过大模型规划、执行、验证与反馈闭环生成规范
  • 在两个数据集上验证率超基线,且正确率显著提升
  • 适合关注形式化验证与AI辅助开发的研究者

形式化规范对保障软件可靠性至关重要,但自动生成高质量规范仍具挑战性。现有工作利用大语言模型生成Java建模语言(JML)规范,虽有高验证通过率,但通过验证不等于真实正确或完整。本文对比经典与提示驱动方法,发现提示优化虽能提升通过率,但存在明显瓶颈。进一步提出Spec-Harness框架,采用符号验证检测出大量被验证器忽略的错误:规范在输入输出上过度或不足约束。为此提出VeriAct,一个基于验证反馈的智能体框架,通过大模型驱动的规划、执行、验证与反馈闭环,迭代合成与修复规范。实验表明,VeriAct在两个基准数据集上优于提示基与优化基线,生成的规范不仅可验证,且真正正确完整。

原文摘要 · Abstract (English)

Formal specifications play a central role in ensuring software reliability and correctness. However, automatically synthesizing high-quality formal specifications remains a challenging task, often requiring domain expertise. Recent work has applied large language models to generate specifications in Java Modeling Language (JML), reporting high verification pass rates. But does passing a verifier mean that the specification is actually correct and complete? In this work, we first conduct a comprehensive evaluation comparing classical and prompt-based approaches for automated JML specification synthesis. We then investigate whether prompt optimization can push synthesis quality further by evolving prompts through structured verification feedback. While optimization improves verifier pass rates, we find a clear performance ceiling. More critically, we propose Spec-Harness, an evaluation framework that measures specification correctness and completeness through symbolic verification, revealing that a large fraction of verifier-accepted specifications, including optimized ones, are in fact incorrect or incomplete, over- or under-constraining both inputs and outputs in ways invisible to the verifier. To push beyond this ceiling, we propose VeriAct, a verification-guided agentic framework that iteratively synthesizes and repairs specifications through a closed loop of LLM-driven planning, code execution, verification, and Spec-Harness feedback. Our experiments on two benchmark datasets show that VeriAct outperforms both prompt-based and prompt-optimized baselines, producing specifications that are not only verifiable but also correct and complete.

形式化验证智能体代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。