Zean open-sourced: translate Zig functions into Lean models and prove their behavior
The okcontract team has released Zean, an open-source toolkit under Apache 2.0 that translates supported Zig functions into executable Lean models and verifies their behavior. It grew out of formal verification work on oksolc, their Solidity compiler written in Zig. Zean captures functions from Zig's analyzed intermediate representation (AIR) and emits Lean definitions, while contracts, loop invariants, and proofs are written in separate handwritten Lean modules. A verification library derives proof obligations covering memory access, initialization, permissions, arithmetic, control flow, and calls, and unsupported operations are rejected while unresolved obligations remain open. The release supports restricted AIR fragments and includes memory-safety examples, copy loops, and a captured specialization of std.mem.replaceScalar. The proofs do not cover the capture pipeline, Zig frontend, or native backend, so they do not establish the correctness of the final binary or the whole compiler.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in