Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Negated ltac pattern match

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Negated ltac pattern match


chronological Thread 
  • From: Adam Chlipala <adamc AT csail.mit.edu>
  • To: "Edward Z. Yang" <ezyang AT mit.edu>
  • Cc: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Negated ltac pattern match
  • Date: Sat, 10 Dec 2011 14:48:56 -0500

Edward Z. Yang wrote:
Suppose that I would like to run a tactic, but only if some hypothesis
isn't present.  Namely, I would like to do a negated pattern match,
i.e. a red cut.  It might seem that this would work OK:

(**)
match goal with
    | [ H : P X | _ ] => fail 2
    | _ => assert (P X); [eauto|]
(**)

Unfortunately, 'fail 2' is overzealous and escapes too far.

Did you try [fail 1]?  That's what I would have attempted first.



Archive powered by MhonArc 2.6.16.

Top of Page