File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/Relation/Nullary/Decidable Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ open import Agda.Builtin.Maybe using (Maybe; just; nothing)
1818open import Agda.Builtin.Equality using (_≡_)
1919open import Level using (Level)
2020open import Data.Bool.Base using (Bool; T; false; true; not; _∧_; _∨_)
21- open import Data.Unit.Polymorphic.Base using (⊤)
21+ open import Data.Unit.Polymorphic.Base using (⊤; tt)
22+ open import Data.Empty.Polymorphic using (⊥)
2223open import Data.Product.Base using (_×_)
2324open import Data.Sum.Base using (_⊎_; inj₁; inj₂)
2425open import Function.Base using (_∘_; const; _$_; flip)
@@ -95,10 +96,18 @@ T? x = x because T-reflects x
9596does (¬? a?) = not (does a?)
9697proof (¬? a?) = ¬-reflects (proof a?)
9798
99+ ⊤-dec : Dec {a} ⊤
100+ does ⊤-dec = true
101+ proof ⊤-dec = ofʸ tt
102+
98103_×-dec_ : Dec A → Dec B → Dec (A × B)
99104does (a? ×-dec b?) = does a? ∧ does b?
100105proof (a? ×-dec b?) = proof a? ×-reflects proof b?
101106
107+ ⊥-dec : Dec {a} ⊥
108+ does ⊥-dec = false
109+ proof ⊥-dec = ofⁿ λ ()
110+
102111_⊎-dec_ : Dec A → Dec B → Dec (A ⊎ B)
103112does (a? ⊎-dec b?) = does a? ∨ does b?
104113proof (a? ⊎-dec b?) = proof a? ⊎-reflects proof b?
You can’t perform that action at this time.
0 commit comments