Skip to content

Commit f2eff3b

Browse files
claudehyperpolymath
authored andcommitted
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

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ members = [
55
"crates/my-cli", # Command-line interface (my binary)
66
"crates/my-hir",
77
"crates/my-mir",
8+
"crates/my-qtt", # QTT verified-core checker (faithful port of Coq R5 check / R5b aff_type_dec)
89
"crates/my-llvm", # LLVM code generation
910
"crates/my-lsp",
1011
"crates/my-pkg",
@@ -33,6 +34,7 @@ repository = "https://github.com/hyperpolymath/my-lang"
3334
my-lang = { path = "crates/my-lang" }
3435
my-hir = { path = "crates/my-hir" }
3536
my-mir = { path = "crates/my-mir" }
37+
my-qtt = { path = "crates/my-qtt" }
3638
my-llvm = { path = "crates/my-llvm" }
3739
my-ai = { path = "crates/my-ai" }
3840

crates/my-qtt/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
3+
[package]
4+
name = "my-qtt"
5+
version.workspace = true
6+
edition.workspace = true
7+
license.workspace = true
8+
authors.workspace = true
9+
repository.workspace = true
10+
description = "QTT verified-core checker for my-lang: a faithful Rust port of the machine-checked Coq usage-walk synthesiser (SoloCore.v R5 `check` / R5b `aff_type_dec`)."
11+
12+
[dependencies]

0 commit comments

Comments
 (0)