coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Matthieu Sozeau <Matthieu.Sozeau AT lri.fr>
- To: Woon Ming <woon_ming AT comp.nus.edu.sg>
- Cc: <coq-club AT pauillac.inria.fr>
- Subject: Re: [Coq-Club] Occurrence of keyword in conclusion
- Date: Thu, 29 Jan 2009 11:55:07 +0100
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Le 29 janv. 09 à 23:43, Woon Ming a écrit :
Hi all,
Hi,
In my Ltac, I would like to detect the occurrence of a particular keyword in the conclusion and apply the appropriate hypothesis.
( e.g.
My conclusion consists of “a * b = keyword * b”.
And my ltac is something like this:
Ltac simplify :=
match goal with
| [id:(_=?key) |- (_ = key * b)] => rewrite id.
end.
)
In the example given, it is workable only because I specified the operator (*). However, in the case where I don’t specify any operator (e.g. (_ =key_)), this is completely not workable. Is there any way I can perform regex matching in a generalized manner (e.g. without specifying the operator)?
Yes, using the [context [ pat ]] pattern construction.
It is documented in the reference manual.
-- Matthieu
- [Coq-Club] Occurrence of keyword in conclusion, Woon Ming
- Re: [Coq-Club] Occurrence of keyword in conclusion, Matthieu Sozeau
- RE: [Coq-Club] Occurrence of keyword in conclusion,
Woon Ming
- Re: [Coq-Club] Occurrence of keyword in conclusion, Matthieu Sozeau
- RE: [Coq-Club] Occurrence of keyword in conclusion,
Woon Ming
- Re: [Coq-Club] Occurrence of keyword in conclusion, Matthieu Sozeau
Archive powered by MhonArc 2.6.16.