Aristotle 正式支持 Rust 形式化验证
推荐指数 68.0 NO. 016 · 2026.11.17
发布2026/11/16Score102Comments50
简介
形式化验证工具 Aristotle 新增 Rust 语言支持,可数学证明代码无未定义行为且符合规约,覆盖 unsafe 块。对用 Rust 重写 C 代码的团队,能直接验证新旧代码行为等价,填补关键系统迁移时的信任缺口。
编辑判断
形式化验证工具长期卡在两个瓶颈:一是只覆盖 C/Verilog 等老旧语言,二是验证成本极高导致仅用于航天、核工业等极窄场景。Aristotle 支持 Rust 的意义在于切入了一个正在大规模替代 C 的新兴生态,而且 Rust 的所有权系统本身降低了验证复杂度。
目前 Rust 形式化验证的竞品主要是 Kani(AWS 开源)和 Prusti,但 Kani 聚焦内存安全而非全行为等价,Prusti 已停止维护。Aristotle 如果能证明 C 和 Rust 代码的行为等价,对正在做 Linux 内核、数据库等关键基础设施迁移的团队有直接价值。
建议在用 Rust 重写 C 代码的团队关注,特别是需要向客户或审计方证明迁移安全性的场景,这比写大量回归测试更具说服力。
社区反馈
意见分歧 45 条评论
核心争论:形式化验证价值获认可,但Rust语言边界与GC未来引发激烈争论
> Aristotle can prove that your code has no undefined behavior ... even inside unsafe blocks. That's crazy, I haven't seen any other system that really tries to do that.
Some others in the Rust ecosystem, not a complete list: - cargo-anneal - VeriFast - RefinedRust - safety-tags - Verus These 5 use very different mechanisms. This is still a very active research area.
Most people using rust unsafe should likely be using https://github.com/google/rust-skills/blob/main/unsafe_rust_...