Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Strange Ltac behavior

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Strange Ltac behavior


chronological Thread 
  • From: Adam Chlipala <adam AT chlipala.net>
  • To: Thomas Braibant <thomas.braibant AT gmail.com>
  • Cc: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Strange Ltac behavior
  • Date: Wed, 23 Feb 2011 11:39:11 -0500

Thomas Braibant wrote:
I have a problem that can be reduced to the snippet below.

Section t.
   Variable T : nat ->  Type.
   Variable f : forall n, T n ->  Prop.
   Goal forall n m (x : T n) (y : T m), f n (x).
     intros.
     match goal with
       | v : T ?n |- context name [?v] =>  idtac v (* prints [f n x],
while I would like [x]*)
     end.
End.

Hypothesis variable names are not treated as bound elsewhere in the same Ltac pattern. You can achieve what you want by nesting one [match] inside another, making each responsible for just one part of the pattern above.



Archive powered by MhonArc 2.6.16.

Top of Page