arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.29088cs.SEcs.AI
收藏

WybeCoder:验证性 imperative 代码生成

WybeCoder: Verified Imperative Code Generation

CERMICS, ENPC, Institut Polytechnique de Paris, CNRS(CERMICS,ENPC,巴黎理工学院,CNRS);Computer Lab, University of Cambridge(剑桥大学计算机实验室);Korea Institute for Advanced Study(韩国高级研究院);FAIR, Meta(FAIR,Meta);University College London(伦敦大学学院)

Fabian Gloeckle, Mantas Baksys, Darius Feher, Kunhao Zheng, Amaury Hayat, Sean B. Holden, Gabriel Synnaeve, Peter O'Hearn

AI总结:

WybeCoder 提出了一种验证性 imperative 代码生成框架,通过证明与生成同步的方式,实现代码、不变式和证明的共同进化,提升了复杂算法的验证效率。

摘要:

近年来,大语言模型(LLMs)的进步显著推动了自动代码生成和形式化定理证明,但软件验证并未取得类似进展。为填补这一差距,我们提出了 WybeCoder,一种代理代码验证框架,支持在生成过程中进行证明,使代码、不变式和证明共同进化。WybeCoder 基于一个结合自动验证条件生成和 SMT 解决方案与交互式证明的框架。为了系统评估,我们将两个用于函数验证的 Lean 基准测试(Verina 和 Clever)转换为等效的 imperative 代码规范。在复杂算法如堆排序上,我们观察到随着方法扩展,性能有显著提升,能够合成数十个有效不变式并分发数十个子目标,最终生成数百行的验证代码,克服了之前报告的瓶颈。我们的最佳系统在中等计算预算下解决了 74% 的 Verina 任务和 62% 的 Clever 任务,明显超越了之前的评估,为自动构建大规模验证的 imperative 代码数据集铺平了道路。

英文摘要:

Recent progress in large language models (LLMs) has substantially advanced automatic code generation and formal theorem proving, yet software verification has not seen comparable gains. To address this gap, we propose WybeCoder, an agentic code verification framework that enables prove-as-you-generate development, in which code, invariants, and proofs co-evolve. WybeCoder builds on a recent framework that combines automatic verification condition generation and SMT solving with interactive proofs in Lean. To enable systematic evaluation, we translate two benchmarks for functional verification in Lean, Verina and Clever, into equivalent imperative code specifications. On complex algorithms such as Heapsort, we observe consistent performance improvements as we scale our approach, synthesizing dozens of valid invariants and dispatching dozens of subgoals, ultimately producing hundreds of lines of verified code and overcoming plateaus reported in previous work. Our best system solves 74% of Verina tasks and 62% of Clever tasks at moderate compute budgets, substantially surpassing previous evaluations and paving the way for the automated construction of large-scale datasets of verified imperative code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑