David Andrews和Chao Zhang利用Opus 5.5等AI智能体,将CPython源代码逐行重写为Lean证明语言代码,该项目于2026年10月29日启动 1。这一工作旨在通过精确的数学定义揭示代码行为与文档或直觉不符的隐蔽错误,展示了AI在大规模软件形式化验证中的潜力 1。
此次形式化建模共生成分布在1,540个文件中的614,384行Lean代码,包含18,926个定理和引理,且所有构建均通过了Lean证明检查器的验证 1。在独立审查方面,已有4,067个函数(占需检查函数总数的14.3%)通过了由另一个AI代理进行的审查 1。验证过程发现了415个bug报告,其中约55个严重bug可通过普通Python代码导致解释器崩溃或内存损坏 1。例如,针对特定bug提供了复现脚本,显示调用vars(b).setdefault(Key.NAME, "anon")会导致Segmentation fault 1。相关参考项目包括julia-in-lean和NVIDIA PTX的形式化工作 1。
David Andrews and Chao Zhang utilized Opus 5.5 AI agents to systematically rewrite the CPython source code into the Lean proof language, a process that began on October 29, 2026 1. The project generated over 614,384 lines of Lean code spread across 1,540 files, including 18,926 theorems and lemmas that have all been verified by the Lean proof checker 1. This effort aims to reveal hidden errors where actual code behavior diverges from documentation or intuition through precise mathematical definitions 1.
The formalization process identified 415 bug reports, with approximately 55 classified as severe issues capable of causing interpreter crashes or memory corruption when triggered by standard Python code 1. For instance, one specific bug involving a call to vars(b).setdefault(Key.NAME, "anon") resulted in a segmentation fault 1. As part of the verification workflow, 4,067 functions—representing 14.3% of the total functions requiring inspection—have passed independent review conducted by another AI agent 1. Related efforts in software formalization include projects such as julia-in-lean and the formalization of NVIDIA PTX 1.
评论
还没有评论,欢迎留下第一条。