Add instances for decidability and finite height lattices
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
99cc5af243
commit
e62f429b86
28
Lattice.agda
28
Lattice.agda
|
@ -3,12 +3,12 @@ module Lattice where
|
||||||
import Data.Nat.Properties as NatProps
|
import Data.Nat.Properties as NatProps
|
||||||
open import Relation.Binary.PropositionalEquality as Eq using (_≡_; sym)
|
open import Relation.Binary.PropositionalEquality as Eq using (_≡_; sym)
|
||||||
open import Relation.Binary.Definitions
|
open import Relation.Binary.Definitions
|
||||||
|
open import Relation.Nullary using (Dec; ¬_)
|
||||||
open import Data.Nat as Nat using (ℕ; _≤_)
|
open import Data.Nat as Nat using (ℕ; _≤_)
|
||||||
open import Data.Product using (_×_; _,_)
|
open import Data.Product using (_×_; Σ; _,_)
|
||||||
open import Data.Sum using (_⊎_; inj₁; inj₂)
|
open import Data.Sum using (_⊎_; inj₁; inj₂)
|
||||||
open import Agda.Primitive using (lsuc; Level)
|
open import Agda.Primitive using (lsuc; Level)
|
||||||
|
open import Chain using (Chain; Height)
|
||||||
open import NatMap using (NatMap)
|
|
||||||
|
|
||||||
record IsEquivalence {a} (A : Set a) (_≈_ : A → A → Set a) : Set a where
|
record IsEquivalence {a} (A : Set a) (_≈_ : A → A → Set a) : Set a where
|
||||||
field
|
field
|
||||||
|
@ -16,6 +16,10 @@ record IsEquivalence {a} (A : Set a) (_≈_ : A → A → Set a) : Set a where
|
||||||
≈-sym : {a b : A} → a ≈ b → b ≈ a
|
≈-sym : {a b : A} → a ≈ b → b ≈ a
|
||||||
≈-trans : {a b c : A} → a ≈ b → b ≈ c → a ≈ c
|
≈-trans : {a b c : A} → a ≈ b → b ≈ c → a ≈ c
|
||||||
|
|
||||||
|
record IsDecidable {a} (A : Set a) (R : A → A → Set a) : Set a where
|
||||||
|
field
|
||||||
|
R-dec : ∀ (a₁ a₂ : A) → Dec (R a₁ a₂)
|
||||||
|
|
||||||
record IsSemilattice {a} (A : Set a)
|
record IsSemilattice {a} (A : Set a)
|
||||||
(_≈_ : A → A → Set a)
|
(_≈_ : A → A → Set a)
|
||||||
(_⊔_ : A → A → A) : Set a where
|
(_⊔_ : A → A → A) : Set a where
|
||||||
|
@ -48,6 +52,24 @@ record IsLattice {a} (A : Set a)
|
||||||
; ⊔-idemp to ⊓-idemp
|
; ⊔-idemp to ⊓-idemp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
record IsFiniteHeightLattice {a} (A : Set a)
|
||||||
|
(h : ℕ)
|
||||||
|
(_≈_ : A → A → Set a)
|
||||||
|
(_⊔_ : A → A → A)
|
||||||
|
(_⊓_ : A → A → A) : Set (lsuc a) where
|
||||||
|
|
||||||
|
_≼_ : A → A → Set a
|
||||||
|
a ≼ b = Σ A (λ c → (a ⊔ c) ≈ b)
|
||||||
|
|
||||||
|
_≺_ : A → A → Set a
|
||||||
|
a ≺ b = (a ≼ b) × (¬ a ≈ b)
|
||||||
|
|
||||||
|
field
|
||||||
|
isLattice : IsLattice A _≈_ _⊔_ _⊓_
|
||||||
|
fixedHeight : Height _≺_ h
|
||||||
|
|
||||||
|
open IsLattice isLattice public
|
||||||
|
|
||||||
record Semilattice {a} (A : Set a) : Set (lsuc a) where
|
record Semilattice {a} (A : Set a) : Set (lsuc a) where
|
||||||
field
|
field
|
||||||
_≈_ : A → A → Set a
|
_≈_ : A → A → Set a
|
||||||
|
|
Loading…
Reference in New Issue
Block a user