Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Fixpoint decreasing parameter:help

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Fixpoint decreasing parameter:help


chronological Thread 
  • From: Groleo Marius <groleo AT gmail.com>
  • To: Adam Chlipala <adamc AT hcoop.net>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Fixpoint decreasing parameter:help
  • Date: Wed, 13 Jan 2010 21:59:11 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gnq4R+6FDIzMjQq7AXlWHxtRlU7i66KbV9o7+4oQVughg+X8s1unI0G7jJvl1dwqFw K0aCehmL05gQdc1jt0hP3S8066RoZugI+AV6f0ChGGi2jxpju1O9z30yxsorBLvDzvv5 yogRI8WNb54YQwcCxl0iBjXYkA2WeUhhLDhSs=

On Wed, Jan 13, 2010 at 7:11 PM, Adam Chlipala 
<adamc AT hcoop.net>
 wrote:
> Groleo Marius wrote:
>>
>> Fixpoint loop ( woff roff :Z )(n:Z) :=
>>   match n with
>>   | 0 =>  0
>>   | n' =>  loop 1 1 (Zminus n' 1)
>>   end.
>>
>> Error: Cannot guess decreasing argument of fix.
>>
>> Can you point me please to some documents regarding this construct ?
>>
>
> I think [Fixpoint] is well enough documented in the Coq manual, but there is
> a fundamental problem with your definition.  Coq will only accept
> terminating programs, and your function loops forever when [n] is negative.
>
Indeed, Fixpoint is well documented in Coq'Art too; my problem wasn't
Fixpoint itself,
but as I said, the whole construct. I wasn't able to find other
examples of using other types than nat;
I tried using the same pattern as in nat, using the succesor
constructor for Z, Zsucc,
but it didn't worked, neither the Zpos,Zneg.


-- 
Regards, Groleo!




Archive powered by MhonArc 2.6.16.

Top of Page