add FreeVars, and split only on used dvars in Equal
This commit is contained in:
parent
9973f8d07b
commit
fa14ce1a02
8 changed files with 399 additions and 33 deletions
|
@ -33,7 +33,7 @@ record TyContext d n where
|
|||
dctx : DimEq d
|
||||
dnames : BContext d
|
||||
tctx : TContext d n
|
||||
tnames : BContext n
|
||||
tnames : BContext n -- only used for printing
|
||||
qtys : QContext n -- only used for printing
|
||||
%name TyContext ctx
|
||||
|
||||
|
@ -46,7 +46,7 @@ record EqContext n where
|
|||
dassign : DimAssign dimLen -- only used for printing
|
||||
dnames : BContext dimLen -- only used for printing
|
||||
tctx : TContext 0 n
|
||||
tnames : BContext n
|
||||
tnames : BContext n -- only used for printing
|
||||
qtys : QContext n -- only used for printing
|
||||
%name EqContext ctx
|
||||
|
||||
|
@ -78,6 +78,10 @@ public export
|
|||
CtxExtension : Nat -> Nat -> Nat -> Type
|
||||
CtxExtension d = Telescope ((Qty, BindName,) . Term d)
|
||||
|
||||
public export
|
||||
CtxExtension0 : Nat -> Nat -> Nat -> Type
|
||||
CtxExtension0 d = Telescope ((BindName,) . Term d)
|
||||
|
||||
namespace TyContext
|
||||
public export %inline
|
||||
empty : TyContext 0 0
|
||||
|
@ -100,10 +104,18 @@ namespace TyContext
|
|||
qtys = qtys . qs
|
||||
}
|
||||
|
||||
export %inline
|
||||
extendTyN0 : CtxExtension0 d n1 n2 -> TyContext d n1 -> TyContext d n2
|
||||
extendTyN0 xss = extendTyN (map (Zero,) xss)
|
||||
|
||||
export %inline
|
||||
extendTy : Qty -> BindName -> Term d n -> TyContext d n -> TyContext d (S n)
|
||||
extendTy q x s = extendTyN [< (q, x, s)]
|
||||
|
||||
export %inline
|
||||
extendTy0 : BindName -> Term d n -> TyContext d n -> TyContext d (S n)
|
||||
extendTy0 = extendTy Zero
|
||||
|
||||
export %inline
|
||||
extendDim : BindName -> TyContext d n -> TyContext (S d) n
|
||||
extendDim x (MkTyContext {dimLen, dctx, dnames, tctx, tnames, qtys}) =
|
||||
|
@ -158,7 +170,7 @@ makeEqContext' ctx th = MkEqContext {
|
|||
export
|
||||
makeEqContext : TyContext d n -> DSubst d 0 -> EqContext n
|
||||
makeEqContext ctx@(MkTyContext {dnames, _}) th =
|
||||
let (d' ** Refl) = lengthPrf0 dnames in makeEqContext' ctx th
|
||||
let Val d = lengthPrf0 dnames in makeEqContext' ctx th
|
||||
|
||||
namespace EqContext
|
||||
public export %inline
|
||||
|
@ -183,10 +195,18 @@ namespace EqContext
|
|||
dassign, dnames
|
||||
}
|
||||
|
||||
export %inline
|
||||
extendTyN0 : CtxExtension0 0 n1 n2 -> EqContext n1 -> EqContext n2
|
||||
extendTyN0 xss = extendTyN (map (Zero,) xss)
|
||||
|
||||
export %inline
|
||||
extendTy : Qty -> BindName -> Term 0 n -> EqContext n -> EqContext (S n)
|
||||
extendTy q x s = extendTyN [< (q, x, s)]
|
||||
|
||||
export %inline
|
||||
extendTy0 : BindName -> Term 0 n -> EqContext n -> EqContext (S n)
|
||||
extendTy0 = extendTy Zero
|
||||
|
||||
export %inline
|
||||
extendDim : BindName -> DimConst -> EqContext n -> EqContext n
|
||||
extendDim x e (MkEqContext {dassign, dnames, tctx, tnames, qtys}) =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue