aboutsummaryrefslogtreecommitdiff
path: root/src/Util
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-01-09 12:45:19 -0500
committerGravatar Jason Gross <jgross@mit.edu>2017-01-09 12:45:28 -0500
commit110d7136a05db7425b4dd3f5094f1aab5227c9d8 (patch)
tree2ace6b3862f781e3ecd087e41b991b6be943acdb /src/Util
parentba8cc0116195fe3010a0f8ffd0e5d89618431a0c (diff)
Add Zmod_to_equiv_modulo
Diffstat (limited to 'src/Util')
-rw-r--r--src/Util/ZUtil.v9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Util/ZUtil.v b/src/Util/ZUtil.v
index 42e88e8c4..a82cd7cda 100644
--- a/src/Util/ZUtil.v
+++ b/src/Util/ZUtil.v
@@ -3018,3 +3018,12 @@ Ltac Ztestbit_step :=
| _ => progress Ztestbit_full_step
end.
Ltac Ztestbit := repeat Ztestbit_step.
+
+(** Change [_ mod _ = _ mod _] to [Z.equiv_modulo _ _ _] *)
+Ltac Zmod_to_equiv_modulo :=
+ repeat match goal with
+ | [ H : context T[?x mod ?M = ?y mod ?M] |- _ ]
+ => let T' := context T[Z.equiv_modulo M x y] in change T' in H
+ | [ |- context T[?x mod ?M = ?y mod ?M] ]
+ => let T' := context T[Z.equiv_modulo M x y] in change T'
+ end.