coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jonathan Leivent <jonikelee AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Getting tactics in terms to fire later?
- Date: Wed, 1 Jun 2016 09:24:09 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f178.google.com
- Ironport-phdr: 9a23:GyRzuxza3cVPtqfXCy+O+j09IxM/srCxBDY+r6Qd0ekfIJqq85mqBkHD//Il1AaPBtWKra8bwLeG+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuSt+U0pv8irD60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGwD884mosVHSODxe7kyZb1eFjUvdW4vt+PxshyWbwyJ72ccW2NethdJHQXD8FmuXJD3syj3sudw8CafNMzyC7szXGLxvO9QVBb0hXJfZHYC+2bNh5kogQ==
On 06/01/2016 01:22 AM, Gregory Malecha wrote:
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?
About tactic-in-term: one can force it to see an instantiated conclusion only by (that I know of) a cast. In other words, if you can do "ltac:(tac):T", then tac will see T instead of an evar as the conclusion. However, I don't see how to use that fact to help you here.
-- Jonathan
- [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.