From e7557267586b4c197663919ee83fa3e5c40e28f9 Mon Sep 17 00:00:00 2001 From: Chloe Brown Date: Tue, 23 Jan 2024 14:54:53 +0000 Subject: Prove derivations are structurally unique. --- README.org | 7 +-- src/Cfe/Derivation/Base.agda | 5 ++- src/Cfe/Derivation/Properties.agda | 92 ++++++++++++++++++++++++++++++-------- src/Cfe/Type/Properties.agda | 27 +++++++++++ 4 files changed, 105 insertions(+), 26 deletions(-) diff --git a/README.org b/README.org index 666898e..b4d808c 100644 --- a/README.org +++ b/README.org @@ -9,7 +9,7 @@ Parsing]]. - [X] Proposition 3.2 :: ~Cfe.Expression.Properties.⟦⟧-mono-env~ - [X] Lemma 3.3 :: ~Cfe.Language.Properties.∪-selective~ - [X] Lemma 3.4 :: ~Cfe.Language.Properties.∙-unique~ -- [ ] Lemma 3.5 :: throughout ~Cfe.Language.Properties~. In the paper, statement +- [-] Lemma 3.5 :: throughout ~Cfe.Language.Properties~. In the paper, statement 2 is false; a language satisfying \(\tau_\epsilon\) is at most \(\{\epsilon\}\). - [X] 1 - [X] 2 @@ -22,9 +22,6 @@ Parsing]]. - [X] Lemma 4.2 :: throughout ~Cfe.Judgement.Properties~ - [X] Theorem 4.3 :: ~Cfe.Judgement.Properties.soundness~ - [X] Lemma 4.4 :: ~Cfe.Judgement.Properties.subst₂-pres-rank~ -- [ ] Theorem 4.5 :: throughout ~Cfe.Derivation.Properties~ - - [X] Semantics to derivation - - [X] Derivation to semantics - - [ ] Uniqueness of derivation +- [X] Theorem 4.5 :: throughout ~Cfe.Derivation.Properties~ - [ ] Theorem 4.6 :: - [ ] Theorem 4.7 :: diff --git a/src/Cfe/Derivation/Base.agda b/src/Cfe/Derivation/Base.agda index 0432c3d..373b6b5 100644 --- a/src/Cfe/Derivation/Base.agda +++ b/src/Cfe/Derivation/Base.agda @@ -13,6 +13,7 @@ open import Data.Fin using (zero) open import Data.List using (List; []; [_]; _++_) open import Data.List.Relation.Binary.Equality.Setoid over using (_≋_) open import Level using (_⊔_) +open import Relation.Binary.Core using (Rel) infix 5 _⤇_ infix 4 _≈_ @@ -29,10 +30,10 @@ data _≈_ : ∀ {e w w′} → REL (e ⤇ w) (e ⤇ w′) (c ⊔ ℓ) where Eps : Eps ≈ Eps Char : ∀ {c y y′} → (c∼y : c ∼ y) → (c∼y′ : c ∼ y′) → Char c∼y ≈ Char c∼y′ Cat : - ∀ {e₁ e₂ w w₁ w₂ w₁′ w₂′ e₁⤇w₁ e₁⤇w₁′ e₂⤇w₂ e₂⤇w₂′} → + ∀ {e₁ e₂ w w′ w₁ w₂ w₁′ w₂′ e₁⤇w₁ e₁⤇w₁′ e₂⤇w₂ e₂⤇w₂′} → (e₁⤇w₁≈e₁⤇w′ : _≈_ {e₁} {w₁} {w₁′} e₁⤇w₁ e₁⤇w₁′) → (e₂⤇w₂≈e₂⤇w′ : _≈_ {e₂} {w₂} {w₂′} e₂⤇w₂ e₂⤇w₂′) → - (eq : w₁ ++ w₂ ≋ w) → (eq′ : w₁′ ++ w₂′ ≋ w) → + (eq : w₁ ++ w₂ ≋ w) → (eq′ : w₁′ ++ w₂′ ≋ w′) → Cat e₁⤇w₁ e₂⤇w₂ eq ≈ Cat e₁⤇w₁′ e₂⤇w₂′ eq′ Veeˡ : ∀ {e₁ e₂ w w′ e₁⤇w e₁⤇w′} → diff --git a/src/Cfe/Derivation/Properties.agda b/src/Cfe/Derivation/Properties.agda index 99be370..7167465 100644 --- a/src/Cfe/Derivation/Properties.agda +++ b/src/Cfe/Derivation/Properties.agda @@ -10,24 +10,24 @@ open Setoid over using () renaming (Carrier to C) open import Cfe.Context over using (_⊐_; Γ,Δ; ∙,∙; remove₁) renaming (wkn₂ to wkn₂ᶜ) open import Cfe.Derivation.Base over -open import Cfe.Expression over +open import Cfe.Expression over hiding (_≈_) open import Cfe.Fin using (zero; inj; raise!>; cast>) open import Cfe.Judgement over open import Cfe.Language over hiding (_∙_) renaming (_≈_ to _≈ˡ_; ≈-refl to ≈ˡ-refl; ≈-reflexive to ≈ˡ-reflexive; ≈-sym to ≈ˡ-sym) -open import Cfe.Type over using (_⊛_; _⊨_) +open import Cfe.Type over using (_⊛_; _⊨_; #⇒selective; ⊛⇒uniqueₗ; ⊛⇒uniqueᵣ) open import Cfe.Vec.Relation.Binary.Pointwise.Inductive using (Pointwise-insert) open import Data.Empty using (⊥-elim) open import Data.Fin using (Fin; zero; suc; _≟_; punchOut; punchIn) open import Data.Fin.Properties using (punchIn-punchOut) open import Data.List using (List; []; length; _++_) open import Data.List.Properties using (length-++) -open import Data.List.Relation.Binary.Equality.Setoid over using (_≋_; []; _∷_) +open import Data.List.Relation.Binary.Equality.Setoid over using (_≋_; []; _∷_; ≋-refl) open import Data.List.Relation.Binary.Pointwise using (Pointwise-length) open import Data.Nat using (ℕ; zero; suc; z≤n; s≤s; _+_) renaming (_≤_ to _≤ⁿ_) open import Data.Nat.Properties using (n<1+n; m≤m+n; m≤n+m; m≤n⇒m