Skip to content

Commit 873c9aa

Browse files
committed
Changes in Typing rules
1 parent d306bdc commit 873c9aa

File tree

7 files changed

+116
-79
lines changed

7 files changed

+116
-79
lines changed

src/Agda/Core/Context.agda

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,16 @@ addContextTel {α} (ExtendTel {β = β} x ty telt) c =
6464
(trans (associativity (~ β) [ x ] α)
6565
(cong (λ t t <> α) (sym $ revsBindComp β x)))
6666
(addContextTel telt (c , x ∶ ty))
67+
6768
{-# COMPILE AGDA2HS addContextTel #-}
69+
70+
addContextTypeS : Context α TypeS β α Context (β <> α)
71+
addContextTypeS {α} Γ ⌈⌉ =
72+
subst0 Context
73+
(sym $ trans (cong (λ x x <> α) refl)
74+
(leftIdentity α))
75+
Γ
76+
addContextTypeS {α = α} Γ (YCons {α = β} {x = x} ty Δ) =
77+
let Γ' : Context (x ◃ (β <> α))
78+
Γ' = addContextTypeS Γ Δ , x ∶ weaken (subJoinDrop (rezzTypeS Δ) subRefl) ty in
79+
subst0 Context (associativity [ x ] β α) Γ'

src/Agda/Core/Conversion.agda

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ data Conv {α} where
7777
(bs bp : Branches α cs)
7878
(ms : Type _) (mp : Type _)
7979
u ≅ u'
80-
renameTop {y = z} (rezz<> (rezz~ r1) r) (unType ms)
81-
≅ renameTop {y = z} (rezz<> (rezz~ r2) r) (unType mp)
80+
renameTop {y = z} (rezz<> r1 r) (unType ms)
81+
≅ renameTop {y = z} (rezz<> r2 r) (unType mp)
8282
ConvBranches bs bp
8383
TCase {x = x} d r1 u bs ms ≅ TCase {x = y} d r2 u' bp mp
8484
-- TODO: CProj : {! !}
@@ -101,7 +101,7 @@ data Conv {α} where
101101

102102
data ConvBranch {α} where
103103
CBBranch : (c : NameIn conScope) (r1 r2 : _)
104-
(t1 t2 : Term (~ fieldScope c <> α))
104+
(t1 t2 : Term (fieldScope c <> α))
105105
t1 ≅ t2
106106
ConvBranch (BBranch c r1 t1) (BBranch c r2 t2)
107107

src/Agda/Core/Reduce.agda

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ data Frame (@0 α : Scope Name) : Set where
6060
FApp : (u : Term α) Frame α
6161
FProj : (x : NameIn defScope) Frame α
6262
FCase : (d : NameIn dataScope) (r : Rezz (dataIxScope d))
63-
(bs : Branches α cs) (m : Type (x ◃ (~ dataIxScope d <> α))) Frame α
63+
(bs : Branches α cs) (m : Type (x ◃ (dataIxScope d <> α))) Frame α
6464

6565
{-# COMPILE AGDA2HS Frame #-}
6666

@@ -77,7 +77,7 @@ weakenFrame s (FProj f) = FProj f
7777
weakenFrame s (FCase d r bs m) =
7878
FCase d r
7979
(weaken s bs)
80-
(weaken (subBindKeep (subJoinKeep (rezz~ r) s)) m)
80+
(weaken (subBindKeep (subJoinKeep r s)) m)
8181

8282
{-# COMPILE AGDA2HS weakenFrame #-}
8383

@@ -122,7 +122,7 @@ unState r (MkState e v s) = subst (envToSubst r e) (unStack s v)
122122

123123
lookupBranch : Branches α cs (c : NameIn conScope)
124124
Maybe ( Rezz (fieldScope c)
125-
× Term (~ fieldScope c <> α))
125+
× Term (fieldScope c <> α))
126126
lookupBranch BsNil c = Nothing
127127
lookupBranch (BsCons (BBranch c' aty u) bs) c =
128128
case decNamesIn c' c of λ where
@@ -178,9 +178,9 @@ step (rezz sig) (MkState e (TDef d) s) =
178178
step rsig (MkState e (TCon c vs) (FCase d r bs _ ∷ s)) =
179179
case lookupBranch bs c of λ where
180180
(Just (r , v)) Just (MkState
181-
(extendEnvironment (revSubst vs) e)
181+
(extendEnvironment vs e)
182182
v
183-
(weakenStack (subJoinDrop (rezz~ r) subRefl) s))
183+
(weakenStack (subJoinDrop r subRefl) s))
184184
Nothing Nothing
185185
step rsig (MkState e (TData d ps is) s) = Nothing
186186
step rsig (MkState e (TCon c vs) (FProj f ∷ s)) = Nothing -- TODO

src/Agda/Core/Signature.agda

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ opaque
5353

5454
record Constructor (@0 pars : Scope Name) (@0 ixs : Scope Name) (@0 c : NameIn conScope) : Set where
5555
field
56-
conTelescope : Telescope pars (fieldScope c)
57-
conIndices : ixs ⇒ (revScope (fieldScope c) <> pars)
56+
conIndTypeS : TypeS (fieldScope c) pars -- the TypeS of the indexes of c
57+
conIx : ixs ⇒ (fieldScope c) <> pars -- how the indexes are constructred given parameters and c indices
5858
open Constructor public
5959

6060
{-# COMPILE AGDA2HS Constructor #-}
@@ -63,8 +63,8 @@ record Datatype (@0 pars : Scope Name) (@0 ixs : Scope Name) : Set where
6363
field
6464
dataConstructorScope : Scope Name
6565
dataSort : Sort pars
66-
dataParameterTel : Telescope mempty pars
67-
dataIndexTel : Telescope pars ixs
66+
dataParTypeS : TypeS pars mempty
67+
dataIxTypeS : TypeS ixs pars
6868
dataConstructors : ((⟨ c ⟩ cp) : NameIn dataConstructorScope)
6969
Σ (c ∈ conScope) (λ p Constructor pars ixs (⟨ c ⟩ p))
7070
open Datatype public

src/Agda/Core/Substitute.agda

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ substType : α ⇒ β → Type α → Type β
2727
substBranch : α ⇒ β Branch α c Branch β c
2828
substBranches : α ⇒ β Branches α cs Branches β cs
2929
substSubst : α ⇒ β γ ⇒ α γ ⇒ β
30+
substTypeS : α ⇒ β γ ⇛ α γ ⇛ β
3031

3132
substSort f (STyp x) = STyp x
3233
{-# COMPILE AGDA2HS substSort #-}
@@ -45,14 +46,14 @@ substTerm f (TCase {x = x} d r u bs m) =
4546
TCase {x = x} d r
4647
(substTerm f u)
4748
(substBranches f bs)
48-
(substType (liftBindSubst (liftSubst (rezz~ r) f)) m)
49+
(substType (liftBindSubst (liftSubst r f)) m)
4950
substTerm f (TPi x a b) = TPi x (substType f a) (substType (liftBindSubst f) b)
5051
substTerm f (TSort s) = TSort (substSort f s)
5152
substTerm f (TLet x u v) = TLet x (substTerm f u) (substTerm (liftBindSubst f) v)
5253
substTerm f (TAnn u t) = TAnn (substTerm f u) (substType f t)
5354
{-# COMPILE AGDA2HS substTerm #-}
5455

55-
substBranch f (BBranch c r u) = BBranch c r (substTerm (liftSubst (rezz~ r) f) u)
56+
substBranch f (BBranch c r u) = BBranch c r (substTerm (liftSubst r f) u)
5657
{-# COMPILE AGDA2HS substBranch #-}
5758

5859
substBranches f BsNil = BsNil
@@ -63,6 +64,10 @@ substSubst f SNil = SNil
6364
substSubst f (SCons x e) = SCons (substTerm f x) (substSubst f e)
6465
{-# COMPILE AGDA2HS substSubst #-}
6566

67+
substTypeS f ⌈⌉ = ⌈⌉
68+
substTypeS f ⌈ e ◃ _ ∶ x ⌉ = YCons (substType f x) (substTypeS f e)
69+
{-# COMPILE AGDA2HS substTypeS #-}
70+
6671
record Substitute (t : @0 Scope Name Set) : Set where
6772
field subst : (α ⇒ β) t α t β
6873
open Substitute {{...}} public
@@ -81,12 +86,15 @@ instance
8186
iSubstBranches .subst = substBranches
8287
iSubstSubst : Substitute (Subst α)
8388
iSubstSubst .subst = substSubst
89+
iSubstTypeS : Substitute (TypeS α)
90+
iSubstTypeS .subst = substTypeS
8491
{-# COMPILE AGDA2HS iSubstTerm #-}
8592
{-# COMPILE AGDA2HS iSubstType #-}
8693
{-# COMPILE AGDA2HS iSubstSort #-}
8794
{-# COMPILE AGDA2HS iSubstBranch #-}
8895
{-# COMPILE AGDA2HS iSubstBranches #-}
8996
{-# COMPILE AGDA2HS iSubstSubst #-}
97+
{-# COMPILE AGDA2HS iSubstTypeS #-}
9098

9199
substTop : {{Substitute t}} Rezz α Term α t (x ◃ α) t α
92100
substTop r u = subst (SCons u (idSubst r))

src/Agda/Core/Syntax.agda

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,19 @@ infix 5 Subst
5454
syntax Subst α β = α ⇒ β
5555

5656
pattern ⌈⌉ = SNil
57-
infix 6 ⌈_↦_◃_⌉
58-
pattern ⌈_↦_◃_⌉ x u σ = SCons {x = x} u σ
59-
infix 4 ⌈_↦_
60-
pattern ⌈_↦_⌉ x u = ⌈ x ↦ u ◃ ⌈⌉
57+
infix 6 ⌈_◃_↦_⌉
58+
pattern ⌈_◃_↦_⌉ σ x u = SCons {x = x} u σ
59+
infix 4_↦_⌉
60+
pattern_↦_⌉ x u =⌈⌉ ◃ x ↦ u ⌉
6161

62+
infix 5 TypeS
63+
syntax TypeS α β = α ⇛ β
6264

65+
pattern ⌈⌉ = YNil
66+
infix 6 ⌈_◃_∶_⌉
67+
pattern ⌈_◃_∶_⌉ Δ x u = YCons {x = x} u Δ
68+
infix 4 ⌈_◃_∶⌉
69+
pattern ⌈_◃_∶⌉ x u = ⌈ x ◃ u ∶ ⌈⌉ ⌉
6370

6471

6572
-- This should ideally be the following:
@@ -83,7 +90,7 @@ data Term α where
8390
Rezz (dataIxScope d) -- Run-time representation of index scope
8491
(u : Term α) -- Term we are casing on
8592
(bs : Branches α cs) -- Branches (one for each constructor of d)
86-
(m : Type (x ◃ (~ dataIxScope d <> α))) -- Return type
93+
(m : Type (x ◃ (dataIxScope d <> α))) -- Return type
8794
Term α
8895
TPi : (@0 x : Name) (u : Type α) (v : Type (x ◃ α)) Term α
8996
TSort : Sort α Term α
@@ -116,7 +123,7 @@ sortType s = El (sucSort s) (TSort s)
116123
data Branch α where
117124
BBranch : (c : NameIn conScope)
118125
Rezz (fieldScope c)
119-
Term (~ fieldScope c <> α) Branch α (proj₁ c)
126+
Term (fieldScope c <> α) Branch α (proj₁ c)
120127
{-# COMPILE AGDA2HS Branch deriving Show #-}
121128

122129
data Branches α where
@@ -144,6 +151,10 @@ rezzBranches BsNil = rezz mempty
144151
rezzBranches (BsCons {c = c} bh bt) = rezzCong (λ cs c ◃ cs) (rezzBranches bt)
145152
{-# COMPILE AGDA2HS rezzBranches #-}
146153

154+
rezzTypeS : TypeS α β Rezz α
155+
rezzTypeS ⌈⌉ = rezz _
156+
rezzTypeS ⌈ t ◃ x ∶ ty ⌉ = rezzCong (λ t singleton x <> t) (rezzTypeS t)
157+
147158
allBranches : Branches α β All (λ c c ∈ conScope) β
148159
allBranches BsNil = allEmpty
149160
allBranches (BsCons (BBranch (⟨ _ ⟩ ci) _ _) bs) = allJoin (allSingl ci) (allBranches bs)
@@ -160,7 +171,7 @@ applys {γ = γ} v (u ∷ us) = applys (TApp v u) us
160171

161172
applySubst : Term γ (β ⇒ γ) Term γ
162173
applySubst {γ = γ} v ⌈⌉ = v
163-
applySubst {γ = γ} v ⌈ _ ↦ u ◃ us= applySubst (TApp v u) us
174+
applySubst {γ = γ} v ⌈ us ◃ _ ↦ u ⌉ = applySubst (TApp v u) us
164175
{-# COMPILE AGDA2HS applySubst #-}
165176

166177

@@ -212,17 +223,17 @@ lookupSubst : α ⇒ β
212223
x ∈ α
213224
Term β
214225
lookupSubst ⌈⌉ x q = inEmptyCase q
215-
lookupSubst ⌈ _ ↦ u ◃ f ⌉ x q = inBindCase q (λ _ u) (lookupSubst f x)
226+
lookupSubst ⌈ f ◃ _ ↦ u ⌉ x q = inBindCase q (λ _ u) (lookupSubst f x)
216227

217228
{-# COMPILE AGDA2HS lookupSubst #-}
218229

219230
opaque
220231
unfolding Scope
221232

222233
caseSubstBind : (s : (x ◃ α) ⇒ β)
223-
((t : Term β) (s' : α ⇒ β) @0 {{s ≡ ⌈ x ↦ t ◃ s' ⌉}} d)
234+
((t : Term β) (s' : α ⇒ β) @0 {{s ≡ ⌈ s' ◃ x ↦ t ⌉}} d)
224235
d
225-
caseSubstBind ⌈ _ ↦ x ◃ s ⌉ f = f x s
236+
caseSubstBind ⌈ s ◃ _ ↦ x ⌉ f = f x s
226237

227238
{-# COMPILE AGDA2HS caseSubstBind #-}
228239

@@ -242,6 +253,7 @@ weakenType : α ⊆ β → Type α → Type β
242253
weakenBranch : α ⊆ β Branch α c Branch β c
243254
weakenBranches : α ⊆ β Branches α cs Branches β cs
244255
weakenSubst : β ⊆ γ α ⇒ β α ⇒ γ
256+
weakenTypeS : β ⊆ γ α ⇛ β α ⇛ γ
245257

246258
weakenTerm p (TVar (⟨ x ⟩ k)) = TVar (⟨ x ⟩ coerce p k)
247259
weakenTerm p (TDef d) = TDef d
@@ -250,7 +262,7 @@ weakenTerm p (TCon c vs) = TCon c (weakenSubst p vs)
250262
weakenTerm p (TLam x v) = TLam x (weakenTerm (subBindKeep p) v)
251263
weakenTerm p (TApp u e) = TApp (weakenTerm p u) (weakenTerm p e)
252264
weakenTerm p (TProj u x) = TProj (weakenTerm p u) x
253-
weakenTerm p (TCase d r u bs m) = TCase d r (weakenTerm p u) (weakenBranches p bs) (weakenType (subBindKeep (subJoinKeep (rezz~ r) p)) m)
265+
weakenTerm p (TCase d r u bs m) = TCase d r (weakenTerm p u) (weakenBranches p bs) (weakenType (subBindKeep (subJoinKeep r p)) m)
254266
weakenTerm p (TPi x a b) = TPi x (weakenType p a) (weakenType (subBindKeep p) b)
255267
weakenTerm p (TSort α) = TSort (weakenSort p α)
256268
weakenTerm p (TLet x v t) = TLet x (weakenTerm p v) (weakenTerm (subBindKeep p) t)
@@ -263,17 +275,21 @@ weakenSort p (STyp x) = STyp x
263275
weakenType p (El st t) = El (weakenSort p st) (weakenTerm p t)
264276
{-# COMPILE AGDA2HS weakenType #-}
265277

266-
weakenBranch p (BBranch c r x) = BBranch c r (weakenTerm (subJoinKeep (rezz~ r) p) x)
278+
weakenBranch p (BBranch c r x) = BBranch c r (weakenTerm (subJoinKeep r p) x)
267279
{-# COMPILE AGDA2HS weakenBranch #-}
268280

269281
weakenBranches p BsNil = BsNil
270282
weakenBranches p (BsCons b bs) = BsCons (weakenBranch p b) (weakenBranches p bs)
271283
{-# COMPILE AGDA2HS weakenBranches #-}
272284

273285
weakenSubst p ⌈⌉ = ⌈⌉
274-
weakenSubst p ⌈ _ ↦ u ◃ e =_ ↦ (weakenTerm p u) ◃ (weakenSubst p e) ⌉
286+
weakenSubst p ⌈ e ◃ _ ↦ u ⌉ =(weakenSubst p e) ◃ _ ↦ (weakenTerm p u) ⌉
275287
{-# COMPILE AGDA2HS weakenSubst #-}
276288

289+
weakenTypeS p ⌈⌉ = ⌈⌉
290+
weakenTypeS p ⌈ e ◃ _ ∶ u ⌉ = ⌈ (weakenTypeS p e) ◃ _ ∶ (weakenType p u) ⌉
291+
{-# COMPILE AGDA2HS weakenTypeS #-}
292+
277293
record Weaken (t : @0 Scope Name Set) : Set where
278294
field
279295
weaken : α ⊆ β t α t β
@@ -293,12 +309,15 @@ instance
293309
iWeakenBranches .weaken = weakenBranches
294310
iWeakenSubst : Weaken (Subst β)
295311
iWeakenSubst .weaken = weakenSubst
312+
iWeakenTypeS : Weaken (TypeS β)
313+
iWeakenTypeS .weaken = weakenTypeS
296314
{-# COMPILE AGDA2HS iWeakenTerm #-}
297315
{-# COMPILE AGDA2HS iWeakenSort #-}
298316
{-# COMPILE AGDA2HS iWeakenType #-}
299317
{-# COMPILE AGDA2HS iWeakenBranch #-}
300318
{-# COMPILE AGDA2HS iWeakenBranches #-}
301319
{-# COMPILE AGDA2HS iWeakenSubst #-}
320+
{-# COMPILE AGDA2HS iWeakenTypeS #-}
302321

303322

304323
dropSubst : {@0 α β : Scope Name} {@0 x : Name} (x ◃ α) ⇒ β α ⇒ β
@@ -319,8 +338,8 @@ listSubst (rezz β) (v ∷ vs) =
319338
concatSubst : α ⇒ γ β ⇒ γ (α <> β) ⇒ γ
320339
concatSubst ⌈⌉ q =
321340
subst0 (λ α α ⇒ _) (sym (leftIdentity _)) q
322-
concatSubst ⌈ _ ↦ v ◃ p ⌉ q =
323-
subst0 (λ α α ⇒ _) (associativity _ _ _) ⌈ _ ↦ vconcatSubst p q
341+
concatSubst ⌈ p ◃ _ ↦ v ⌉ q =
342+
subst0 (λ α α ⇒ _) (associativity _ _ _) ⌈ concatSubst p q_ ↦ v
324343

325344
{-# COMPILE AGDA2HS concatSubst #-}
326345

@@ -330,7 +349,7 @@ opaque
330349
subToSubst : Rezz α α ⊆ β α ⇒ β
331350
subToSubst (rezz []) p = ⌈⌉
332351
subToSubst (rezz (Erased x ∷ α)) p =
333-
x ↦ (TVar (⟨ x ⟩ coerce p inHere)) ◃ (subToSubst (rezz α) (joinSubRight (rezz _) p)) ⌉
352+
(subToSubst (rezz α) (joinSubRight (rezz _) p)) ◃ x ↦ (TVar (⟨ x ⟩ coerce p inHere)) ⌉
334353

335354

336355
{-# COMPILE AGDA2HS subToSubst #-}
@@ -340,7 +359,7 @@ opaque
340359

341360
revSubstAcc : {@0 α β γ : Scope Name} α ⇒ γ β ⇒ γ (revScopeAcc α β) ⇒ γ
342361
revSubstAcc ⌈⌉ p = p
343-
revSubstAcc ⌈ y ↦ x ◃ s ⌉ p = revSubstAcc s ⌈ y ↦ x ◃ p
362+
revSubstAcc ⌈ s ◃ y ↦ x ⌉ p = revSubstAcc s ⌈ p ◃ y ↦ x ⌉
344363
{-# COMPILE AGDA2HS revSubstAcc #-}
345364

346365
revSubst : {@0 α β : Scope Name} α ⇒ β ~ α ⇒ β
@@ -358,15 +377,15 @@ idSubst r = subst0 (λ β → β ⇒ β) (rightIdentity _) (liftSubst r ⌈⌉)
358377
{-# COMPILE AGDA2HS idSubst #-}
359378

360379
liftBindSubst : {@0 α β : Scope Name} {@0 x y : Name} α ⇒ β (bind x α) ⇒ (bind y β)
361-
liftBindSubst {y = y} e = ⌈ _ ↦ (TVar (⟨ y ⟩ inHere)) ◃ (weakenSubst (subBindDrop subRefl) e) ⌉
380+
liftBindSubst {y = y} e =(weakenSubst (subBindDrop subRefl) e) ◃ _ ↦ (TVar (⟨ y ⟩ inHere)) ⌉
362381
{-# COMPILE AGDA2HS liftBindSubst #-}
363382

364383
raiseSubst : {@0 α β : Scope Name} Rezz β α ⇒ β (α <> β) ⇒ β
365384
raiseSubst {β = β} r ⌈⌉ = subst (λ α α ⇒ β) (sym (leftIdentity β)) (idSubst r)
366385
raiseSubst {β = β} r (SCons {α = α} u e) =
367386
subst (λ α α ⇒ β)
368387
(associativity (singleton _) α β)
369-
_ ↦ uraiseSubst r e
388+
raiseSubst r e_ ↦ u
370389
{-# COMPILE AGDA2HS raiseSubst #-}
371390

372391
revIdSubst : {@0 α : Scope Name} Rezz α α ⇒ ~ α
@@ -402,7 +421,7 @@ strengthenTerm p (TProj u f) = (λ v → TProj v f) <$> strengthenTerm p u
402421
strengthenTerm p (TCase d r u bs m) =
403422
TCase d r <$> strengthenTerm p u
404423
<*> strengthenBranches p bs
405-
<*> strengthenType (subBindKeep (subJoinKeep (rezz~ r) p)) m
424+
<*> strengthenType (subBindKeep (subJoinKeep r p)) m
406425
strengthenTerm p (TPi x a b) =
407426
TPi x <$> strengthenType p a <*> strengthenType (subBindKeep p) b
408427
strengthenTerm p (TSort s) = TSort <$> strengthenSort p s
@@ -413,13 +432,13 @@ strengthenSort p (STyp n) = Just (STyp n)
413432

414433
strengthenType p (El st t) = El <$> strengthenSort p st <*> strengthenTerm p t
415434

416-
strengthenBranch p (BBranch c r v) = BBranch c r <$> strengthenTerm (subJoinKeep (rezz~ r) p) v
435+
strengthenBranch p (BBranch c r v) = BBranch c r <$> strengthenTerm (subJoinKeep r p) v
417436

418437
strengthenBranches p BsNil = Just BsNil
419438
strengthenBranches p (BsCons b bs) = BsCons <$> strengthenBranch p b <*> strengthenBranches p bs
420439

421440
strengthenSubst p ⌈⌉ = Just ⌈⌉
422-
strengthenSubst p ⌈ x ↦ v ◃ vs= SCons <$> strengthenTerm p v <*> strengthenSubst p vs
441+
strengthenSubst p ⌈ vs ◃ x ↦ v ⌉ = SCons <$> strengthenTerm p v <*> strengthenSubst p vs
423442

424443
{-# COMPILE AGDA2HS strengthenTerm #-}
425444
{-# COMPILE AGDA2HS strengthenType #-}
@@ -486,18 +505,18 @@ varInTerm (TProj t x) = varInTerm t
486505
varInTerm (TCase d r u bs m) =
487506
varInTerm u <>
488507
(varInBranches bs) <>
489-
(liftListNameIn (rezz~ r) (liftBindListNameIn (varInType m)))
508+
(liftListNameIn r (liftBindListNameIn (varInType m)))
490509
varInTerm (TPi x a b) = varInType a <> (liftBindListNameIn (varInType b))
491510
varInTerm (TSort x) = []
492511
varInTerm (TLet x t t₁) = varInTerm t <> (liftBindListNameIn (varInTerm t₁))
493512
varInTerm (TAnn u t) = varInTerm u <> varInType t
494513

495514
varInSubst ⌈⌉ = []
496-
varInSubst ⌈ x ↦ u ◃ σ= (varInTerm u) <> (varInSubst σ)
515+
varInSubst ⌈ σ ◃ x ↦ u ⌉ = (varInTerm u) <> (varInSubst σ)
497516

498517
varInType (El _ u) = varInTerm u
499518

500519
varInBranches BsNil = []
501520
varInBranches (BsCons b bs) = varInBranch b <> (varInBranches bs)
502521

503-
varInBranch (BBranch c r v) = liftListNameIn (rezz~ r) (varInTerm v)
522+
varInBranch (BBranch c r v) = liftListNameIn r (varInTerm v)

0 commit comments

Comments
 (0)