Safety logic
2oo3 voting logic and a latching trip that stays true once triggered.
REQ-SF-001 · 002The voter reference project takes nine safety functions — voting, latching, slew limiting, trip monitoring, interlocks and a flow gauge with a floating-point boundary — through all thirteen gates, and replays every one on an emulated Cortex-M4F.

examples/voter is a complete djsafe project: a requirements file, the Lean specifications it points at, and a target section naming thumbv7em-none-eabihf on the netduinoplus2 QEMU machine. It is the project an external assessor is handed together with one evidence bundle.
Each requirement says, in plain text, what the function shall do — “The voter output shall be true if and only if at least two of the three input channels are true” — and its whitespace-normalised text is hash-pinned in the evidence, so a change of wording is a change the build can see.
2oo3 voting logic and a latching trip that stays true once triggered.
REQ-SF-001 · 002A slew limiter clamped to ±100 per step within [−1000, 1000], a two-state trip monitor with hysteresis, and a Q4 gain block.
REQ-SF-010 · 011 · 012Averages, ratios, square roots, vector magnitudes and modulo counters, including wide i64 arithmetic — certified panic-free.
REQ-SF-013 · 014A pressure interlock that trips on enable at ≥ 3000 and clears on reset below 2500, with latched worst-case pressure and a safety margin.
REQ-SF-015A flow gauge whose sensor value enters as an IEEE-754 f32 through a certified integer-only conversion to Q4, and whose margin leaves as an exactly converted f32 — fixed-point core unchanged.
REQ-SF-016The requirements parse with unique IDs; the whole Lean package — specs, semantics library, every theorem — elaborates and kernel-checks.
Every Lean-derived artifact is regenerated from the just-checked modules, and a function that is not well-formed is refused at export.
The IR, the spec sources and the semantics library are hashed by Lean and by Rust, and the two must agree.
Every requirement is satisfied by some function, and every function cites only known requirements.
“9 functions AST-identical across sgen-a and sgen-b”, then byte-canonical across both.
Per function, five theorems about the artifact as parsed back from the shipped bytes, checked by the Lean kernel.
Lean reference vectors against the compiled code on the host, then per function on the emulated target, each ELF hashed.
Certificates, trace matrix, back-to-back manifest and on-target transcript assembled into one bundle.
The evidence guide gives an assessor five procedures that do not depend on the pipeline’s own report, each executed as written. For flow_gauge: a third SHA-256 of the spec source matches both recorded hashes and the certificate header; the certificate re-runs through the kernel with exit 0 and depends only on propext and Quot.sound; and the hand-replayed ELF prints “B2BT flow_gauge cases=406 failed=0 float_cases=78” with a hash equal to the one in the evidence.
The guide is as explicit about limits: requirements validity stays a human review, no claim concerns timing or stack bounds, and QEMU is not silicon.
Keep exploring