123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475-------------------------------------------------------------------------- The Agda standard library---- The type for booleans and some operations------------------------------------------------------------------------ {-# OPTIONS --cubical-compatible --safe #-} module Data.Bool.Base where open import Data.Unit.Base using (⊤)open import Data.Emptyopen import Level using (Level) private variable a : Level A : Set a -------------------------------------------------------------------------- The boolean type open import Agda.Builtin.Bool public -------------------------------------------------------------------------- Relations infix 4 _≤_ _<_ data _≤_ : Bool → Bool → Set where f≤t : false ≤ true b≤b : ∀ {b} → b ≤ b data _<_ : Bool → Bool → Set where f<t : false < true -------------------------------------------------------------------------- Boolean operations infixr 6 _∧_infixr 5 _∨_ _xor_ not : Bool → Boolnot true = falsenot false = true _∧_ : Bool → Bool → Booltrue ∧ b = bfalse ∧ b = false _∨_ : Bool → Bool → Booltrue ∨ b = truefalse ∨ b = b _xor_ : Bool → Bool → Booltrue xor b = not bfalse xor b = b -------------------------------------------------------------------------- Conversion to Set -- A function mapping true to an inhabited type and false to an empty-- type.T : Bool → SetT true = ⊤T false = ⊥ -------------------------------------------------------------------------- Other operations infix 0 if_then_else_ if_then_else_ : Bool → A → A → Aif true then t else f = tif false then t else f = f