From: Andrej Bauer <Andrej.Bauer@fmf.uni-lj.si>
To: Brian Hurt <bhurt@janestcapital.com>
Cc: Jonathan Bryant <jtbryant@valdosta.edu>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Amb
Date: Fri, 09 Feb 2007 23:12:38 +0100 [thread overview]
Message-ID: <45CCF1D6.5040302@fmf.uni-lj.si> (raw)
In-Reply-To: <45CCEDCC.1090200@janestcapital.com>
To make this thread worthy of a non-beginner ocaml list, let me point
out that amb is supposed to work as an _angelic_ nondeterministic choice
operator. This means it must choose a value that, if at all possible,
leads to successful completion of the computation. In particular, the
piece of code (assuming exception Amb denotes failure)
if (abm [(fun _ -> false); (fun _ -> true)]) then
7
else
(raise Amb)
should return 7, i.e., the amb inside the conditional should "know" (be
told by an angel) that the right choice is the second element of the
list because it leads to 7, whereas chosing the first one leads to failure.
I am afraid the implementation given by Jonathan does not satisfy this
condition. And I don't see how to make it work. The scheme
implementation involves callcc magic. If anyone knows a reasonable
implementation of amb, I'd be interested to know.
Andrej
next prev parent reply other threads:[~2007-02-09 22:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-09 21:31 Amb Jonathan Bryant
2007-02-09 21:55 ` [Caml-list] Amb Brian Hurt
2007-02-09 22:12 ` Andrej Bauer [this message]
2007-02-09 22:42 ` Tom
2007-02-10 0:03 ` Jon Harrop
2007-02-10 0:01 ` Jon Harrop
2007-02-10 1:12 ` Brian Hurt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45CCF1D6.5040302@fmf.uni-lj.si \
--to=andrej.bauer@fmf.uni-lj.si \
--cc=Andrej.Bauer@andrej.com \
--cc=bhurt@janestcapital.com \
--cc=caml-list@yquem.inria.fr \
--cc=jtbryant@valdosta.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox