Make 'IsDecidable' into a record to aid instance search
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ open import Lattice.Map ≡-dec-A lB as Map
|
||||
; ⊓-idemp to ⊓ᵐ-idemp
|
||||
; absorb-⊔-⊓ to absorb-⊔ᵐ-⊓ᵐ
|
||||
; absorb-⊓-⊔ to absorb-⊓ᵐ-⊔ᵐ
|
||||
; ≈-dec to ≈ᵐ-dec
|
||||
; ≈-Decidable to ≈ᵐ-Decidable
|
||||
; _[_] to _[_]ᵐ
|
||||
; []-∈ to []ᵐ-∈
|
||||
; m₁≼m₂⇒m₁[k]≼m₂[k] to m₁≼m₂⇒m₁[k]ᵐ≼m₂[k]ᵐ
|
||||
@@ -67,7 +67,6 @@ open import Data.Nat using (ℕ)
|
||||
open import Data.Product using (_×_; _,_; Σ; proj₁; proj₂)
|
||||
open import Equivalence
|
||||
open import Function using (_∘_)
|
||||
open import Relation.Binary.Definitions using (Decidable)
|
||||
open import Relation.Nullary using (¬_; Dec; yes; no)
|
||||
open import Utils using (Pairwise; _∷_; []; Unique; push; empty; All¬-¬Any)
|
||||
open import Showable using (Showable; show)
|
||||
@@ -86,8 +85,11 @@ module WithKeys (ks : List A) where
|
||||
_≈_ : FiniteMap → FiniteMap → Set
|
||||
_≈_ (m₁ , _) (m₂ , _) = m₁ ≈ᵐ m₂
|
||||
|
||||
≈₂-dec⇒≈-dec : IsDecidable _≈₂_ → IsDecidable _≈_
|
||||
≈₂-dec⇒≈-dec ≈₂-dec fm₁ fm₂ = ≈ᵐ-dec ≈₂-dec (proj₁ fm₁) (proj₁ fm₂)
|
||||
≈₂-Decidable⇒≈-Decidable : IsDecidable _≈₂_ → IsDecidable _≈_
|
||||
≈₂-Decidable⇒≈-Decidable ≈₂-Decidable = record
|
||||
{ R-dec = λ fm₁ fm₂ → IsDecidable.R-dec (≈ᵐ-Decidable ≈₂-Decidable)
|
||||
(proj₁ fm₁) (proj₁ fm₂)
|
||||
}
|
||||
|
||||
_⊔_ : FiniteMap → FiniteMap → FiniteMap
|
||||
_⊔_ (m₁ , km₁≡ks) (m₂ , km₂≡ks) =
|
||||
@@ -257,7 +259,7 @@ module IterProdIsomorphism where
|
||||
( _≈_ to _≈ᵘ_
|
||||
; _⊔_ to _⊔ᵘ_
|
||||
; _⊓_ to _⊓ᵘ_
|
||||
; ≈-dec to ≈ᵘ-dec
|
||||
; ≈-Decidable to ≈ᵘ-Decidable
|
||||
; isLattice to isLatticeᵘ
|
||||
; ≈-equiv to ≈ᵘ-equiv
|
||||
; fixedHeight to fixedHeightᵘ
|
||||
@@ -608,10 +610,10 @@ module IterProdIsomorphism where
|
||||
in
|
||||
(v' , (v₁⊔v₂≈v' , there v'∈fm'))
|
||||
|
||||
module WithUniqueKeysAndFixedHeight {ks : List A} (uks : Unique ks) (≈₂-dec : Decidable _≈₂_) (h₂ : ℕ) (fhB : FixedHeight₂ h₂) where
|
||||
module WithUniqueKeysAndFixedHeight {ks : List A} (uks : Unique ks) (≈₂-Decidable : IsDecidable _≈₂_) (h₂ : ℕ) (fhB : FixedHeight₂ h₂) where
|
||||
import Isomorphism
|
||||
open Isomorphism.TransportFiniteHeight
|
||||
(IP.isFiniteHeightLattice (length ks) ≈₂-dec ≈ᵘ-dec h₂ 0 fhB fixedHeightᵘ) (isLattice ks)
|
||||
(IP.isFiniteHeightLattice (length ks) ≈₂-Decidable ≈ᵘ-Decidable h₂ 0 fhB fixedHeightᵘ) (isLattice ks)
|
||||
{f = to uks} {g = from {ks}}
|
||||
(to-preserves-≈ uks) (from-preserves-≈ {ks})
|
||||
(to-⊔-distr uks) (from-⊔-distr {ks})
|
||||
@@ -624,5 +626,5 @@ module IterProdIsomorphism where
|
||||
|
||||
⊥-contains-bottoms : ∀ {k : A} {v : B} → (k , v) ∈ᵐ ⊥ → v ≡ (Height.⊥ fhB)
|
||||
⊥-contains-bottoms {k} {v} k,v∈⊥
|
||||
rewrite IP.⊥-built (length ks) ≈₂-dec ≈ᵘ-dec h₂ 0 fhB fixedHeightᵘ =
|
||||
rewrite IP.⊥-built (length ks) ≈₂-Decidable ≈ᵘ-Decidable h₂ 0 fhB fixedHeightᵘ =
|
||||
to-build uks k v k,v∈⊥
|
||||
|
||||
Reference in New Issue
Block a user