coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Adam Koprowski <adam.koprowski AT gmail.com>
- To: dimitrisg7 <dvekris AT hotmail.com>
- Cc: coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] Question on recursion
- Date: Tue, 21 Apr 2009 15:22:23 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=WfLbPodS9HYIe02ShI1AYgPRQmyY61bhakgZFPYNtmsriqrTvnZGlkbKiNityQIlgj xRq+oTr0bP2mCLFOi7stA1RO3hGXE+xrjiXvWTlTpCSdLCHV4ex7PIpybF1e5kgtvfRu 9TF0SxhJX3n3Tur6nCnKcEmPRlo5q7Wh5aS3M=
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Dear Dimitri,
Sure, you can do the same thing without Program, but it gets slightly more complicated as you need to manually get the equality for the pattern-matched variable:
Section testing.
Variable P : forall i, i < 10 -> nat -> nat.
Definition check (i : nat) (H : i < 10) : nat.
Proof.
refine (fix check (i : nat) (H : i < 10) {struct i} : nat :=
match i as j return i = j -> nat with
| 0 => fun _ => 0
| S n => fun ij => P n _ (check n _)
end refl); subst; auto with arith.
Defined.
End testing.
Hope that helps,Variable P : forall i, i < 10 -> nat -> nat.
Definition check (i : nat) (H : i < 10) : nat.
Proof.
refine (fix check (i : nat) (H : i < 10) {struct i} : nat :=
match i as j return i = j -> nat with
| 0 => fun _ => 0
| S n => fun ij => P n _ (check n _)
end refl); subst; auto with arith.
Defined.
End testing.
Adam
On Tue, Apr 21, 2009 at 14:57, dimitrisg7 <dvekris AT hotmail.com> wrote:
Thanks Adam. But I am not familiar with the new features of Coq. I still use
the previous version. I am wondering if there is still something that can be
done with "old" Coq. If not, I might consider seriously to switch to the new
version.
-----
Never say never.
--
View this message in context: http://www.nabble.com/Question-on-recursion-tp23153959p23155523.html
Sent from the Coq mailing list archive at Nabble.com.
--------------------------------------------------------
Bug reports: http://logical.saclay.inria.fr/coq-bugs
Archives: http://pauillac.inria.fr/pipermail/coq-club
http://pauillac.inria.fr/bin/wilma/coq-club
Info: http://pauillac.inria.fr/mailman/listinfo/coq-club
--
=====================================================
Adam.Koprowski AT gmail.com, http://www.cs.ru.nl/~Adam.Koprowski
The difference between impossible and possible
lies in determination (Tommy Lasorda)
=====================================================
- [Coq-Club] Question on recursion, dimitrisg7
- Re: [Coq-Club] Question on recursion,
Adam Koprowski
- Re: [Coq-Club] Question on recursion,
dimitrisg7
- Re: [Coq-Club] Question on recursion, Adam Koprowski
- Re: [Coq-Club] Question on recursion, Matthieu Sozeau
- Re: [Coq-Club] Question on recursion, Adam Chlipala
- Re: [Coq-Club] Question on recursion, Adam Koprowski
- Re: [Coq-Club] Question on recursion,
dimitrisg7
- Re: [Coq-Club] Question on recursion,
Adam Koprowski
Archive powered by MhonArc 2.6.16.