Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] What's the best way to extract programs that use random numbers?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] What's the best way to extract programs that use random numbers?


Chronological Thread 
  • From: Ilmārs Cīrulis <ilmars.cirulis AT gmail.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] What's the best way to extract programs that use random numbers?
  • Date: Tue, 22 Nov 2016 15:43:52 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ilmars.cirulis AT gmail.com; spf=Pass smtp.mailfrom=ilmars.cirulis AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw0-f171.google.com
  • Ironport-phdr: 9a23:PHt6QhesGdSrLWFsLAeB0CJ7lGMj4u6mDksu8pMizoh2WeGdxc2zbR7h7PlgxGXEQZ/co6odzbGH6Oa6BCdcsN7B6ClEK8McEUddyI0/pE8JPo2sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7MhdpdKyuQtaBx5f/6+fnsZbUekBDgCe3SbJ0NhS/6wvL/IFCiox7b6011xHho31Seu0Qy3k+dnyJmBOpx8O1V4R4uw9Roe8l9tUIBaT+eq0iVvpTDS47N2EuzMLuvBjHCwCI4y1PAS0tjhNUDl2dv1nBVZDrv36iuw==

I did it.

> Lemma continuous2_app : forall `{c1:cpo D1} `{c2:cpo D2} `{c3:cpo D3}
>            (F : D1 -m> D2 -m> D3) {cF:continuous2 F} (k:D1), continuous (F k).
> red; intros.
> transitivity  (F (mlub (cte nat k))  (lub h)); auto.
> transitivity (lub ((F @2 (mon (cte nat k))) h)); auto.
> apply lub_le_compat; simpl; auto.
> Save.

On Tue, Nov 22, 2016 at 1:46 PM, Ilmārs Cīrulis <ilmars.cirulis AT gmail.com> wrote:
Using Coq 8.5, I get error in the file Ccpo.v (of Alea, version 8), line 1729

> apply (fmonotonic2 F); auto.

> Unable to unify "monotonic2 (fun2 F)" with
>  "(F (mlub cte nat k)) (lub h) <= lub (F k @ h)".

I will try to fix it myself, of course, but I will be thankful for any hints. :)


On Mon, Nov 21, 2016 at 6:31 PM, Ilmārs Cīrulis <ilmars.cirulis AT gmail.com> wrote:
Big thank you!

Yes, it helps.
It seems that Alea must be ported to Coq 8.5, but that seems easy to do. In progress.

--
Ilmars

On Mon, Nov 21, 2016 at 2:01 PM, Xavier Leroy <Xavier.Leroy AT inria.fr> wrote:
On 11/21/2016 10:59 AM, Ilmārs Cīrulis wrote:
> I am thinking about the best way to use Coq for extracting correct programs
> that uses random numbers? (Preferably, into Haskell.)
> Is there some good library for such purposes? Or, if there's not, what's the
> best literature / articles to get useful insights.

You could certainly program (in Coq) using a probability monad, which
should extract nicely to Haskell or to Caml.

To formally reason about your probabilistic programs, the following
Coq libraries and tools could help:
- Alea  https://www.lri.fr/~paulin/ALEA/
- Certicrypt  http://certicrypt.gforge.inria.fr/

Hope this helps,

- Xavier Leroy






Archive powered by MHonArc 2.6.18.

Top of Page