aboutsummaryrefslogtreecommitdiff
path: root/src/Util/Tactics.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2016-04-19 12:07:44 -0400
committerGravatar Jason Gross <jgross@mit.edu>2016-04-19 12:09:24 -0400
commita75a26ca7f6c66b0d85f79315b9f8d7550cd5066 (patch)
tree06985149c98be9c6561772436da9dfea9a96c929 /src/Util/Tactics.v
parentccd934fbd94229469a8da90b52be16545d31e191 (diff)
Add a tactic for field inequalities
Pair programming with Andres, a better proof of unifiedAddM1'_rep, some progress on twistedAddAssoc.
Diffstat (limited to 'src/Util/Tactics.v')
-rw-r--r--src/Util/Tactics.v25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Util/Tactics.v b/src/Util/Tactics.v
new file mode 100644
index 000000000..08ebfe13e
--- /dev/null
+++ b/src/Util/Tactics.v
@@ -0,0 +1,25 @@
+(** * Generic Tactics *)
+
+(* [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) :=
+ let T := type of defn in
+ match goal with
+ | [ H : T |- _ ] => fail 1
+ | _ => pose proof defn
+ end.
+(* [assert T], but only if no hypothesis of the same type exists.
+ most useful for proofs of a proposition *)
+Tactic Notation "unique" "assert" constr(T) :=
+ match goal with
+ | [ H : T |- _ ] => fail 1
+ | _ => assert T
+ end.
+
+(* [assert T], but only if no hypothesis of the same type exists.
+ most useful for proofs of a proposition *)
+Tactic Notation "unique" "assert" constr(T) "by" tactic3(tac) :=
+ match goal with
+ | [ H : T |- _ ] => fail 1
+ | _ => assert T by tac
+ end.