coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Luke Palmer <lrpalmer AT gmail.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Well-founded recursion and infinite loops
- Date: Tue, 8 Mar 2011 20:14:45 -0700
- 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 :content-type:content-transfer-encoding; b=Idc3sP4n1OznUoi+yhwwG9fd/h4UG8z8R6MGQOnAiaWv0RKMsdLg7vlCsFQaNwQKb7 +up8zjmKBBceQeZ0cIVcko10g3YGC/UwDZtHCOK0lU3abvFqtYrHDEFwKMZV1dhUL441 aJ2nmKq62sfNSV8Nta2E1v0dMSHNRU6WdEIXw=
I'm fairly new to Coq (have been for a couple years ;-), trying to get
a feel for well-founded recursion. I have defined this program using
Russell:
Definition id A (x:A) := x.
Program Fixpoint bottom (n:nat) { measure (id nat) } :=
match n with
| O => O
| S n => S (bottom (S n))
end.
Next Obligation. Admitted.
Compute bottom 2.
I'm wondering how Coq manages not to get into an infinite loop here.
It shows me some ghod-awful gnarly term instead, as if it got stuck
evaluating the admitted obligation. What confuses me is that the
program:
Program Fixpoint div2 (n:nat) { measure (id nat) } :
match n with
| O => O
| S O => O
| S (S n) => S (div2 n)
end.
Next Obligation. Admitted.
Compute div2 100.
Manages to reduce to normal form just fine. What mechanism is causing
Coq to stop evaluating bottom, but not div2?
Thanks,
Luke
- [Coq-Club] Well-founded recursion and infinite loops, Luke Palmer
- Re: [Coq-Club] Well-founded recursion and infinite loops,
Pierre Casteran
- Re: [Coq-Club] Well-founded recursion and infinite loops, AUGER Cedric
- Re: [Coq-Club] Well-founded recursion and infinite loops,
Pierre Casteran
Archive powered by MhonArc 2.6.16.