Parameterize FiniteMap by its keys right away
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -9,10 +9,10 @@ module Lattice.FiniteMap (A : Set) (B : Set)
|
||||
{_≈₂_ : B → B → Set}
|
||||
{_⊔₂_ : B → B → B} {_⊓₂_ : B → B → B}
|
||||
{{≡-Decidable-A : IsDecidable {_} {A} _≡_}}
|
||||
{{lB : IsLattice B _≈₂_ _⊔₂_ _⊓₂_}} (dummy : ⊤) where
|
||||
{{lB : IsLattice B _≈₂_ _⊔₂_ _⊓₂_}} (ks : List A) where
|
||||
|
||||
open IsLattice lB using () renaming (_≼_ to _≼₂_)
|
||||
open import Lattice.Map A B dummy as Map
|
||||
open import Lattice.Map A B _ as Map
|
||||
using
|
||||
( Map
|
||||
; ⊔-equal-keys
|
||||
@@ -74,7 +74,7 @@ open import Showable using (Showable; show)
|
||||
open import Isomorphism using (IsInverseˡ; IsInverseʳ)
|
||||
open import Chain using (Height)
|
||||
|
||||
module WithKeys (ks : List A) where
|
||||
private module WithKeys (ks : List A) where
|
||||
FiniteMap : Set
|
||||
FiniteMap = Σ Map (λ m → Map.keys m ≡ ks)
|
||||
|
||||
@@ -131,7 +131,7 @@ module WithKeys (ks : List A) where
|
||||
|
||||
[]-∈ : ∀ {k : A} {v : B} {ks' : List A} (fm : FiniteMap) →
|
||||
k ∈ˡ ks' → (k , v) ∈ fm → v ∈ˡ (fm [ ks' ])
|
||||
[]-∈ {k} {v} {ks'} (m , _) k∈ks' k,v∈fm = []ᵐ-∈ m k,v∈fm k∈ks'
|
||||
[]-∈ {k} {v} {ks'} (m , _) k∈ks' k,v∈fm = []ᵐ-∈ m k,v∈fm k∈ks'
|
||||
|
||||
≈-equiv : IsEquivalence FiniteMap _≈_
|
||||
≈-equiv = record
|
||||
@@ -253,9 +253,8 @@ module WithKeys (ks : List A) where
|
||||
... | yes k∈km₁ | no k∉km₂ = ⊥-elim (∈k-exclusive fm₁ fm₂ (k∈km₁ , k∉km₂))
|
||||
... | no k∉km₁ | yes k∈km₂ = ⊥-elim (∈k-exclusive fm₂ fm₁ (k∈km₂ , k∉km₁))
|
||||
|
||||
open WithKeys public
|
||||
|
||||
module IterProdIsomorphism where
|
||||
open WithKeys
|
||||
open import Data.Unit using (tt)
|
||||
open import Lattice.Unit using ()
|
||||
renaming
|
||||
@@ -267,7 +266,7 @@ module IterProdIsomorphism where
|
||||
; ≈-equiv to ≈ᵘ-equiv
|
||||
; fixedHeight to fixedHeightᵘ
|
||||
)
|
||||
open import Lattice.IterProd B ⊤ dummy
|
||||
open import Lattice.IterProd B ⊤ _
|
||||
as IP
|
||||
using (IterProd)
|
||||
open IsLattice lB using ()
|
||||
@@ -631,3 +630,5 @@ module IterProdIsomorphism where
|
||||
⊥-contains-bottoms {k} {v} k,v∈⊥
|
||||
rewrite IP.⊥-built {length ks} {{fhB = fixedHeightᵘ}} =
|
||||
to-build uks k v k,v∈⊥
|
||||
|
||||
open WithKeys ks public
|
||||
|
||||
Reference in New Issue
Block a user