Ensuring that API implementations and usage comply with natural language programming rules is critical for software correctness, security, and reliability. Formal verification can provide strong guarantees but requires precise specifications, which are difficult and costly to write manually. To address this challenge, we present Doc2Spec, a multi-agent framework that uses LLMs to automatically induce a specification grammar from natural-language rules and then generates formal specifications guided by the induced grammar. The grammar captures essential domain knowledge, constrains the specification space, and enforces consistent representations, thereby improving the reliability and quality of generated specifications. Evaluated on seven benchmarks across three programming languages, Doc2Spec outperforms a baseline without grammar induction and achieves competitive results against a technique with a manually crafted grammar, demonstrating the effectiveness of automated grammar induction for formalizing natural-language rules.


翻译:确保API实现与使用符合自然语言编程规则对软件正确性、安全性和可靠性至关重要。形式化验证虽能提供强有力保证,但需要精确的规范描述,而人工编写此类规范难度大、成本高。为应对这一挑战,我们提出Doc2Spec——一个基于大语言模型的多智能体框架,该框架通过语法归纳技术从自然语言规则中自动推导出规范语法,并依据推导出的语法生成形式化规范。该语法能够捕捉核心领域知识、约束规范空间并确保表示一致性,从而提升生成规范的可靠性与质量。在涵盖三种编程语言的七个基准测试中,Doc2Spec在无语法归纳的基线方法上表现更优,并与采用人工构建语法的技术取得相当的结果,这证明了自动化语法归纳在自然语言规则形式化方面的有效性。

0
下载
关闭预览

相关内容

《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
37+阅读 · 2025年7月14日
【博士论文】基于知识的自然语言理解与生成,230页pdf
专知会员服务
41+阅读 · 2024年4月1日
【ICML2023】基于自然语言指令的受控文本生成
专知会员服务
29+阅读 · 2023年4月28日
自然语言生成资源列表
专知
17+阅读 · 2020年1月4日
最新论文解读 | 基于预训练自然语言生成的文本摘要方法
微软研究院AI头条
57+阅读 · 2019年3月19日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
NLP中自动生产文摘(auto text summarization)
机器学习研究会
14+阅读 · 2017年10月10日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
VIP会员
相关VIP内容
《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
37+阅读 · 2025年7月14日
【博士论文】基于知识的自然语言理解与生成,230页pdf
专知会员服务
41+阅读 · 2024年4月1日
【ICML2023】基于自然语言指令的受控文本生成
专知会员服务
29+阅读 · 2023年4月28日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员