comparison boolean.agda @ 2:ca2e9f7a7898

Add De Morgan's laws
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Tue, 13 May 2014 11:14:49 +0900
parents
children
comparison
equal deleted inserted replaced
1:f300bd2101d3 2:ca2e9f7a7898
1 open import systemT
2 open import Relation.Binary.PropositionalEquality
3
4 module boolean where
5
6 _and_ : Bool -> Bool -> Bool
7 T and b = b
8 F and _ = F
9
10 _or_ : Bool -> Bool -> Bool
11 T or _ = T
12 F or b = b
13
14 not : Bool -> Bool
15 not T = F
16 not F = T
17
18 De-Morgan's-laws : (a b : Bool) -> (not a) and (not b) ≡ not (a or b)
19 De-Morgan's-laws T T = refl
20 De-Morgan's-laws T F = refl
21 De-Morgan's-laws F T = refl
22 De-Morgan's-laws F F = refl