coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Adam Chlipala <adam AT chlipala.net>
- To: Ben Moseley <ben_moseley AT mac.com>
- Cc: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Binding variables within nested matches
- Date: Thu, 25 Nov 2010 14:57:54 -0500
Ben Moseley wrote:
match goal with | [ |- context [match ?d with
| Some _ => (match ?y with
| Left => true
| Right => true
end)
| None => true
end] ] => destruct d; [|reflexivity]
end.
... then the match fails.
If instead I replace the '?y' with '_', then it succeeds.
A term bound to a simple Ltac pattern variable isn't allowed to contain locally-bound variables. The locally-bound variable that causes the trouble in this example is what you're writing as [_] for the [Some] pattern.
Conversely, a [_] pattern may match terms containing local variables, since there's no need to produce a version of the matched term that can be dropped into other contexts.
- [Coq-Club] Program Fixpoint and finite sets, David Pereira
- Re: [Coq-Club] Program Fixpoint and finite sets, David Pichardie
- [Coq-Club] Binding variables within nested matches,
Ben Moseley
- Re: [Coq-Club] Binding variables within nested matches, Adam Chlipala
- <Possible follow-ups>
- Re: [Coq-Club] Program Fixpoint and finite sets,
Xavier Leroy
- Re: [Coq-Club] Program Fixpoint and finite sets,
Stéphane Lescuyer
- Re: [Coq-Club] Program Fixpoint and finite sets, Matthieu Sozeau
- Re: [Coq-Club] Program Fixpoint and finite sets,
Stéphane Lescuyer
Archive powered by MhonArc 2.6.16.