summaryrefslogtreecommitdiff
path: root/src/Core/Declarative.idr
diff options
context:
space:
mode:
authorChloe Brown <chloe.brown.00@outlook.com>2023-04-06 17:00:46 +0100
committerChloe Brown <chloe.brown.00@outlook.com>2023-04-06 17:00:46 +0100
commitba63f18dafd54e49c863d6c25f7de6ca2d60987c (patch)
treebca567f3ef5a26c203ebcd528b6fbb29cb1b715a /src/Core/Declarative.idr
parent93aae7e34e7130d9541d3441079448f156d93477 (diff)
Move and rename ThinWf.
Correct statement for weakening preservation.
Diffstat (limited to 'src/Core/Declarative.idr')
-rw-r--r--src/Core/Declarative.idr44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/Core/Declarative.idr b/src/Core/Declarative.idr
index 2fff434..b6cd55e 100644
--- a/src/Core/Declarative.idr
+++ b/src/Core/Declarative.idr
@@ -147,16 +147,6 @@ data TermConv where
%name TermWf wf
%name TermConv conv
-public export
-data ThinWf : sx `Thins` sy -> Env sy -> Env sx -> Type where
- IdWf : ThinWf (id sx) env env
- DropWf : ThinWf thin env2 env1 -> ThinWf (drop thin n) (Add env2 t) env1
- KeepWf :
- ThinWf thin env2 env1 ->
- ThinWf (keep thin n) (Add env2 (shift t thin)) (Add env1 t)
-
-%name ThinWf thinWf
-
-- Environment Equality --------------------------------------------------------
envWfRespEnvEq : EnvWf env1 -> EnvEq env1 env2 -> EnvWf env2
@@ -268,39 +258,29 @@ termConvImpliesEnvWf (PiBeta wf wf1 wf2) = typeWfImpliesEnvWf wf
termConvImpliesEnvWf (PiEta wf wf1 wf2 conv) = typeWfImpliesEnvWf wf
termConvImpliesEnvWf (AppConv conv conv1) = termConvImpliesEnvWf conv
--- Weakening Composition -------------------------------------------------------
-
-CompWf : ThinWf thin2 env3 env2 -> ThinWf thin1 env2 env1 -> ThinWf (thin2 . thin1) env3 env1
-CompWf IdWf thinWf1 = rewrite compLeftIdentity thin1 in thinWf1
-CompWf (DropWf {thin = thin2, n} thinWf2) thinWf1 =
- rewrite compLeftDrop thin2 thin1 n in
- DropWf (CompWf thinWf2 thinWf1)
-CompWf (KeepWf {thin = thin2, n} thinWf2) IdWf =
- rewrite compRightIdentity $ keep thin2 n in
- KeepWf thinWf2
-CompWf (KeepWf {thin = thin2, n} thinWf2) (DropWf {thin = thin1} thinWf1) =
- rewrite compRightDrop thin2 thin1 n in
- DropWf (CompWf thinWf2 thinWf1)
-CompWf (KeepWf {thin = thin2, n} thinWf2) (KeepWf {thin = thin1, t} thinWf1) =
- rewrite compKeep thin2 thin1 n in
- rewrite shiftHomo t thin1 thin2 in
- KeepWf (CompWf thinWf2 thinWf1)
-
-- Weakening Preservation ------------------------------------------------------
wknPresTypeWf :
+ {0 env1 : Env sx} ->
TypeWf env1 a ->
- ThinWf thin env2 env1 ->
+ EnvWf env2 ->
+ IsExtension thin env2 env1 ->
TypeWf env2 (wkn a thin)
wknPresTypeConv :
+ {0 env1 : Env sx} ->
TypeConv env1 a b ->
- ThinWf thin env2 env1 ->
+ EnvWf env2 ->
+ IsExtension thin env2 env1 ->
TypeConv env2 (wkn a thin) (wkn b thin)
wknPresTermWf :
+ {0 env1 : Env sx} ->
TermWf env1 t a ->
- ThinWf thin env2 env1 ->
+ EnvWf env2 ->
+ IsExtension thin env2 env1 ->
TermWf env2 (wkn t thin) (wkn a thin)
wknPresTermConv :
+ {0 env1 : Env sx} ->
TermConv env1 t u a ->
- ThinWf thin env2 env1 ->
+ EnvWf env2 ->
+ IsExtension thin env2 env1 ->
TermConv env2 (wkn t thin) (wkn u thin) (wkn a thin)