Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Globally-nameless tactics: Getting rid of the verbose Ltac [match goal with] construct

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Globally-nameless tactics: Getting rid of the verbose Ltac [match goal with] construct


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: [Coq-Club] Globally-nameless tactics: Getting rid of the verbose Ltac [match goal with] construct
  • Date: Sat, 24 Jan 2015 00:11:17 -0800

Hi,

In case others may find this discovery interesting (if you have not already made it yourselves):
It is possible to mostly eliminate the verbose [match goal with ... end] construct in trunk/8.5 by using the following tactic:
  
  Ltac hyp := multimatch goal with H : _ |- _ => constr:H end.

Note that [let H := hyp in ... ] will automatically backtrack across failures of subsequent tactics, due to [multimatch]:

  Goal False -> True -> False -> True.
    intros.
    let H := hyp in exact H.

Using open_constr and uconstr tactic notations, I presume the other features of match (pattern matching on the body and the type) can be duplicated with shorter syntax, too.

-Jason



Archive powered by MHonArc 2.6.18.

Top of Page