Move Bool to live on its own (#118)

This commit is contained in:
Patrick Stevens
2020-04-18 17:14:39 +01:00
committed by GitHub
parent 264a5e2bd9
commit 84a146f72c
30 changed files with 270 additions and 123 deletions

28
Boolean/Definition.agda Normal file
View File

@@ -0,0 +1,28 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Boolean.Definition where
data Bool : Set where
BoolTrue : Bool
BoolFalse : Bool
{-# BUILTIN BOOL Bool #-}
{-# BUILTIN TRUE BoolTrue #-}
{-# BUILTIN FALSE BoolFalse #-}
if_then_else_ : {a : _} {A : Set a} Bool A A A
if BoolTrue then tr else fls = tr
if BoolFalse then tr else fls = fls
not : Bool Bool
not BoolTrue = BoolFalse
not BoolFalse = BoolTrue
boolAnd : Bool Bool Bool
boolAnd BoolTrue y = y
boolAnd BoolFalse y = BoolFalse
boolOr : Bool Bool Bool
boolOr BoolTrue y = BoolTrue
boolOr BoolFalse y = y