aboutsummaryrefslogtreecommitdiff
path: root/src/Util/Tactics.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jagro@google.com>2016-08-17 10:45:07 -0700
committerGravatar Jason Gross <jagro@google.com>2016-08-17 10:49:43 -0700
commit8eb99e7fa606e4336f28b1c61d90fa2010df5b76 (patch)
tree26e85e9e532d4892ecab49738fdce61698b22fac /src/Util/Tactics.v
parentda1322d09b798dc51358308e46b85cb24cf472fa (diff)
Add [Z.linear_solve_for], [Z.linear_substitute]
The first solves for a variable; the second does this, and then runs [subst]. By design, they only handle addition and subtraction. They should be easily generalizable to handle arbitrary rings (and should probably be generalized to do so at some point). (Also requested, if I recall correctly, by @andres-erbsen.)
Diffstat (limited to 'src/Util/Tactics.v')
-rw-r--r--src/Util/Tactics.v7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Util/Tactics.v b/src/Util/Tactics.v
index 880f5824a..a318f469b 100644
--- a/src/Util/Tactics.v
+++ b/src/Util/Tactics.v
@@ -20,6 +20,13 @@ Ltac head expr :=
Ltac head_hnf expr := let expr' := eval hnf in expr in head expr'.
+(** [contains x expr] succeeds iff [x] appears in [expr] *)
+Ltac contains search_for in_term :=
+ idtac;
+ lazymatch in_term with
+ | appcontext[search_for] => idtac
+ end.
+
(* [pose proof defn], but only if no hypothesis of the same type exists.
most useful for proofs of a proposition *)
Tactic Notation "unique" "pose" "proof" constr(defn) :=