nx_theorem_registry.nx
buildroot/runtime/nx_theorem_registry.nx
about
nx_theorem_registry.nx -- substrate-native primitive registry.
Per user 2026-05-14: "we should be able to build from the hardware
up and shift this correctly much faster". The L0->L2.5 promotion:
each catalog entry becomes a SUBSTRATE-REGISTERED ENTITY (queryable
by name + iterable + countable + composable) without per-entry code
generation. Machine speed: O(N) load over JSONL.
After loading the 42,469-row shard:
- each name is a first-class substrate primitive id
- nx_thm_lookup(name) -> row or null
- nx_thm_at(idx) -> row by index
- nx_thm_count_by_kind(kind) -> aggregate
genealogy_id: substrate_thm_registry_2026_05_14
lineage_id: l0_to_l2_5_bulk_promotion
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_str.nx
imported by: nx_theorem_registry_test.nx
structs
| 42 | struct NxThmRow |
| 50 | struct NxThmRegistry |
consts
| 30 | const NX_THM_REG_CAP: nx_int = 262144 // bumped from 65536 to fit 145k+ mathlib4 ingestion |
| 31 | const NX_THM_NAME_MAX: nx_size = 128 |
| 34 | const NX_THM_SRC_UNKNOWN: nx_int = 0 |
| 35 | const NX_THM_SRC_LEAN: nx_int = 1 |
| 36 | const NX_THM_SRC_COQ: nx_int = 2 |
| 37 | const NX_THM_SRC_ISABELLE: nx_int = 3 |
| 38 | const NX_THM_SRC_HOL: nx_int = 4 |
| 39 | const NX_THM_SRC_MIZAR: nx_int = 5 |
| 40 | const NX_THM_SRC_RFC: nx_int = 6 |
| 48 | const NX_THM_ROW_BYTES: nx_size = 24 |
functions
| 60 | func nx_thm_find(buf: *u8, p: nx_int, end: nx_int, pat: *u8, pat_len: nx_int) -> nx_int |
| 75 | func nx_thm_src_from_str(buf: *u8, p: nx_int, end: nx_int) -> nx_int |
| 86 | func nx_thm_parse_row(buf: *u8, lo: nx_int, hi: nx_int, name_buf: *u8, out: *NxThmRow) -> nx_int |
| 132 | func nx_thm_load(path: *u8) -> *NxThmRegistry |
| 168 | func nx_thm_n(r: *NxThmRegistry) -> nx_int { return r.n } called by 1: main |
| 170 | func nx_thm_at(r: *NxThmRegistry, idx: nx_int) -> *NxThmRow |
| 177 | func nx_thm_lookup(r: *NxThmRegistry, name: *u8) -> *NxThmRow |
| 187 | func nx_thm_count_by_kind(r: *NxThmRegistry, kind: nx_int) -> nx_int |
| 198 | func nx_thm_count_by_source(r: *NxThmRegistry, source: nx_int) -> nx_int |