diff options
author | Jason Gross <jgross@mit.edu> | 2017-07-08 19:02:01 -0400 |
---|---|---|
committer | Jason Gross <jgross@mit.edu> | 2017-07-08 20:46:01 -0400 |
commit | b706a5f54b1dd406cae3bfbf719f22889dd23264 (patch) | |
tree | ae1826a25ddfe7a12390a8e69eeaffce9a9de09c /src | |
parent | 067be37f5631aba329294d22d4f773246dc95bf1 (diff) |
Make some tactics a bit more powerful
Diffstat (limited to 'src')
-rw-r--r-- | src/Util/Tactics/MoveLetIn.v | 2 | ||||
-rw-r--r-- | src/Util/Tactics/UnfoldArg.v | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Util/Tactics/MoveLetIn.v b/src/Util/Tactics/MoveLetIn.v index c5ec3d8a8..32959d716 100644 --- a/src/Util/Tactics/MoveLetIn.v +++ b/src/Util/Tactics/MoveLetIn.v @@ -46,7 +46,7 @@ Local Ltac with_uconstr_in_goal uc k := of the form [lhs = rhs]. *) Ltac context_to_dlet_in_rhs f := lazymatch goal with - | [ |- ?LHS = ?RHS ] + | [ |- ?R ?LHS ?RHS ] => with_uconstr_in_goal f ltac:(fun f diff --git a/src/Util/Tactics/UnfoldArg.v b/src/Util/Tactics/UnfoldArg.v index 5f7772578..68d35cff4 100644 --- a/src/Util/Tactics/UnfoldArg.v +++ b/src/Util/Tactics/UnfoldArg.v @@ -7,5 +7,9 @@ Ltac unfold_first_arg t := | [ |- 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. +(** fully reduces the second argument to [t], wherever it appears *) +Ltac unfold_second_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. |