From 02e50d0bd18f5fa2f173bb6ecc36da5c316ecaa1 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Wed, 10 Oct 2018 10:14:08 -0400 Subject: Rename [normalize_commutative_identifier] file to match tactic name --- _CoqProject | 2 +- src/Util/Tactics/NormalizeCommutativeIdentifier.v | 16 ++++++++++++++++ src/Util/Tactics/RewriteWithCommutativity.v | 16 ---------------- 3 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 src/Util/Tactics/NormalizeCommutativeIdentifier.v delete mode 100644 src/Util/Tactics/RewriteWithCommutativity.v diff --git a/_CoqProject b/_CoqProject index 9f814f84c..70fca8fd2 100644 --- a/_CoqProject +++ b/_CoqProject @@ -6585,13 +6585,13 @@ src/Util/Tactics/GetGoal.v src/Util/Tactics/Head.v src/Util/Tactics/HeadUnderBinders.v src/Util/Tactics/MoveLetIn.v +src/Util/Tactics/NormalizeCommutativeIdentifier.v src/Util/Tactics/Not.v src/Util/Tactics/OnSubterms.v src/Util/Tactics/PoseTermWithName.v src/Util/Tactics/PrintContext.v src/Util/Tactics/Revert.v src/Util/Tactics/RewriteHyp.v -src/Util/Tactics/RewriteWithCommutativity.v src/Util/Tactics/RunTacticAsConstr.v src/Util/Tactics/SetEvars.v src/Util/Tactics/SetoidSubst.v diff --git a/src/Util/Tactics/NormalizeCommutativeIdentifier.v b/src/Util/Tactics/NormalizeCommutativeIdentifier.v new file mode 100644 index 000000000..00af95566 --- /dev/null +++ b/src/Util/Tactics/NormalizeCommutativeIdentifier.v @@ -0,0 +1,16 @@ +(** Rewrite with the commutative property to ensure that all appearences of an identifier show up the same way *) + +Ltac rewrite_with_comm id clem x y := + first [ constr_eq x y; fail 1 + | repeat match goal with + | [ H' : context[id y x] |- _ ] + => rewrite clem in H' + | [ |- context[id y x] ] + => rewrite clem + end ]. + +Ltac normalize_commutative_identifier id id_comm := + repeat match goal with + | [ |- context[id ?x ?y] ] => progress rewrite_with_comm id (id_comm y x) x y + | [ H : context[id ?x ?y] |- _ ] => progress rewrite_with_comm id (id_comm y x) x y + end. diff --git a/src/Util/Tactics/RewriteWithCommutativity.v b/src/Util/Tactics/RewriteWithCommutativity.v deleted file mode 100644 index 00af95566..000000000 --- a/src/Util/Tactics/RewriteWithCommutativity.v +++ /dev/null @@ -1,16 +0,0 @@ -(** Rewrite with the commutative property to ensure that all appearences of an identifier show up the same way *) - -Ltac rewrite_with_comm id clem x y := - first [ constr_eq x y; fail 1 - | repeat match goal with - | [ H' : context[id y x] |- _ ] - => rewrite clem in H' - | [ |- context[id y x] ] - => rewrite clem - end ]. - -Ltac normalize_commutative_identifier id id_comm := - repeat match goal with - | [ |- context[id ?x ?y] ] => progress rewrite_with_comm id (id_comm y x) x y - | [ H : context[id ?x ?y] |- _ ] => progress rewrite_with_comm id (id_comm y x) x y - end. -- cgit v1.2.3