From 4241445cf88a9655b6273a5ce0faa6674a793fa5 Mon Sep 17 00:00:00 2001 From: emakarov Date: Fri, 8 Jun 2007 12:28:22 +0000 Subject: 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 --- doc/refman/RefMan-tac.tex | 2 +- theories/Init/Tactics.v | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3