Commit f2eff3b
feat(my-qtt): QTT verified-core checker — faithful Rust port of Coq R5/R5b
First strand of the fundamentals -> implementation coupling (the path the user
chose). proofs/STATUS.md flags that the mechanised QTT core and the Rust
compiler are 'two disconnected universes': checker.rs is a conventional Hindley
checker with no usage/multiplicity axis. This new crate ports the
machine-checked usage-walk synthesiser into the compiler's own language:
- Q semiring {0,1,ω} (qadd/qmul/qle) — Coq Quantity.v tables verbatim
- usage vectors (uzero/onehot/uadd/uscale/ule) — Coq SoloCore.v
- check : Tctx -> Tm -> Option<(Ty,Uvec)> — the one-pass synthesiser
(SoloCore.v:2128), returning the type AND exact realised usage
- aff_check — the affine-budget decision (aff_type_dec / aff_type_iff, R5b)
Faithful de Bruijn (snoc-list <-> Vec, innermost = last). 7 tests green,
incl. the 4 SoloCore.v 'reflexivity' Examples reproduced as oracle tests
(check_id_unit / drop_linear / dup_linear / dup_omega) + the R5b affine
discard — so the port is checked against the verified algorithm's own
closed computations. No external deps; cargo test -p my-qtt passes.
Next coupling step: elaborate the my-lang surface AST onto this core so the
running checker enforces the resource axis. Refs proofs/STATUS.md.1 parent 34cbc57 commit f2eff3b
3 files changed
Lines changed: 433 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments