Learn

Proved correct

Who checks the compiler?

A compiler bug: your code is right, the program is wrong. Tests catch the cases someone thought of.

blaze aims for a formally verified compiler: each step proved, by a machine, to keep your program's meaning.

One definition of meaning

blaze writes down what MIR (Rust's mid-level form) means once, as a program in Lean. You can run it.

Passes, proved

Folding constants, removing dead code, merging jumps: each pass is proved in Lean to keep the meaning, for every program.

Or check each run

Where a proof is too hard, a proved checker compares the code before and after each run of the pass.

Check: which is which?

A pass is checked by translation validation. What does Lean prove?

  1. That the pass is right for every possible program.That is what a proved pass gets. With translation validation, each run is checked instead.
  2. That the checker is right: when it accepts, before and after mean the same.Right. The checker is proved once, and then every run of the pass is checked by it.
  3. That the pass passes rustc's tests.Tests are useful, but a proof covers what no one wrote a test for.
Show the answer

That the checker is right: when it accepts, before and after mean the same. Right. The checker is proved once, and then every run of the pass is checked by it.

What is still trusted

Only Lean's three standard axioms, and a public list of what isn't proved yet: unsafe code, atomics, the code after MIR. More: formal-verification.md.