跳到正文
Boris Cherny· @bcherny · X·· 2 小时前AI 评分55
AI 导读

Boris Cherny 转发一则实践:有人用 Opus 5.5 配合 Lean 对 Claude Agent SDK 做形式化验证,几条简短提示词换来 16 个 PR,修复了各类 bug 和竞态条件。作者称 TLA+ 同样适用,有时会把 Lean 和 TLA+ 结合,排查数据流、并发和状态管理方面的问题;他本人并不熟悉这两种语言,但 Claude 表现很好,这种方法适合对代码做形式化建模,找出人不易察觉的 bug。

正文
引用Boris Cherny@bcherny
I used Opus 5.5 to formally verify the Claude Agent SDK using Lean. A couple short prompts = 16 PRs fixing various bugs and race conditions. Video attached. TLA+ also works well. I sometimes combine Lean and TLA+ to look for issues around data flow, concurrency, and state mgmt. I don't know either language well, but Claude is excellent at both. This approach is super useful for formally modeling your code and finding bugs that a human probably wouldn't have spotted. Is formal verification the future of coding (or at least, bug finding)?
在 X 查看被引用的帖子

来源:Boris Cherny · x.com