This commit is contained in:
Philip Wadler 2017-06-27 14:22:52 +01:00
parent b9b05b1347
commit 77390abcc9
4 changed files with 15911 additions and 12626 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -483,12 +483,7 @@ just-injective refl = refl
preservation-[:=] {_} {x} (Ax {_} {x} [Γ,x↦A]x≡B) ⊢V with x ≟ x
...| yes x≡x rewrite just-injective [Γ,x↦A]x≡B = weaken-closed ⊢V
...| no x≢x = Ax [Γ,x↦A]x≡B
{-
preservation-[:=] {Γ} {x} {A} {varᵀ x} {B} {V} (Ax {.(Γ , x ↦ A)} {.x} {.B} Γx≡B) ⊢V with x ≟ x
...| yes x≡x rewrite just-injective Γx≡B = weaken-closed ⊢V
...| no x≢x = Ax {Γ} {x} {B} Γx≡B
-}
preservation-[:=] {Γ} {x} {A} {λᵀ x ∈ A ⇒ N} {.A ⇒ B} {V} (⇒-I {.(Γ , x ↦ A)} {.x} {.N} {.A} {.B} ⊢N) ⊢V with x ≟ x
preservation-[:=] {Γ} {x} {A} {λᵀ x ∈ A ⇒ N} {.A ⇒ B} {V} (⇒-I ⊢N) ⊢V with x ≟ x
...| yes x≡x rewrite x≡x = weaken Γ′~Γ (⇒-I ⊢N)
where
Γ′~Γ : ∀ {y} → y FreeIn (λᵀ x ∈ A ⇒ N) → (Γ , x ↦ A) y ≡ Γ y
@ -498,35 +493,14 @@ preservation-[:=] {Γ} {x} {A} {λᵀ x ∈ A ⇒ N} {.A ⇒ B} {
...| no x≢x = ⇒-I ⊢NV
where
xx⊢N : (Γ , x ↦ A , x ↦ A) ⊢ N ∈ B
xx⊢N rewrite update-permute Γ x A x A x≢x = {!⊢N!}
xx⊢N rewrite update-permute Γ x A x A x≢x = ⊢N
⊢NV : (Γ , x ↦ A) ⊢ N [ x := V ] ∈ B
⊢NV = preservation-[:=] xx⊢N ⊢V
{-
...| yes x≡x rewrite x≡x | update-shadow Γ x A A = {!!}
-- ⇒-I ⊢N
...| no x≢x rewrite update-permute Γ x A x A x≢x = {!!}
-- ⇒-I {Γ} {x} {N} {A} {B} (preservation-[:=] {(Γ , x ↦ A)} {x} {A} ⊢N ⊢V)
-}
preservation-[:=] (⇒-E ⊢L ⊢M) ⊢V = ⇒-E (preservation-[:=] ⊢L ⊢V) (preservation-[:=] ⊢M ⊢V)
preservation-[:=] 𝔹-I₁ ⊢V = 𝔹-I₁
preservation-[:=] 𝔹-I₂ ⊢V = 𝔹-I₂
preservation-[:=] (𝔹-E ⊢L ⊢M ⊢N) ⊢V =
𝔹-E (preservation-[:=] ⊢L ⊢V) (preservation-[:=] ⊢M ⊢V) (preservation-[:=] ⊢N ⊢V)
{-
[:=]-preserves-⊢ {Γ} {x} vA (var y y∈Γ) with x ≟ y
... | yes x=y = {!!}
... | no x≠y = {!!}
[:=]-preserves-⊢ vA (abs tB) = {!!}
[:=]-preserves-⊢ vA (app t₁A⇒B t₂A) =
app ([:=]-preserves-⊢ vA t₁A⇒B) ([:=]-preserves-⊢ vA t₂A)
[:=]-preserves-⊢ vA true = true
[:=]-preserves-⊢ vA false = false
[:=]-preserves-⊢ vA (if t₁bool then t₂B else t₃B) =
if [:=]-preserves-⊢ vA t₁bool
then [:=]-preserves-⊢ vA t₂B
else [:=]-preserves-⊢ vA t₃B
-}
\end{code}