coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gregory Malecha <gmalecha AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: [Coq-Club] Getting tactics in terms to fire later?
- Date: Tue, 31 May 2016 22:22:22 -0700
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gmalecha AT gmail.com; spf=Pass smtp.mailfrom=gmalecha AT gmail.com; spf=None smtp.helo=postmaster AT mail-oi0-f43.google.com
- Ironport-phdr: 9a23:+hFf1hMYDnR6SiU1pr0l6mtUPXoX/o7sNwtQ0KIMzox0KPv7rarrMEGX3/hxlliBBdydsKIVzbeI+PG/EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35Xxir75qsKbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzoShLHzX8BWC1CmR1RRgPB8RvSX5HrsyK8uPAriweAOsijYqo5VjO4/u9OQRvlgycOf2o29WjTh8dwhYpUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEEnUZWo4=
Hello --
I'm wondering if anyone has a trick to get tactics-in-terms to fire later? Here's a somewhat contrived example:
Definition foo (ls : list nat) : nat := 0.
Ltac try_something :=
lazymatch goal with
| |- nat => exact 0
| |- bool => exact true
end.
Notation "'it'" := ltac:(try_something) (at level 0).
Definition bar : nat := foo (it :: nil).
In the last line, we know that the type of 'it' should be [nat] since [foo] takes an argument of type [list nat]. However, when the Ltac actually fires, the goal is a unification variable and therefore neither of branches of the [lazymatch] matches.
Any hackish tricks to get this to work? Possibly something involving 'Program' or canonical structures?
--
gregory malecha
- [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.