forked from brain-research/hol-light
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrqe_num.ml
34 lines (28 loc) · 892 Bytes
/
rqe_num.ml
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
(* ---------------------------------------------------------------------- *)
(* Nums *)
(* ---------------------------------------------------------------------- *)
let neq = `(=):num->num->bool`;;
let nlt = `(<):num->num->bool`;;
let ngt = `(>):num->num->bool`;;
let nle = `(<=):num->num->bool`;;
let nge = `(>=):num->num->bool`;;
let nm = `( * ):num->num->num`;;
let np = `(+):num->num->num`;;
let nzero = `0`;;
let even_tm = `EVEN`;;
let odd_tm = `ODD`;;
let nmax = new_definition(
`nmax (n:num) m = if n <= m then m else n`);;
let SUC_1 = prove(
`1 + x = SUC x`,
(* {{{ Proof *)
ARITH_TAC);;
(* }}} *)
let even_tm = `EVEN`;;
let odd_tm = `ODD`;;
let PARITY_CONV tm =
let k = dest_small_numeral tm in
if even k then
prove(mk_comb(even_tm,tm),ARITH_TAC)
else
prove(mk_comb(odd_tm,tm),ARITH_TAC);;