coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: David Baelde <david.baelde AT gmail.com>
- To: Allyx FONTAINE <fontaine AT labri.fr>
- Cc: AUGER Cedric <Cedric.Auger AT lri.fr>, Pierre Corbineau <Pierre.Corbineau AT imag.fr>, coq-club AT inria.fr
- Subject: Re: [Coq-Club] Testing monads in Alea library
- Date: Sun, 22 May 2011 17:41:50 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=f44yPc5HXzSWXh58mlqJ488u57gOb4H6LKsZ9VYH1C9AeVTWF2X5v5XWc7hpPMXQlf b/1z1DL3KE9p6haYs/2Qqxnj7sujezRoxXdFPXv3YVeajy5dQhbLZUKP+OUvWxTdOdAA IX03lckKmKnyeXKsaF2kH9W5CWQnmlIsrPUuY=
Hi Allyx,
If you haven't already, you should have a look at the paper by
Audebaud & Paulin (http://dx.doi.org/10.1016/j.scico.2007.09.002)
about the ALEA library. It starts with a gentle introduction to the
monad that is used, detailing its advantages and drawbacks.
There are mainly two ways of representing probabilistic algorithms. A
computation returning objects of type 'a can be represented either as
(unit -> 'a) or ('a -> [0,1]). The first approach is suitable for
simulations: it gives you a function that you can re-run as many times
as you wish, possibly getting different results each time, because the
function relies on some random generator. The second approach, used in
ALEA, models the computation as a probability distribution. It is an
exact approach: for a given x of type 'a it should return the
probability that this x is obtained. But this will be unusable for
testing.
Long story short, Pierre Corbineau's solution will work. However, I
wouldn't bother to make extraction work for such small examples: just
rewrite the code in ML yourself.
Have fun,
--
David
- [Coq-Club] Testing monads in Alea library, Allyx FONTAINE
- <Possible follow-ups>
- [Coq-Club] Testing monads in Alea library,
Allyx FONTAINE
- Re: [Coq-Club] Testing monads in Alea library,
Pierre Corbineau
- Re: [Coq-Club] Testing monads in Alea library,
Allyx FONTAINE
- Re: [Coq-Club] Testing monads in Alea library,
AUGER Cedric
- Re: [Coq-Club] Testing monads in Alea library,
Allyx FONTAINE
- Re: [Coq-Club] Testing monads in Alea library, David Baelde
- Re: [Coq-Club] Testing monads in Alea library, AUGER Cedric
- Re: [Coq-Club] Testing monads in Alea library, Fontaine Allyx
- Re: [Coq-Club] Testing monads in Alea library, Fontaine Allyx
- Re: [Coq-Club] Testing monads in Alea library, AUGER Cedric
- Re: [Coq-Club] Testing monads in Alea library, Fontaine Allyx
- Re: [Coq-Club] Testing monads in Alea library, David Baelde
- Re: [Coq-Club] Testing monads in Alea library,
Allyx FONTAINE
- Re: [Coq-Club] Testing monads in Alea library,
AUGER Cedric
- Re: [Coq-Club] Testing monads in Alea library,
Allyx FONTAINE
- Re: [Coq-Club] Testing monads in Alea library,
Pierre Corbineau
Archive powered by MhonArc 2.6.16.