aboutsummaryrefslogtreecommitdiff
path: root/src/Util/Tactics/UnfoldArg.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/Util/Tactics/UnfoldArg.v')
-rw-r--r--src/Util/Tactics/UnfoldArg.v11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Util/Tactics/UnfoldArg.v b/src/Util/Tactics/UnfoldArg.v
new file mode 100644
index 000000000..5f7772578
--- /dev/null
+++ b/src/Util/Tactics/UnfoldArg.v
@@ -0,0 +1,11 @@
+Require Import Crypto.Util.Tactics.ChangeInAll.
+
+(** fully reduces the first argument to [t], wherever it appears *)
+Ltac unfold_first_arg t :=
+ repeat match goal with
+ | [ H : context[t ?x] |- _ ] => progress change_with_compute_in_all x
+ | [ |- context[t ?x] ] => progress change_with_compute_in_all x
+ end.
+
+(* use uconstr so we can have underscores *)
+Tactic Notation "unfold_first_arg" uconstr(t) := unfold_first_arg t.