Replace the listy context API with indexed lookups and explicit scope invariants

This commit is contained in:
2026-04-19 17:35:19 +00:00
parent 28c9f2f9f8
commit 03eedd855d
3 changed files with 81 additions and 12 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ mutual
partial def infer (cxt : Cxt) : Raw TCM (Tm × Val)
| .var x =>
match cxt.lookup x with
| some (i, a) => pure (.var i, a)
| some (i, a) => pure (.var i.val, a)
| none => throw s!"unknown variable {x}"
| .nat => pure (.nat, .univ 0)
| .zero => pure (.zero, .nat)