coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Robbert Krebbers <mailinglists AT robbertkrebbers.nl>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] how to write this function?
- Date: Sat, 05 Apr 2014 20:31:26 +0200
On 04/05/2014 08:00 PM, Ömer Sinan Ağacan wrote:
This eval command fails with stack overflow. It works fine when n isThat is because you are using natural numbers in unary representation. Already something like:
8. I was wondering what am I doing wrong, in most other languages same
function works for n > 500 without problems. Or is this because Coq's
default stack depth is very low?
Check 362880.
results in
Warning: Stack overflow or segmentation fault happens
when working with large numbers in nat (observed
threshold may vary from 5000 to 70000 depending on
your system limits and on the command executed).
Stack overflow.
Better use a more efficient representation for natural numbers like N (an inductive representation as bit sequences) or bigN (arbitrary precision machine integers).
- [Coq-Club] how to write this function?, Ömer Sinan Ağacan, 04/05/2014
- Re: [Coq-Club] how to write this function?, Robbert Krebbers, 04/05/2014
- Re: [Coq-Club] how to write this function?, Ömer Sinan Ağacan, 04/05/2014
- Re: [Coq-Club] how to write this function?, Daniel Schepler, 04/05/2014
- Re: [Coq-Club] how to write this function?, Ömer Sinan Ağacan, 04/05/2014
- Re: [Coq-Club] how to write this function?, Adam Chlipala, 04/05/2014
- Re: [Coq-Club] how to write this function?, Daniel Schepler, 04/05/2014
- Re: [Coq-Club] how to write this function?, Ömer Sinan Ağacan, 04/05/2014
- Re: [Coq-Club] how to write this function?, Ömer Sinan Ağacan, 04/05/2014
- Re: [Coq-Club] how to write this function?, Daniel Schepler, 04/05/2014
- Re: [Coq-Club] how to write this function?, Ömer Sinan Ağacan, 04/05/2014
- Re: [Coq-Club] how to write this function?, Robbert Krebbers, 04/05/2014
Archive powered by MHonArc 2.6.18.