Expand description
§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 contractsscaffold— 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 chainbinding— Map contract equations to implementation functionsdiff— Detect drift between contract versionscoverage— Cross-contract obligation coverage reportgenerate— End-to-end codegen to diskgraph— Contract dependency graph and cycle detectionlatex— LaTeX conversion for contract math notationbook_gen— mdBook page generation for contractslean_gen— Lean 4 definition and theorem stub generationlint— Contract quality gate: validate + audit + score in one passkernels— Scalar, AVX2, and PTX kernel implementations
Modules§
- audit
- Audit trail generator — traceability chain.
- binding
- Binding registry — maps contract equations to implementations.
- book_
gen - mdBook page generation for contracts.
- build_
helper - Build script helper for consuming crates.
- codegen
- Code generation from YAML contracts → Rust
debug_assert!() checks. - coq_gen
- Coq theorem stub generation from YAML contracts.
- coverage
- Cross-contract obligation coverage report.
- diff
- Contract diff — detect drift between contract versions.
- error
- explain
- Contract explanation — chain-of-thought narrative for any contract.
- extract
PyTorchkernel extraction — reads Python source, extracts equations.- flux_
gen - Flux refinement type annotation generation.
- fuzz_
gen - Coverage-guided fuzz target generation.
- generate
- End-to-end codegen — generates all artifacts to disk.
- graph
- Contract dependency graph — composition via
depends_on. - infer
- Contract inference engine.
- invariant_
gen - Type invariant code generation.
- kani_
gen - Kani harness generator — Phase 6 of the pipeline.
- kernels
- Kernel implementations: scalar reference, AVX2 SIMD, and CUDA PTX.
- latex
- LaTeX conversion utilities for contract math notation.
- lean_
gen - Lean 4 code generator — Phase 7 of the pipeline.
- lint
- Contract quality gate: validate + audit + score in one pass.
- mirai_
gen - MIRAI abstract interpretation annotation generation.
- obligation_
matrix - Per-obligation verification matrix.
- pipeline
- Pipeline contract support — cross-repo compositional verification.
- probar_
gen - Probar property-test generator — Phase 5 of the pipeline.
- proof_
status - Proof status report — cross-contract proof level assessment.
- query
- Contract query engine with BM25 semantic search.
- readme_
gen - Deterministic README.md and CI workflow generation for consumer projects.
- reverse_
coverage - Reverse coverage: detect public functions without contract bindings.
- roofline
- Runtime roofline model derived from contract YAML.
- scaffold
- Scaffold generator — Phase 3 of the pipeline.
- schema
- scoring
- Contract and codebase scoring.
- tla_gen
- TLA+ system-level model checking specification generation.
- traits
- Auto-generated contract traits for compiler-enforced binding verification.