Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Stack overflow on large nats

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Stack overflow on large nats


chronological Thread 
  • From: Michael Day <mikeday AT yeslogic.com>
  • To: coq-club AT pauillac.inria.fr
  • Subject: [Coq-Club] Stack overflow on large nats
  • Date: Mon, 24 Mar 2008 13:14:15 +1100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hi,

The following definition results in a stack overflow from coqc:

    Definition unicode_codepoint (n:nat) : Prop :=
        n < 1114112.

Presumably some code is trying to process 1 million nested S(...) constructors and isn't tail-recursive.

I've replaced it with this definition, using the N type instead of nat, that seems to work:

    Definition unicode_codepoint (n:N) : Prop :=
        Ncompare n (1114112%N) = Lt.

Is it impossible to manipulate numbers of reasonable size using nat? Is it recommended to use N instead?

Best regards,

Michael

--
Print XML with Prince!
http://www.princexml.com





Archive powered by MhonArc 2.6.16.

Top of Page