From dbcc30f4b504a4413e6d207e4da78e3906ca3f9c Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 10 Apr 2017 13:56:19 -0400 Subject: Add rewrite_hyp ... by tac --- src/Util/Tactics/RewriteHyp.v | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/Util/Tactics') diff --git a/src/Util/Tactics/RewriteHyp.v b/src/Util/Tactics/RewriteHyp.v index 240931e05..dd1d186db 100644 --- a/src/Util/Tactics/RewriteHyp.v +++ b/src/Util/Tactics/RewriteHyp.v @@ -42,3 +42,43 @@ Tactic Notation "erewrite_hyp" "<-" "?*" "in" "*" := repeat do_with_hyp' ltac:(f Tactic Notation "erewrite_hyp" "!*" "in" "*" := progress erewrite_hyp ?* in *. Tactic Notation "erewrite_hyp" "->" "!*" "in" "*" := progress erewrite_hyp -> ?* in *. Tactic Notation "erewrite_hyp" "<-" "!*" "in" "*" := progress erewrite_hyp <- ?* in *. + +Tactic Notation "rewrite_hyp" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => rewrite H). +Tactic Notation "rewrite_hyp" "->" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => rewrite -> H). +Tactic Notation "rewrite_hyp" "<-" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => rewrite <- H). +Tactic Notation "rewrite_hyp" "?*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => rewrite !H). +Tactic Notation "rewrite_hyp" "->" "?*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => rewrite -> !H). +Tactic Notation "rewrite_hyp" "<-" "?*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => rewrite <- !H). +Tactic Notation "rewrite_hyp" "!*" "by" tactic3(tac) := progress rewrite_hyp ?*. +Tactic Notation "rewrite_hyp" "->" "!*" "by" tactic3(tac) := progress rewrite_hyp -> ?*. +Tactic Notation "rewrite_hyp" "<-" "!*" "by" tactic3(tac) := progress rewrite_hyp <- ?*. + +Tactic Notation "rewrite_hyp" "*" "in" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => rewrite H in * by tac). +Tactic Notation "rewrite_hyp" "->" "*" "in" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => rewrite -> H in * by tac). +Tactic Notation "rewrite_hyp" "<-" "*" "in" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => rewrite <- H in * by tac). +Tactic Notation "rewrite_hyp" "?*" "in" "*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => rewrite !H in * by tac). +Tactic Notation "rewrite_hyp" "->" "?*" "in" "*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => rewrite -> !H in * by tac). +Tactic Notation "rewrite_hyp" "<-" "?*" "in" "*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => rewrite <- !H in * by tac). +Tactic Notation "rewrite_hyp" "!*" "in" "*" "by" tactic3(tac) := progress rewrite_hyp ?* in * by tac. +Tactic Notation "rewrite_hyp" "->" "!*" "in" "*" "by" tactic3(tac) := progress rewrite_hyp -> ?* in * by tac. +Tactic Notation "rewrite_hyp" "<-" "!*" "in" "*" "by" tactic3(tac) := progress rewrite_hyp <- ?* in * by tac. + +Tactic Notation "erewrite_hyp" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => erewrite H by tac). +Tactic Notation "erewrite_hyp" "->" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => erewrite -> H by tac). +Tactic Notation "erewrite_hyp" "<-" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => erewrite <- H by tac). +Tactic Notation "erewrite_hyp" "?*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => erewrite !H by tac). +Tactic Notation "erewrite_hyp" "->" "?*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => erewrite -> !H by tac). +Tactic Notation "erewrite_hyp" "<-" "?*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => erewrite <- !H by tac). +Tactic Notation "erewrite_hyp" "!*" "by" tactic3(tac) := progress erewrite_hyp ?* by tac. +Tactic Notation "erewrite_hyp" "->" "!*" "by" tactic3(tac) := progress erewrite_hyp -> ?* by tac. +Tactic Notation "erewrite_hyp" "<-" "!*" "by" tactic3(tac) := progress erewrite_hyp <- ?* by tac. + +Tactic Notation "erewrite_hyp" "*" "in" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => erewrite H in * by tac). +Tactic Notation "erewrite_hyp" "->" "*" "in" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => erewrite -> H in * by tac). +Tactic Notation "erewrite_hyp" "<-" "*" "in" "*" "by" tactic3(tac) := do_with_hyp' ltac:(fun H => erewrite <- H in * by tac). +Tactic Notation "erewrite_hyp" "?*" "in" "*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => erewrite !H in * by tac). +Tactic Notation "erewrite_hyp" "->" "?*" "in" "*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => erewrite -> !H in * by tac). +Tactic Notation "erewrite_hyp" "<-" "?*" "in" "*" "by" tactic3(tac) := repeat do_with_hyp' ltac:(fun H => erewrite <- !H in * by tac). +Tactic Notation "erewrite_hyp" "!*" "in" "*" "by" tactic3(tac) := progress erewrite_hyp ?* in * by tac. +Tactic Notation "erewrite_hyp" "->" "!*" "in" "*" "by" tactic3(tac) := progress erewrite_hyp -> ?* in * by tac. +Tactic Notation "erewrite_hyp" "<-" "!*" "in" "*" "by" tactic3(tac) := progress erewrite_hyp <- ?* in * by tac. -- cgit v1.2.3