diff options
author | Helmut Grohne <helmut@subdivi.de> | 2013-04-19 12:08:55 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2013-04-19 12:08:55 +0200 |
commit | dd95d0924df51daeac7176d4010a30d34bae2b02 (patch) | |
tree | 080317d093d020ef6ad143c1c7db1f3993243501 /Bidir.agda | |
parent | 66ff6ff465825e1fe0d5b2d65b3d3860dedae97d (diff) | |
download | bidiragda-dd95d0924df51daeac7176d4010a30d34bae2b02.tar.gz |
move lemma-\notin-lookupM-assoc to Precond
This removes imports.
Diffstat (limited to 'Bidir.agda')
-rw-r--r-- | Bidir.agda | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -4,20 +4,15 @@ module Bidir (Carrier : Set) (deq : Decidable {A = Carrier} _≡_) where open import Data.Nat using (ℕ) open import Data.Fin using (Fin) -open import Data.Fin.Props using (_≟_) open import Data.Maybe using (Maybe ; nothing ; just ; maybe′) open import Data.List using (List) -open import Data.List.Any using (here ; there) open import Data.List.All using (All) -open Data.List.Any.Membership-≡ using (_∉_) -open import Data.Vec using (Vec ; [] ; _∷_ ; toList ; fromList ; map ; tabulate) renaming (lookup to lookupVec) +open import Data.Vec using (Vec ; [] ; _∷_ ; toList ; map ; tabulate) renaming (lookup to lookupVec) open import Data.Vec.Properties using (tabulate-∘ ; lookup∘tabulate ; map-cong ; map-∘) open import Data.Product using (∃ ; _×_ ; _,_ ; proj₁ ; proj₂) -open import Data.Empty using (⊥-elim) open import Function using (id ; _∘_ ; flip) -open import Relation.Nullary using (yes ; no) open import Relation.Binary.Core using (refl) -open import Relation.Binary.PropositionalEquality using (cong ; sym ; inspect ; [_] ; _≗_ ; trans ; cong₂) +open import Relation.Binary.PropositionalEquality using (cong ; sym ; inspect ; [_] ; trans ; cong₂) open Relation.Binary.PropositionalEquality.≡-Reasoning using (begin_ ; _≡⟨_⟩_ ; _∎) import FreeTheorems @@ -45,17 +40,6 @@ lemma-lookupM-assoc i is x xs .h refl | just h | ._ | same pl = pl lemma-lookupM-assoc i is x xs ._ refl | just h' | ._ | new _ = lemma-lookupM-insert i x h' lemma-lookupM-assoc i is x xs h () | just h' | ._ | wrong _ _ _ -lemma-∉-lookupM-assoc : {m n : ℕ} → (i : Fin n) → (is : Vec (Fin n) m) → (xs : Vec Carrier m) → (h : FinMapMaybe n Carrier) → assoc is xs ≡ just h → (i ∉ toList is) → lookupM i h ≡ nothing -lemma-∉-lookupM-assoc i [] [] .empty refl i∉is = lemma-lookupM-empty i -lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h ph i∉is with assoc is' xs' | inspect (assoc is') xs' -lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h () i∉is | nothing | [ ph' ] -lemma-∉-lookupM-assoc i (i' ∷ is') (x' ∷ xs') h ph i∉is | just h' | [ ph' ] = begin - lookupM i h - ≡⟨ sym (lemma-lookupM-checkInsert-other i i' (i∉is ∘ here) x' h' h ph) ⟩ - lookupM i h' - ≡⟨ lemma-∉-lookupM-assoc i is' xs' h' ph' (i∉is ∘ there) ⟩ - nothing ∎ - _in-domain-of_ : {n : ℕ} {A : Set} → (is : List (Fin n)) → (FinMapMaybe n A) → Set _in-domain-of_ is h = All (λ i → ∃ λ x → lookupM i h ≡ just x) is |