aboutsummaryrefslogtreecommitdiff
path: root/plugins/omega
diff options
context:
space:
mode:
authorJason Gross2018-07-16 20:08:02 -0400
committerJason Gross2019-01-24 14:29:03 -0500
commit7bc08910ad7451d5e45102653d33e89aed5ae12b (patch)
tree798ebf22d2f6e41df20e2e3bef8a359d841f03ab /plugins/omega
parent0219dc26914219765300bf2eae792bed49b73562 (diff)
Don't pose any disjunctions in div_mod_to_quot_rem
Disjunctions seem to have a negative performance impact, so let's try implications instead.
Diffstat (limited to 'plugins/omega')
-rw-r--r--plugins/omega/PreOmega.v18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/omega/PreOmega.v b/plugins/omega/PreOmega.v
index 387f258bdd..1e0922e1ca 100644
--- a/plugins/omega/PreOmega.v
+++ b/plugins/omega/PreOmega.v
@@ -19,17 +19,17 @@ Local Open Scope Z_scope.
information. *)
Module Z.
- Lemma div_mod_cases x y
- : ((x = y * (x/y) + x mod y /\ (0 <= x mod y < y \/ y < x mod y <= 0))
- \/ (y = 0 /\ x / y = 0 /\ x mod y = 0)).
- Proof.
- destruct (Z.eq_dec y 0); subst;
- [ right | left; auto using Z.div_mod, Z.mod_bound_or ].
- destruct x; cbv; repeat esplit.
- Qed.
+ Lemma mod_0_r_ext x y : y = 0 -> x mod y = 0.
+ Proof. intro; subst; destruct x; reflexivity. Qed.
+ Lemma div_0_r_ext x y : y = 0 -> x / y = 0.
+ Proof. intro; subst; destruct x; reflexivity. Qed.
Ltac div_mod_to_quot_rem_generalize x y :=
- pose proof (div_mod_cases x y);
+ pose proof (Z.div_mod x y);
+ pose proof (Z.mod_pos_bound x y);
+ pose proof (Z.mod_neg_bound x y);
+ pose proof (div_0_r_ext x y);
+ pose proof (mod_0_r_ext x y);
let q := fresh "q" in
let r := fresh "r" in
set (q := x / y) in *;