coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: AUGER Cédric <sedrikov AT gmail.com>
- To: Yucheng Zhang <yczhang89 AT gmail.com>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Performing tactics on each of the matched hypothesis
- Date: Tue, 27 Nov 2012 13:49:04 +0100
Le Tue, 27 Nov 2012 20:18:48 +0800,
Yucheng Zhang
<yczhang89 AT gmail.com>
a écrit :
> Hello,
>
> Suppose I have a goal:
>
> H1 : P x
> H2 : P y
> H3 : P z
> -------------
> Q
>
> where P is an inductive predicate. I want to do 'inversion' on each
> of the hypothesis automatically. I know I can do like this:
>
> do 3 match goal with
> | [ H : P _ |- _ ] => inversion H; move H at top
> end
>
> But is there a 'better' way?
>
> Thanks
>
>
> Yucheng Zhang
I do not know if there is a better way, but I would tend to "clear H"
instead of "move H at top" (or rather 'at bottom', I think).
Most of the time, I do not want to keep the original hypothesis.
So maybe a
Ltac cleanP :=
match goal with [ H : P _ |- _ ] => inversion H; clear H; subst end.
would help. (Note: the subst may not do what you wish, since it would
use all already present equalities)
> H1 : P x
> H2 : P y
> H3 : P z
> -------------
> Q
repeat cleanP. (* alternatively 'do 3 cleanP.' *)
If your P predicate is recursive, you will encounter problems with
tactic called endlessly.
- [Coq-Club] Performing tactics on each of the matched hypothesis, Yucheng Zhang, 11/27/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, AUGER Cédric, 11/27/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Yucheng Zhang, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, gallais, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Yucheng Zhang, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, gallais, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Thomas Braibant, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Yucheng Zhang, 11/29/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Thomas Braibant, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, gallais, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Yucheng Zhang, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, gallais, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, Yucheng Zhang, 11/28/2012
- Re: [Coq-Club] Performing tactics on each of the matched hypothesis, AUGER Cédric, 11/27/2012
Archive powered by MHonArc 2.6.18.