Skip to Content.
Sympa Menu

coq-club - [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions


Chronological Thread 
  • From: Zhaohui Li <lizhaohui1991 AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions
  • Date: Wed, 18 May 2016 17:00:24 +0800
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=lizhaohui1991 AT gmail.com; spf=Pass smtp.mailfrom=lizhaohui1991 AT gmail.com; spf=None smtp.helo=postmaster AT mail-io0-f194.google.com
  • Ironport-phdr: 9a23:14tv5ReJfQE4UGxfGhSCuaqmlGMj4u6mDksu8pMizoh2WeGdxc65Yx7h7PlgxGXEQZ/co6odzbGG4ua7ASdYsd6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDjvcaLKF0YzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3GePEzSqUdBzA7OUg04tfqvF/NV1ih/HwZB1cWmx1IHgmNyBCyCpPwoCvzsepg2XDLbJTeQrU9WDDk5KBuHky7wBwbPiI0pTmEwvd7i7hW9Uqs

For example, I have two tactics:

Ltac tryfalse :=
  (** solve contradictions in context **)
  match goal with
    | H: true = false |- _ =>
      inversion H
    | _ => idtac
  end.

Ltac crush :=
  (** misc solver **)
  try subst;
  tryfalse;
  eauto 2;
  try tauto.

Then I keep using crush, but suddenly I find there is another case which
tryfalse should solve.
For keeping complete proof unchanged, I must write something like:
  Ltac tryfalse1 :=
  (** solve contradictions in context **)
  match goal with
    | H: true = false |- _ =>
      inversion H
    | H: Some _ = None |- _ =>
      inversion H
    | _ => idtac
  end.

Ltac crush1 :=
  (** misc solver **)
  try subst;
  tryfalse1;
  eauto 2;
  try tauto.
This is very ugly and wastes time.

So, is there any method (like in lisp) that I can write:
Ltac tryfalse :=
  (** solve contradictions in context **)
  match goal with
    | H: true = false |- _ =>
      inversion H
    | H: Some _ = None |- _ =>
      inversion H
    | _ => idtac
  end.
and Coq redefining tryfalse to this new definition,
then crush will work as my wish.

Thansk for help.





Archive powered by MHonArc 2.6.18.

Top of Page