use constraints when checking δ

when checking δ 𝑖 ⇒ s, add 𝑖=ε to Ψ instead of checking s‹ε/𝑖›.
this has the same effect but an error message will show "𝑖, 𝑖=ε" in
the context
This commit is contained in:
rhiannon morris 2023-04-17 21:55:12 +02:00
parent ac85dc9352
commit 4db373a84f

View file

@ -196,12 +196,15 @@ mutual
check' ctx sg (DLam body) ty = do check' ctx sg (DLam body) ty = do
(ty, l, r) <- expectEq !ask ctx ty (ty, l, r) <- expectEq !ask ctx ty
let ctx' = extendDim body.name ctx
ty = ty.term
body = body.term
-- if Ψ, i | Γ ⊢ σ · t ⇐ A ⊳ Σ -- if Ψ, i | Γ ⊢ σ · t ⇐ A ⊳ Σ
qout <- checkC (extendDim body.name ctx) sg body.term ty.term qout <- checkC ctx' sg body ty
-- if Ψ | Γ ⊢ t0 = l : A0 -- if Ψ, i, i = 0 | Γ ⊢ t = l : A
equal ctx ty.zero body.zero l equal (eqDim (BV 0) (K Zero) ctx') ty body (dweakT 1 l)
-- if Ψ | Γ ⊢ t1 = r : A1 -- if Ψ, i, i = 1 | Γ ⊢ t = r : A
equal ctx ty.one body.one r equal (eqDim (BV 0) (K One) ctx') ty body (dweakT 1 r)
-- then Ψ | Γ ⊢ σ · (δ i ⇒ t) ⇐ Eq [i ⇒ A] l r ⊳ Σ -- then Ψ | Γ ⊢ σ · (δ i ⇒ t) ⇐ Eq [i ⇒ A] l r ⊳ Σ
pure qout pure qout