#contract #kani #formal-methods #verification #ml-kernels

provable-contracts

Papers to Math to Contracts in Code — YAML contract parsing, validation, scaffold generation, and Kani harness codegen for provable Rust kernels

4 releases

Uses new Rust 2024

new 0.2.1 Mar 31, 2026
0.2.0 Mar 23, 2026
0.1.1 Feb 22, 2026
0.1.0 Feb 22, 2026

#520 in Math

Download history 8/week @ 2026-02-25 1215/week @ 2026-03-04 215/week @ 2026-03-11 384/week @ 2026-03-18 98/week @ 2026-03-25

1,912 downloads per month
Used in 4 crates

MIT license

1.5MB
37K SLoC

provable-contracts

Papers to Math to Contracts in Code.

A Rust library for converting peer-reviewed research papers into mathematically provable kernel implementations via YAML contract intermediaries with Kani bounded model checking verification.

Modules

  • schema — Parse and validate YAML kernel contracts
  • scaffold — Generate Rust trait stubs + failing tests from contracts
  • kani — Generate #[kani::proof] harnesses from contracts
  • probar — Generate probar property-based tests from contracts
  • audit — Trace paper→equation→contract→test→proof chain
  • binding — Map contract equations to implementation functions
  • diff — Detect drift between contract versions
  • coverage — Cross-contract obligation coverage report
  • generate — End-to-end codegen to disk
  • graph — Contract dependency graph and cycle detection
  • latex — LaTeX conversion for contract math notation
  • book_gen — mdBook page generation for contracts
  • lean_gen — Lean 4 definition and theorem stub generation
  • lint — Contract quality gate: validate + audit + score in one pass
  • kernels — Scalar, AVX2, and PTX kernel implementations

Dependencies

~3.5–6MB
~114K SLoC