Skip to content

Commit 1778402

Browse files
committed
Test cases
1 parent 1cecf59 commit 1778402

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

examples/test_algebra.v

+36
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ Unset Printing Implicit Defensive.
77

88
Local Delimit Scope Z_scope with Z.
99

10+
Fact test_zero_nat : Z.of_nat 0%R = 0%Z.
11+
Proof. zify_op; reflexivity. Qed.
12+
13+
Fact test_add_nat n m : Z.of_nat (n + m)%R = (Z.of_nat n + Z.of_nat m)%Z.
14+
Proof. zify_op; reflexivity. Qed.
15+
16+
Fact test_one_nat : Z.of_nat 1%R = 1%Z.
17+
Proof. zify_op; reflexivity. Qed.
18+
19+
Fact test_mul_nat n m : Z.of_nat (n * m)%R = (Z.of_nat n * Z.of_nat m)%Z.
20+
Proof. zify_op; reflexivity. Qed.
21+
22+
Fact test_natmul_nat n m : Z.of_nat (n *+ m)%R = (Z.of_nat n * Z.of_nat m)%Z.
23+
Proof. zify_op; reflexivity. Qed.
24+
25+
Fact test_exp_nat n m : Z.of_nat (n ^+ m)%R = (Z.of_nat n ^ Z.of_nat m)%Z.
26+
Proof. zify_op; reflexivity. Qed.
27+
28+
Fact test_zero_N : Z.of_N 0%R = 0%Z.
29+
Proof. zify_op; reflexivity. Qed.
30+
31+
Fact test_add_N n m : Z.of_N (n + m)%R = (Z.of_N n + Z.of_N m)%Z.
32+
Proof. zify_op; reflexivity. Qed.
33+
34+
Fact test_one_N : Z.of_N 1%R = 1%Z.
35+
Proof. zify_op; reflexivity. Qed.
36+
37+
Fact test_mul_N n m : Z.of_N (n * m)%R = (Z.of_N n * Z.of_N m)%Z.
38+
Proof. zify_op; reflexivity. Qed.
39+
40+
Fact test_natmul_N n m : Z.of_N (n *+ m)%R = (Z.of_N n * Z.of_nat m)%Z.
41+
Proof. zify_op; reflexivity. Qed.
42+
43+
Fact test_exp_N n m : Z.of_N (n ^+ m)%R = (Z.of_N n ^ Z.of_nat m)%Z.
44+
Proof. zify_op; reflexivity. Qed.
45+
1046
Fact test_unit_int m :
1147
m \is a GRing.unit = (Z_of_int m =? 1)%Z || (Z_of_int m =? - 1)%Z.
1248
Proof. zify_pre_hook; zify_op; reflexivity. Qed.

examples/test_ssreflect.v

+11-10
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Proof. zify_op; reflexivity. Qed.
6363
Fact test_dual_max_bool (b1 b2 : bool^d) : Order.dual_max b1 b2 = b1 && b2.
6464
Proof. zify_op; reflexivity. Qed.
6565

66+
(* FIXME: meet and join below are broken but the tests pass because they are *)
67+
(* convertible anyway. *)
6668
Fact test_meet_bool b1 b2 : (b1 `&` b2)%O = b1 && b2.
6769
Proof. zify_op; reflexivity. Qed.
6870

@@ -75,17 +77,17 @@ Proof. zify_op; reflexivity. Qed.
7577
Fact test_dual_join_bool (b1 b2 : bool^d) : (b1 `|^d` b2)%O = b1 && b2.
7678
Proof. zify_op; reflexivity. Qed.
7779

78-
Fact test_bottom_bool : 0%O = false :> bool.
80+
Fact test_bottom_bool : \bot%O = false :> bool.
7981
Proof. zify_op; reflexivity. Qed.
8082

81-
Fact test_top_bool : 1%O = true :> bool.
83+
Fact test_top_bool : \top%O = true :> bool.
8284
Proof. zify_op; reflexivity. Qed.
8385

8486
(* FIXME: Notations 0^d and 1^d are broken. *)
85-
Fact test_dual_bottom_bool : 0%O = true :> bool^d.
87+
Fact test_dual_bottom_bool : \bot%O = true :> bool^d.
8688
Proof. zify_op; reflexivity. Qed.
8789

88-
Fact test_dual_top_bool : 1%O = false :> bool^d.
90+
Fact test_dual_top_bool : \top%O = false :> bool^d.
8991
Proof. zify_op; reflexivity. Qed.
9092

9193
Fact test_sub_bool b1 b2 : (b1 `\` b2)%O = b1 && ~~ b2.
@@ -235,7 +237,7 @@ Fact test_dual_join_nat (n m : nat^d) :
235237
Z.of_nat (n `|^d` m)%O = Z.min (Z.of_nat n) (Z.of_nat m).
236238
Proof. zify_op; reflexivity. Qed.
237239

238-
Fact test_bottom_nat : Z.of_nat 0%O = 0%Z.
240+
Fact test_bottom_nat : Z.of_nat \bot%O = 0%Z.
239241
Proof. zify_op; reflexivity. Qed.
240242

241243
(******************************************************************************)
@@ -315,15 +317,14 @@ Fact test_dual_join_natdvd (n m : natdvd^d) :
315317
Z.of_nat (n `|` m)%O = Z.gcd (Z.of_nat n) (Z.of_nat m).
316318
Proof. zify_op; reflexivity. Qed.
317319

318-
Fact test_bottom_natdvd : Z.of_nat (0%O : natdvd) = 1%Z.
320+
Fact test_bottom_natdvd : Z.of_nat (\bot%O : natdvd) = 1%Z.
319321
Proof. zify_op; reflexivity. Qed.
320322

321-
Fact test_top_natdvd : Z.of_nat (1%O : natdvd) = 0%Z.
323+
Fact test_top_natdvd : Z.of_nat (\top%O : natdvd) = 0%Z.
322324
Proof. zify_op; reflexivity. Qed.
323325

324-
(* FIXME: Notations 0^d and 1^d are broken. *)
325-
Fact test_dual_bottom_natdvd : Z.of_nat (0%O : natdvd^d) = 0%Z.
326+
Fact test_dual_bottom_natdvd : Z.of_nat (\bot^d%O : natdvd^d) = 0%Z.
326327
Proof. zify_op; reflexivity. Qed.
327328

328-
Fact test_dual_top_natdvd : Z.of_nat (1%O : natdvd^d) = 1%Z.
329+
Fact test_dual_top_natdvd : Z.of_nat (\top^d%O : natdvd^d) = 1%Z.
329330
Proof. zify_op; reflexivity. Qed.

0 commit comments

Comments
 (0)