Use named modules to avoid having to pass redundant parameters
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -8,7 +8,10 @@ open import Data.List using (List)
|
||||
open import Data.Nat using (ℕ)
|
||||
open import Utils using (Unique)
|
||||
|
||||
module _ (fhB : FiniteHeightLattice B) where
|
||||
module FromFiniteHeightLattice (fhB : FiniteHeightLattice B)
|
||||
{ks : List A} (uks : Unique ks)
|
||||
(≈₂-dec : Decidable (FiniteHeightLattice._≈_ fhB)) where
|
||||
|
||||
open Lattice.FiniteHeightLattice fhB using () renaming
|
||||
( _≈_ to _≈₂_; _⊔_ to _⊔₂_; _⊓_ to _⊓₂_
|
||||
; height to height₂
|
||||
@@ -16,13 +19,12 @@ module _ (fhB : FiniteHeightLattice B) where
|
||||
; fixedHeight to fixedHeight₂
|
||||
)
|
||||
|
||||
module _ {ks : List A} (uks : Unique ks) (≈₂-dec : Decidable _≈₂_) where
|
||||
import Lattice.FiniteValueMap A B _≈₂_ _⊔₂_ _⊓₂_ ≡-dec-A isLattice₂ as FVM
|
||||
import Lattice.FiniteMap
|
||||
module FM = Lattice.FiniteMap A B _≈₂_ _⊔₂_ _⊓₂_ ≡-dec-A isLattice₂
|
||||
open FM.WithKeys ks public
|
||||
|
||||
FiniteHeightType = FVM.FiniteMap ks
|
||||
|
||||
finiteHeightLattice = FVM.IterProdIsomorphism.finiteHeightLattice uks ≈₂-dec height₂ fixedHeight₂
|
||||
open FiniteHeightLattice finiteHeightLattice public
|
||||
|
||||
≈-dec = FVM.≈-dec ks ≈₂-dec
|
||||
import Lattice.FiniteValueMap
|
||||
module FVM = Lattice.FiniteValueMap A B _≈₂_ _⊔₂_ _⊓₂_ ≡-dec-A isLattice₂
|
||||
open FVM.IterProdIsomorphism.WithUniqueKeysAndFixedHeight uks ≈₂-dec height₂ fixedHeight₂ public
|
||||
|
||||
≈-dec = ≈₂-dec⇒≈-dec ≈₂-dec
|
||||
|
||||
@@ -45,15 +45,15 @@ open import Relation.Nullary using (¬_; Dec; yes; no)
|
||||
open import Utils using (Pairwise; _∷_; [])
|
||||
open import Data.Empty using (⊥-elim)
|
||||
|
||||
module _ (ks : List A) where
|
||||
module WithKeys (ks : List A) where
|
||||
FiniteMap : Set (a ⊔ℓ b)
|
||||
FiniteMap = Σ Map (λ m → Map.keys m ≡ ks)
|
||||
|
||||
_≈_ : FiniteMap → FiniteMap → Set (a ⊔ℓ b)
|
||||
_≈_ (m₁ , _) (m₂ , _) = m₁ ≈ᵐ m₂
|
||||
|
||||
≈-dec : IsDecidable _≈₂_ → IsDecidable _≈_
|
||||
≈-dec ≈₂-dec fm₁ fm₂ = ≈ᵐ-dec ≈₂-dec (proj₁ fm₁) (proj₁ fm₂)
|
||||
≈₂-dec⇒≈-dec : IsDecidable _≈₂_ → IsDecidable _≈_
|
||||
≈₂-dec⇒≈-dec ≈₂-dec fm₁ fm₂ = ≈ᵐ-dec ≈₂-dec (proj₁ fm₁) (proj₁ fm₂)
|
||||
|
||||
_⊔_ : FiniteMap → FiniteMap → FiniteMap
|
||||
_⊔_ (m₁ , km₁≡ks) (m₂ , km₂≡ks) =
|
||||
@@ -174,3 +174,5 @@ module _ (ks : List A) where
|
||||
... | no k∉km₁ | no k∉km₂ = m₁≼m₂⇒m₁[ks]≼m₂[ks] fm₁ fm₂ ks'' m₁≼m₂
|
||||
... | 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
|
||||
|
||||
@@ -399,7 +399,7 @@ module IterProdIsomorphism where
|
||||
in
|
||||
(v' , (v₁⊔v₂≈v' , there v'∈fm'))
|
||||
|
||||
module _ {ks : List A} (uks : Unique ks) (≈₂-dec : Decidable _≈₂_) (h₂ : ℕ) (fhB : FixedHeight₂ h₂) where
|
||||
module WithUniqueKeysAndFixedHeight {ks : List A} (uks : Unique ks) (≈₂-dec : Decidable _≈₂_) (h₂ : ℕ) (fhB : FixedHeight₂ h₂) where
|
||||
import Isomorphism
|
||||
open Isomorphism.TransportFiniteHeight
|
||||
(IP.isFiniteHeightLattice (length ks) ≈₂-dec ≈ᵘ-dec h₂ 0 fhB fixedHeightᵘ) (isLattice ks)
|
||||
|
||||
Reference in New Issue
Block a user