coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: RE: [Coq-Club] Getting tactics in terms to fire later?
- Date: Wed, 1 Jun 2016 08:15:08 +0000
- Accept-language: de-DE, en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga03.intel.com
- Ironport-phdr: 9a23:xEyfShxB5V7W0IDXCy+O+j09IxM/srCxBDY+r6Qd0e0VIJqq85mqBkHD//Il1AaPBtWKra8awLOP4+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6DyZnpnLnrq9X6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVG679ZuEzSaFSJDUgKWE8osPx/1GXRgyWo3AYT28+kxxSAgGD4gusDbnrtS6v/NF61SaGJ8ruCfgRWD+i5qpvAle8jSYMNzc09CfMjcF/kLhcuDqgoQByx8jfZ4TDZ6k2Rb/UYd5PHTkJZc1WTSEUWo4=
Dear Gregory,
it is not an elegant solution, and maybe not a solution at all for your real case, but what I do in such situations is this:
Definition foon (ls : nat) : nat := 0. Definition foob (ls : bool) : nat := 0. Definition foonl (ls : list nat) : nat := 0. Definition foobl (ls : list bool) : nat := 0.
Open Scope list_scope.
Ltac try_something := lazymatch goal with | |- nat => exact 0 | |- bool => exact true | |- list ?t => let value := fresh "value" in assert(t) as value by try_something; exact (value :: nil) end.
Notation "'it'" := ltac:(try_something) (at level 0).
Definition barn : nat := foon ( it ). Definition barb : nat := foob ( it ). Definition barnl : nat := foonl ( it ). Definition barbl : nat := foobl ( it ).
This way at least the number of terms you need to specify is not the product of the number of base types and the number of parameterized types, but their sum.
Best regards,
Michael Intel Deutschland GmbH |
- [Coq-Club] Getting tactics in terms to fire later?, Gregory Malecha, 06/01/2016
- RE: [Coq-Club] Getting tactics in terms to fire later?, Soegtrop, Michael, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Beta Ziliani, 06/01/2016
- RE: [Coq-Club] Getting tactics in terms to fire later?, Soegtrop, Michael, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Beta Ziliani, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Jonathan Leivent, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Amin Timany, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Matthieu Sozeau, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Gregory Malecha, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Matthieu Sozeau, 06/01/2016
- Re: [Coq-Club] Getting tactics in terms to fire later?, Amin Timany, 06/01/2016
- RE: [Coq-Club] Getting tactics in terms to fire later?, Soegtrop, Michael, 06/01/2016
Archive powered by MHonArc 2.6.18.