aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremakarov2007-06-08 12:28:22 +0000
committeremakarov2007-06-08 12:28:22 +0000
commit4241445cf88a9655b6273a5ce0faa6674a793fa5 (patch)
tree97142c49eddbd6cdf3ac498063e4707755aaa396
parent5d82773fdad88ab93baf713888248da4ee8185a9 (diff)
Removed an extra \tacindex occurrence for the tactic discriminate.
Added a tactic "now" which is nonrecursive but generalizes "trivial". git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9884 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--doc/refman/RefMan-tac.tex2
-rw-r--r--theories/Init/Tactics.v9
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index e93e504ada..2caf3b1094 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -1893,7 +1893,7 @@ latter is first introduced in the local context using
This does the same thing as \texttt{intros until \num} then
\texttt{discriminate \ident} where {\ident} is the identifier for the last
introduced hypothesis.
-\item {\tt discriminate}\tacindex{discriminate} \\
+\item {\tt discriminate}\\
It applies to a goal of the form {\tt
\verb=~={\term$_1$}={\term$_2$}} and it is equivalent to:
{\tt unfold not; intro {\ident}}; {\tt discriminate
diff --git a/theories/Init/Tactics.v b/theories/Init/Tactics.v
index f45b541bcd..6c5c0e0119 100644
--- a/theories/Init/Tactics.v
+++ b/theories/Init/Tactics.v
@@ -126,3 +126,12 @@ bapply lemma ltac:(fun H => destruct H as [H _]; apply H in J).
Tactic Notation "apply" "<-" constr(lemma) "in" ident(J) :=
bapply lemma ltac:(fun H => destruct H as [_ H]; apply H in J).
+
+(** A tactic simpler than auto that is useful for ending proofs "in one step" *)
+Tactic Notation "now" tactic(t) :=
+t;
+match goal with
+| H : _ |- _ => solve [inversion H]
+| _ => solve [trivial | reflexivity | symmetry; trivial | discriminate | split]
+| _ => fail 1 "Cannot solve this goal"
+end.