coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Adam Chlipala <adam AT chlipala.net>
- To: Alexandre Pilkiewicz <alexandre.pilkiewicz AT polytechnique.org>
- Cc: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] [LTac] Iteration on all hypothesis
- Date: Wed, 11 Aug 2010 14:54:08 -0400
Alexandre Pilkiewicz wrote:
You can build a list of candidate hypotheses by getting each hypothesis outI don't understand how to build a list of hypotheses, but the
of the way as you first select it. For instance, run [generalize dependent
H] inside your loop, and then [intros] all the hypotheses back into place
afterward, once you've built a list of hypotheses (say, as a tuple).
generalize dependent does the trick!
Thanks
- Alexandre Pilkiewicz
Here's some code to build a list of all hypothesis conclusions. (It will probably act strangely if some hypothesis has a type dependent on another hypothesis.)
Require Import List.
Ltac everyone k :=
let rec f acc :=
match goal with
| [ H : ?T |- _ ] => generalize dependent H; f (@cons Type T acc)
| _ => k acc
end in
f (@nil Type).
Goal forall x y z : nat, x = y -> y = z -> x = z.
intros; everyone ltac:(fun x => pose x).
- [Coq-Club] [LTac] Iteration on all hypothesis, Alexandre Pilkiewicz
- Re: [Coq-Club] [LTac] Iteration on all hypothesis,
Adam Chlipala
- Re: [Coq-Club] [LTac] Iteration on all hypothesis,
Alexandre Pilkiewicz
- Re: [Coq-Club] [LTac] Iteration on all hypothesis, Adam Chlipala
- Re: [Coq-Club] [LTac] Iteration on all hypothesis, Carlos Simpson
- Re: [Coq-Club] [LTac] Iteration on all hypothesis, Adam Chlipala
- Re: [Coq-Club] [LTac] Iteration on all hypothesis,
Alexandre Pilkiewicz
- Re: [Coq-Club] [LTac] Iteration on all hypothesis, Eric Jaeger
- Re: [Coq-Club] [LTac] Iteration on all hypothesis,
Adam Chlipala
Archive powered by MhonArc 2.6.16.