coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ben Moseley <ben_moseley AT mac.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: [Coq-Club] Binding variables within nested matches
- Date: Thu, 25 Nov 2010 19:36:31 +0000
Hi,
I am somewhat puzzled by some behaviour with binding variables within nested
matches.
I am working with: Coq 8.2pl1 (November 2010)
If I define a basic type and term...
Unset Printing Matching.
Inductive MyType : Set := | Left | Right.
Definition term (t : option MyType) : bool :=
match t with
| Some x => (match x with
| Left => true
| Right => true
end)
| None => true
end.
...and then try to prove the following...
Theorem termTrue : forall t, term t = true.
intro t; unfold term;
match goal with | [ |- context [match ?d with
| Some _ => (match ?y with
| Left => true
| Right => true
end)
| None => true
end] ] => destruct d; [|reflexivity]
end.
destruct m; reflexivity.
Qed.
... then the match fails.
If instead I replace the '?y' with '_', then it succeeds.
Is there some reason why I can't bind both '?d' and '?y' ?
--Ben
- [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.