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

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

计算机科学 > 计算机科学中的逻辑

arXiv:2508.00419 (cs)
[提交于 2025年8月1日]

标题:Loop Invariant Generation: A Hybrid Framework of Reasoning optimised LLMs and SMT Solvers

作者:Varun Bharti, Shashwat Jha, Dhruv Kumar, Pankaj Jalote
查看论文《Loop Invariant Generation: A Hybrid Framework of Reasoning optimised LLMs and SMT Solvers》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Loop invariants are essential for proving the correctness of programs with loops. Developing loop invariants is challenging, and fully automatic synthesis cannot be guaranteed for arbitrary programs. Some approaches have been proposed to synthesize loop invariants using symbolic techniques and more recently using neural approaches. These approaches are able to correctly synthesize loop invariants only for subsets of standard benchmarks. In this work, we investigate whether modern, reasoning-optimized large language models can do better. We integrate OpenAI's O1, O1-mini, and O3-mini into a tightly coupled generate-and-check pipeline with the Z3 SMT solver, using solver counterexamples to iteratively guide invariant refinement. We use Code2Inv benchmark, which provides C programs along with their formal preconditions and postconditions. On this benchmark of 133 tasks, our framework achieves 100% coverage (133 out of 133), outperforming the previous best of 107 out of 133, while requiring only 1-2 model proposals per instance and 14-55 seconds of wall-clock time. These results demonstrate that LLMs possess latent logical reasoning capabilities which can help automate loop invariant synthesis. While our experiments target C-specific programs, this approach should be generalizable to other imperative languages.
评论: Under Review
主题: 计算机科学中的逻辑 (cs.LO); 机器学习 (cs.LG); 程序设计语言 (cs.PL)
引用方式: arXiv:2508.00419 [cs.LO]
  (或者 arXiv:2508.00419v1 [cs.LO] 对于此版本)
  https://doi.org/10.48550/arXiv.2508.00419

提交历史

来自:Varun Bharti
[v1] 2025年8月1日 星期五 08:15:15 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.LO
< 上一篇   |   下一篇 >
最新 | 近期 | 2025-08
切换浏览方式为:
cs
cs.LG
cs.PL

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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