coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Adam Chlipala <adamc AT hcoop.net>
- To: Marko Malikovi� <marko AT ffri.hr>
- Cc: coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] Pseudo random numbers in Coq
- Date: Fri, 06 Mar 2009 08:16:23 -0500
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Marko Malikoviæ wrote:
I'm trying to find some function for generating random (pseudo-random)
numbers in Coq. It seems that it doesn't exists. Am I right?
If it doesn't exists than I need some seed state. But, I don't see some
time (or simmilary) function in Coq.
Every Coq function is pure. It is impossible to write a function of type, e.g., [unit -> nat] that returns different values on different calls. Thus, there can exist no equivalents of C rand() or time(); assuming such a function exists leads to a contradiction.
You can still thread a time or random number seed through a program as an explicit argument/return value, though.
- [Coq-Club] Pseudo random numbers in Coq, Marko Malikoviæ
- Re: [Coq-Club] Pseudo random numbers in Coq, Adam Chlipala
- Re: [Coq-Club] Pseudo random numbers in Coq, Yves Bertot
- Re: [Coq-Club] Pseudo random numbers in Coq,
Cedric Auger
- Re: [Coq-Club] Pseudo random numbers in Coq, Marko Malikoviæ
- Re: [Coq-Club] Pseudo random numbers in Coq, Adam Chlipala
Archive powered by MhonArc 2.6.16.