Make 'IsDecidable' into a record to aid instance search
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -5,13 +5,14 @@ open import Relation.Nullary using (Dec; ¬_; yes; no)
|
||||
module Lattice.AboveBelow {a} (A : Set a)
|
||||
(_≈₁_ : A → A → Set a)
|
||||
(≈₁-equiv : IsEquivalence A _≈₁_)
|
||||
(≈₁-dec : IsDecidable _≈₁_) where
|
||||
(≈₁-Decidable : IsDecidable _≈₁_) where
|
||||
|
||||
open import Data.Empty using (⊥-elim)
|
||||
open import Data.Product using (_,_)
|
||||
open import Data.Nat using (_≤_; ℕ; z≤n; s≤s; suc)
|
||||
open import Function using (_∘_)
|
||||
open import Showable using (Showable; show)
|
||||
open import Relation.Binary.Definitions using (Decidable)
|
||||
open import Relation.Binary.PropositionalEquality as Eq
|
||||
using (_≡_; sym; subst; refl)
|
||||
|
||||
@@ -20,6 +21,8 @@ import Chain
|
||||
open IsEquivalence ≈₁-equiv using ()
|
||||
renaming (≈-refl to ≈₁-refl; ≈-sym to ≈₁-sym; ≈-trans to ≈₁-trans)
|
||||
|
||||
open IsDecidable ≈₁-Decidable using () renaming (R-dec to ≈₁-dec)
|
||||
|
||||
data AboveBelow : Set a where
|
||||
⊥ : AboveBelow
|
||||
⊤ : AboveBelow
|
||||
@@ -62,7 +65,7 @@ data _≈_ : AboveBelow → AboveBelow → Set a where
|
||||
; ≈-trans = ≈-trans
|
||||
}
|
||||
|
||||
≈-dec : IsDecidable _≈_
|
||||
≈-dec : Decidable _≈_
|
||||
≈-dec ⊥ ⊥ = yes ≈-⊥-⊥
|
||||
≈-dec ⊤ ⊤ = yes ≈-⊤-⊤
|
||||
≈-dec [ x ] [ y ]
|
||||
@@ -76,6 +79,9 @@ data _≈_ : AboveBelow → AboveBelow → Set a where
|
||||
≈-dec [ x ] ⊥ = no λ ()
|
||||
≈-dec [ x ] ⊤ = no λ ()
|
||||
|
||||
≈-Decidable : IsDecidable _≈_
|
||||
≈-Decidable = record { R-dec = ≈-dec }
|
||||
|
||||
-- Any object can be wrapped in an 'above below' to make it a lattice,
|
||||
-- since ⊤ and ⊥ are the largest and least elements, and the rest are left
|
||||
-- unordered. That's what this module does.
|
||||
|
||||
Reference in New Issue
Block a user