1
Require Import ZArith Nnat Omega.
4
(** Test of the zify preprocessor for (R)Omega *)
6
(* More details in file PreOmega.v
8
(r)omega with Z : starts with zify_op
9
(r)omega with nat : starts with zify_nat
10
(r)omega with positive : starts with zify_positive
11
(r)omega with N : starts with uses zify_N
12
(r)omega with * : starts zify (a saturation of the others)
17
Goal forall a:Z, Zmax a a = a.
22
Goal forall a b:Z, Zmax a b = Zmax b a.
27
Goal forall a b c:Z, Zmax a (Zmax b c) = Zmax (Zmax a b) c.
32
Goal forall a b:Z, Zmax a b + Zmin a b = a + b.
37
Goal forall a:Z, (Zabs a)*(Zsgn a) = a.
40
intuition; subst; omega. (* pure multiplication: omega alone can't do it *)
43
Goal forall a:Z, Zabs a = a -> a >= 0.
48
Goal forall a:Z, Zsgn a = a -> a = 1 \/ a = 0 \/ a = -1.
55
Goal forall m: nat, (m<2)%nat -> (0<= m+m <=2)%nat.
60
Goal forall m:nat, (m<1)%nat -> (m=0)%nat.
65
Goal forall m: nat, (m<=100)%nat -> (0<= m+m <=200)%nat.
69
(* 2000 instead of 200: works, but quite slow *)
71
Goal forall m: nat, (m*m>=0)%nat.
78
Goal forall m: positive, (m<2)%positive -> (2 <= m+m /\ m+m <= 2)%positive.
83
Goal forall m:positive, (m<2)%positive -> (m=1)%positive.
88
Goal forall m: positive, (m<=1000)%positive -> (2<=m+m/\m+m <=2000)%positive.
93
Goal forall m: positive, (m*m>=1)%positive.
100
Goal forall m:N, (m<2)%N -> (0 <= m+m /\ m+m <= 2)%N.
105
Goal forall m:N, (m<1)%N -> (m=0)%N.
110
Goal forall m:N, (m<=1000)%N -> (0<=m+m/\m+m <=2000)%N.
115
Goal forall m:N, (m*m>=0)%N.
120
(* mix of datatypes *)
122
Goal forall p, Z_of_N (N_of_nat (nat_of_N (Npos p))) = Zpos p.