Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] ipattern

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] ipattern


chronological Thread 
  • From: Bruno Barras <bruno.barras AT inria.fr>
  • To: "Jean.Duprat" <duprat AT ens-lyon.fr>
  • Cc: coq-club AT pauillac.inria.fr, Guillaume Melquiond <guillaume.melquiond AT ens-lyon.fr>
  • Subject: Re: [Coq-Club] ipattern
  • Date: Fri, 18 Mar 2005 14:53:57 +0100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Jean.Duprat wrote:

Hi,

What is the role of "ipattern:" which is largely used by the translator V7 -> V8 and
that V8.0beta dislikes ?

the ipattern: construct allows to pass an intro-pattern (the argument of the intros tactic) to a Ltac.
Normally, the arguments of Ltacs sould be terms. It is similar to ltac: which is used to pass an argument that is
the result of an Ltac expression. Assume we wanted to defined an Ltac that introduces new hypotheses which name
is passed as arguments (not passing names and letting the tactic choose names is considered a bad style, even if many standard
tactics do it), for instance

Ltac my_intro H1 H2 := intros H1 H2.
(OK it's dumb to define that tactic, but it's just to avoid unnecessary details).

Without ipattern, you would not be able to use my_intro.
If you type my_intro h0 h1, then either h0 and h1 do not exist and the globalization of the arguments fail, or they already exist, and then the intros fail.
Instead, you can do my_intro ipattern:h0 ipattern:h1 which will do what expected.
I recognize the syntax is not as lightweight as one could expect, but we had to make a trade-off. Globalization helps finding mis-spelled arguments, and we definitely want to avoid too cryptic notations such as ipatt: , ipat: or ip: ...

Bruno Barras.








Archive powered by MhonArc 2.6.16.

Top of Page