summaryrefslogtreecommitdiff
path: root/FinMap.agda
diff options
context:
space:
mode:
authorHelmut Grohne <grohne@cs.uni-bonn.de>2013-12-16 17:34:59 +0100
committerHelmut Grohne <grohne@cs.uni-bonn.de>2013-12-16 17:34:59 +0100
commit2f999bfd6553cb31ebffe4c32d0a2a52dedaf4d3 (patch)
treec204596acfa8626c47c291f86f57ec8f51a50bd2 /FinMap.agda
parentce9855e6c2e8b88499ebd9660e0cd225146c1b6b (diff)
downloadbidiragda-2f999bfd6553cb31ebffe4c32d0a2a52dedaf4d3.tar.gz
move generic functions to a new Generic module
Diffstat (limited to 'FinMap.agda')
-rw-r--r--FinMap.agda5
1 files changed, 2 insertions, 3 deletions
diff --git a/FinMap.agda b/FinMap.agda
index a515a2f..46dbd1c 100644
--- a/FinMap.agda
+++ b/FinMap.agda
@@ -15,6 +15,8 @@ open import Relation.Binary.Core using (_≡_ ; refl ; _≢_)
open import Relation.Binary.PropositionalEquality using (cong ; sym ; _≗_ ; trans ; cong₂)
open Relation.Binary.PropositionalEquality.≡-Reasoning using (begin_ ; _≡⟨_⟩_ ; _∎)
+open import Generic using (just-injective)
+
FinMapMaybe : ℕ → Set → Set
FinMapMaybe n A = Vec (Maybe A) n
@@ -77,9 +79,6 @@ lemma-lookupM-insert-other zero (suc j) a (x ∷ xs) p = refl
lemma-lookupM-insert-other (suc i) zero a (x ∷ xs) p = refl
lemma-lookupM-insert-other (suc i) (suc j) a (x ∷ xs) p = lemma-lookupM-insert-other i j a xs (p ∘ cong suc)
-just-injective : {A : Set} → {x y : A} → _≡_ {_} {Maybe A} (just x) (just y) → x ≡ y
-just-injective refl = refl
-
lemma-lookupM-restrict : {A : Set} {n : ℕ} → (i : Fin n) → (f : Fin n → A) → (is : List (Fin n)) → (a : A) → lookupM i (restrict f is) ≡ just a → f i ≡ a
lemma-lookupM-restrict i f [] a p = lemma-just≢nothing p (lemma-lookupM-empty i)
lemma-lookupM-restrict i f (i' ∷ is) a p with i ≟ i'