Skip to Content.
Sympa Menu

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

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [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: Re: [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions
  • Date: Wed, 18 May 2016 19:15:57 +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-ig0-f172.google.com
  • Ironport-phdr: 9a23:l1z/FxbW4ZOkwuXsFwMnbMb/LSx+4OfEezUN459isYplN5qZpc+9bnLW6fgltlLVR4KTs6sC0LqH9fu4Ejddqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7H0oMWYOFgArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9Kq8/VPlTCCksG2Ez/szi8xfZHiWV4X5JYGUflRpVAkDh7VmuWpbjsiL9tvd8gXjLZOX5SLk1XXKp6KI9G0ygszsOKzNsqDKfscd3lq8O+B8=

Thanks ~
This is exactly what I need.

2016-05-18 17:26 GMT+08:00 Pierre Courtieu <pierre.courtieu AT gmail.com>:
There is such a feature, use

Ltac foo ::= bar.

(https://coq.inria.fr/distrib/current/refman/Reference-Manual011.html#sec480)

Be aware that this is a <evil> side effect </evil> that will survive
your module unless you use "Local" prefix.

Best,
P.



2016-05-18 11:00 GMT+02:00 Zhaohui Li <lizhaohui1991 AT gmail.com>:
> 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