Use named modules to avoid having to pass redundant parameters

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2024-03-09 21:46:15 -08:00
parent 56c72e1388
commit 1b1b80465c
5 changed files with 42 additions and 35 deletions

View File

@@ -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