Commit 9ceea68
committed
IxVM: context-suffix memo keys for closed terms + drop dead KValNode
Two changes to the Aiur kernel core, both behavior-preserving.
Closed-term context normalization in whnf / k_infer / k_is_def_eq:
a closed term (`expr_lbr(e) == 0`) reads nothing from the local binder-type
context `types` — its only reader, `types_lookup`, is reached via a `BVar`
lookup, which a closed term has none of. So the result is independent of
`types`; collapse it to `Nil`. The same closed subterm appearing under
different binder depths then shares one memo key `(e, Nil, top, addrs)`
instead of missing on a per-depth `types`, so Aiur's content-memoization
reuses it. Open terms keep their real context. Sound: a closed term reduces
and infers only over closed subterms.
Remove the dead `KValNode`/`KVal`/`KValEnv` NbE value domain: defined but
referenced nowhere (the live kernel runs on de-Bruijn `KExpr`); vestigial
from an abandoned NbE direction.
Measured with `ix check --ixe arena.ixe --claim <CheckEnv-digest>` over the
TutorialDefs arena (694 consts): 7,159,028,984 -> 7,151,454,776 FFT
(-0.11%). `lake test -- --ignored ixvm`: 297 pass, 0 fail. (The closed-term
win is larger on a faster ingress base, where the kernel core is a bigger
share of total.)1 parent 3fe83fe commit 9ceea68
4 files changed
Lines changed: 26 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 53 | | |
81 | 54 | | |
82 | 55 | | |
| |||
0 commit comments