跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 程序设计语言

arXiv:2602.04892 (cs)
[提交于 2026年1月30日 (v1),最后修订于 2026年10月7日 (此版本, v2)]

标题:Doc2Spec: Synthesizing Formal Programming Specifications from Natural Language via Grammar Induction

作者:Shihao Xia, Mengting He, Haomin Jia, Xinyan Zhao, Linhai Song
查看论文《Doc2Spec: Synthesizing Formal Programming Specifications from Natural Language via Grammar Induction》的 PDF
查看中文 PDF 查看原文 PDF EasyResearch 阅读
摘要: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 automatically induces a domain-specific grammar from natural-language API rules and uses it to guide specification generation. Doc2Spec fixes a domain-agnostic logical skeleton as a grammar template, prompts LLMs to infer domain-specific predicates and sorts, and formalizes each rule within the resulting grammar, turning an unreliable one-shot translation into a sequence of constrained, checkable steps. Across six benchmarks spanning Solidity and Rust, Doc2Spec improves precision by 0.28 and recall by 0.37 over baselines that lack grammar induction or perform it in one unstaged step, demonstrating the benefits of grammar-guided formalization and the staged pipeline. Moreover, its formalized rules enable symbolic-execution tools to uncover 142 previously unknown rule violations, confirming the rules' correctness and practical usefulness.
主题: 程序设计语言 (cs.PL); 人工智能 (cs.AI); 软件工程 (cs.SE)
引用方式: arXiv:2602.04892 [cs.PL]
  (或者 arXiv:2602.04892v2 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2602.04892

提交历史

来自:Shihao Xia
[v1] 2026年1月30日 星期五 02:58:27 UTC (1,707 KB)
[v2] 2026年10月7日 星期三 04:58:22 UTC (2,960 KB)
全文链接:

访问论文:

  • 查看中文 PDF
  • 查看原文 PDF
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.PL
< 上一篇   |   下一篇 >
最新 | 近期 | 2026-10
切换浏览方式为:
cs
cs.AI
cs.SE

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站