Split neutrals from canonical values so stuck eliminators arent encoded via constructor overloading
This commit is contained in:
+4
-4
@@ -14,7 +14,7 @@ private def showTy (l : Lvl) (v : Val) : String :=
|
||||
mutual
|
||||
partial def check (cxt : Cxt) : Raw → Val → TCM Tm
|
||||
| .lam x t, .pi a c => do
|
||||
let bodyTy ← cApp c (.var cxt.lvl)
|
||||
let bodyTy ← cApp c (.neu (.var cxt.lvl))
|
||||
let t' ← check (cxt.bind x a) t bodyTy
|
||||
pure (.lam t')
|
||||
| .pair t u, .sig a c => do
|
||||
@@ -62,8 +62,8 @@ mutual
|
||||
let zTy ← vApp vmotive .zero
|
||||
let z' ← check cxt z zTy
|
||||
let kCxt := cxt.bind k .nat
|
||||
let ihTy ← vApp vmotive (.var cxt.lvl)
|
||||
let stepTy ← vApp vmotive (.succ (.var cxt.lvl))
|
||||
let ihTy ← vApp vmotive (.neu (.var cxt.lvl))
|
||||
let stepTy ← vApp vmotive (.succ (.neu (.var cxt.lvl)))
|
||||
let stepBody' ← check (kCxt.bind ih ihTy) s stepTy
|
||||
let step' : Tm := .lam (.lam stepBody')
|
||||
let resultTy ← vApp vmotive vscrut
|
||||
@@ -109,7 +109,7 @@ mutual
|
||||
let vtarget ← eval cxt.env target'
|
||||
if !(← conv cxt.lvl vtarget rhs) then
|
||||
throw s!"idElim target {showTy cxt.lvl vtarget} does not match the equality endpoint {showTy cxt.lvl rhs}"
|
||||
let eqVarTy : Val := .id a x (.var cxt.lvl)
|
||||
let eqVarTy : Val := .id a x (.neu (.var cxt.lvl))
|
||||
let (motiveBody', level) ← inferUniverse ((cxt.bind y a).bind p eqVarTy) motive
|
||||
let motive' : Tm := .lam (.lam motiveBody')
|
||||
let vmotive ← eval cxt.env motive'
|
||||
|
||||
Reference in New Issue
Block a user