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: Pierre Courtieu <pierre.courtieu AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions
- Date: Wed, 18 May 2016 11:26:12 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-lb0-f171.google.com
- Ironport-phdr: 9a23:rdoijhFpjkrqmAw9UZzZC51GYnF86YWxBRYc798ds5kLTJ75oMuwAkXT6L1XgUPTWs2DsrQf27uQ6PirADVIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/nhqbpo9aKOk1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4/SXEGCCI/zM3Vngc2k5DBBGA5xXnVL/wtDH7v6xzwn/JE9fxSOUMWDm49aojYxj1kjsGOiNxpHnWh9ZqgeRQpw+7ux1y3qbbZYiUMLx1eaaLLoBSfnZIQssED38JOYi7dYZaSrNZZes=
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.
>
>
- [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions, Zhaohui Li, 05/18/2016
- Re: [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions, Pierre Courtieu, 05/18/2016
- Re: [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions, Zhaohui Li, 05/18/2016
- Re: [Coq-Club] feature wish: Supporting redefining(overloading?) of Ltac functions, Pierre Courtieu, 05/18/2016
Archive powered by MHonArc 2.6.18.