fix quantity in CasePair typing

This commit is contained in:
rhiannon morris 2023-02-23 10:04:00 +01:00
parent abe812fc40
commit 4b814d7502

View file

@ -235,10 +235,11 @@ parameters {auto _ : IsQty q} {auto _ : CanTC q m}
(tfst, tsnd) <- expectSig !ask pairres.type
-- if Ψ | Γ, x : A, y : B ⊢ σ · body ⇐
-- ret[(x, y) ∷ (x : A) × B/p] ⊳ Σ₂, ρ₁·x, ρ₂·y
-- with ρ₁, ρ₂ ≤ π
-- with ρ₁, ρ₂ ≤ πσ
let bodyctx = extendTyN [< tfst, tsnd.term] ctx
bodyty = substCasePairRet pairres.type ret
bodyout <- popQs [< pi, pi] !(checkC bodyctx sg body.term bodyty)
pisg = pi * sg.fst
bodyout <- popQs [< pisg, pisg] !(checkC bodyctx sg body.term bodyty)
-- then Ψ | Γ ⊢ σ · case ⋯ ⇒ ret[pair/p] ⊳ πΣ₁ + Σ₂
pure $ InfRes {
type = sub1 ret pair,