aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-02-01 16:07:32 -0500
committerGravatar Jason Gross <jgross@mit.edu>2017-02-01 16:07:32 -0500
commite81366cbf3c5f0f8c49e3eb8bc3c13f137efcabf (patch)
tree5c98d0cb9ae64fddd378a1b08ea3d65e7056a4ee
parent9145558ec4cfdc1e3a9a081f1b8811d9013af0b4 (diff)
Add invert_match_expr
-rw-r--r--src/Reflection/ExprInversion.v14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Reflection/ExprInversion.v b/src/Reflection/ExprInversion.v
index 3d0caa0cb..fa3dd945e 100644
--- a/src/Reflection/ExprInversion.v
+++ b/src/Reflection/ExprInversion.v
@@ -156,6 +156,20 @@ Ltac invert_expr_step :=
Ltac invert_expr := repeat invert_expr_step.
+Ltac invert_match_expr_step :=
+ match goal with
+ | [ |- appcontext[match ?e with TT => _ | _ => _ end] ]
+ => invert_one_expr e
+ | [ |- appcontext[match ?e with Abs _ _ _ => _ | _ => _ end] ]
+ => invert_one_expr e
+ | [ H : appcontext[match ?e with TT => _ | _ => _ end] |- _ ]
+ => invert_one_expr e
+ | [ H : appcontext[match ?e with Abs _ _ _ => _ | _ => _ end] |- _ ]
+ => invert_one_expr e
+ end.
+
+Ltac invert_match_expr := repeat invert_match_expr_step.
+
Ltac invert_expr_subst_step :=
match goal with
| [ H : invert_Var ?e = Some _ |- _ ] => apply invert_Var_Some in H