Make 'isLattice' for simple types be an instance
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
4da9b6d3cd
commit
8abf6f8670
@ -18,6 +18,7 @@ private
|
||||
≡-⊓-cong : ∀ {a₁ a₂ a₃ a₄} → a₁ ≡ a₂ → a₃ ≡ a₄ → (a₁ ⊓ a₃) ≡ (a₂ ⊓ a₄)
|
||||
≡-⊓-cong a₁≡a₂ a₃≡a₄ rewrite a₁≡a₂ rewrite a₃≡a₄ = refl
|
||||
|
||||
instance
|
||||
isMaxSemilattice : IsSemilattice ℕ _≡_ _⊔_
|
||||
isMaxSemilattice = record
|
||||
{ ≈-equiv = record
|
||||
@ -74,6 +75,7 @@ private
|
||||
helper : x ⊔ (x ⊓ y) ≤ x ⊔ x → x ⊔ x ≡ x → x ⊔ (x ⊓ y) ≤ x
|
||||
helper x⊔x⊓y≤x⊔x x⊔x≡x rewrite x⊔x≡x = x⊔x⊓y≤x⊔x
|
||||
|
||||
instance
|
||||
isLattice : IsLattice ℕ _≡_ _⊔_ _⊓_
|
||||
isLattice = record
|
||||
{ joinSemilattice = isMaxSemilattice
|
||||
|
@ -45,6 +45,7 @@ tt ⊓ tt = tt
|
||||
⊔-idemp : (x : ⊤) → (x ⊔ x) ≈ x
|
||||
⊔-idemp tt = Eq.refl
|
||||
|
||||
instance
|
||||
isJoinSemilattice : IsSemilattice ⊤ _≈_ _⊔_
|
||||
isJoinSemilattice = record
|
||||
{ ≈-equiv = ≈-equiv
|
||||
@ -66,6 +67,7 @@ isJoinSemilattice = record
|
||||
⊓-idemp : (x : ⊤) → (x ⊓ x) ≈ x
|
||||
⊓-idemp tt = Eq.refl
|
||||
|
||||
instance
|
||||
isMeetSemilattice : IsSemilattice ⊤ _≈_ _⊓_
|
||||
isMeetSemilattice = record
|
||||
{ ≈-equiv = ≈-equiv
|
||||
@ -75,18 +77,13 @@ isMeetSemilattice = record
|
||||
; ⊔-idemp = ⊓-idemp
|
||||
}
|
||||
|
||||
absorb-⊔-⊓ : (x y : ⊤) → (x ⊔ (x ⊓ y)) ≈ x
|
||||
absorb-⊔-⊓ tt tt = Eq.refl
|
||||
|
||||
absorb-⊓-⊔ : (x y : ⊤) → (x ⊓ (x ⊔ y)) ≈ x
|
||||
absorb-⊓-⊔ tt tt = Eq.refl
|
||||
|
||||
instance
|
||||
isLattice : IsLattice ⊤ _≈_ _⊔_ _⊓_
|
||||
isLattice = record
|
||||
{ joinSemilattice = isJoinSemilattice
|
||||
; meetSemilattice = isMeetSemilattice
|
||||
; absorb-⊔-⊓ = absorb-⊔-⊓
|
||||
; absorb-⊓-⊔ = absorb-⊓-⊔
|
||||
; absorb-⊔-⊓ = λ { tt tt → Eq.refl }
|
||||
; absorb-⊓-⊔ = λ { tt tt → Eq.refl }
|
||||
}
|
||||
|
||||
lattice : Lattice ⊤
|
||||
@ -107,6 +104,7 @@ private
|
||||
isLongest {tt} {tt} (step (tt⊔tt≈tt , tt̷≈tt) _ _) = ⊥-elim (tt̷≈tt refl)
|
||||
isLongest (done _) = z≤n
|
||||
|
||||
instance
|
||||
fixedHeight : IsLattice.FixedHeight isLattice 0
|
||||
fixedHeight = record
|
||||
{ ⊥ = tt
|
||||
|
Loading…
Reference in New Issue
Block a user