Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Using and matching a hypothesis in Ltac

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Using and matching a hypothesis in Ltac


Chronological Thread 
  • From: Bruno Woltzenlogel Paleo <bruno.wp AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] Using and matching a hypothesis in Ltac
  • Date: Wed, 30 Oct 2013 12:59:24 +0100

Hi!

I'm new to Ltac and I'm trying to define a tactic that will take a hypothesis
name as an argument, match the formula/type of this hypothesis and then do
something with the parts that have been matched.

Here is a concrete minimal (and kind-of dumb-looking) example of the kind of
tactic I would like to write:

Ltac my_and_elimination H H0 := match goal with
| [ H: ?A /\ ?B |- _ ] => assert (H0: A); let H1:=fresh in let H2:=fresh
in destruct H as [H1 H2]; exact H1
end.






I know this is wrong (it doesn't behave as expected in my proof scripts). The
question is: how could I do it correctly?

Best regards,

Bruno



Archive powered by MHonArc 2.6.18.

Top of Page