-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbool.ath
More file actions
60 lines (49 loc) · 1.59 KB
/
bool.ath
File metadata and controls
60 lines (49 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module bool{
assert bool-axioms := (datatype-axioms "Boolean")
define [bool-noconf bool-nojunk] := bool-axioms
define (bool-true a=true) :=
match a=true {
(= (some-term a) true) => (!chain<- [a <== true [a=true]])}
define (bool-false a=false) :=
match a=false {
(= (some-term a) false) =>
(!by-contradiction (~ a)
(!chain [a ==> false [a=false]]))}
define (true-bool a) :=
match [a] {
[(some-term a)] =>
(!by-contradiction (a = true)
assume (~ (a = true))
let {afalse := (!dsyl (!uspec bool-nojunk a) (~ (a = true)))}
(!absurd a (!bool-false afalse)))}
define (false-bool a) :=
match [a] {
[(not (some-term a))] =>
(!by-contradiction (a = false)
assume (~ (a = false))
let {atrue := (!dsyl (!uspec bool-nojunk a) (~ (a = false)))}
(!absurd (!bool-true atrue) (~ a)))}
define (eq2equiv a=b) :=
match a=b {
(= a b) => (!chain [a <==> b [(a = b)]])}
define (equiv2eq a<==>b) :=
match a<==>b {
(iff (some-term a) (some-term b)) =>
(!by-contradiction (a = b)
assume (~ (a = b))
(!two-cases
assume a
let{atrue := (!true-bool a);
bb := (!chain<- [b <== a [a<==>b]]);
btrue := (!true-bool b);
a=b := (!combine-equations atrue btrue)}
(!absurd a=b (~ (a = b)))
assume (~ a)
let{afalse := (!false-bool (~ a));
ab := (!chain<- [(~ b) <== (~ a) [a<==>b]]);
bfalse := (!false-bool (~ b));
a=b := (!combine-equations afalse bfalse)}
(!absurd a=b (~ (a = b)))))}
} # close module bool
#_ := (print "\nrl:\n" rl)
open bool