From: Martin Riener <martin.riener@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Specification of the choose function on sets
Date: Tue, 20 Jun 2017 17:19:53 +0200 [thread overview]
Message-ID: <36cdaad0-efa4-a4f3-4d14-46985a5f1101@inria.fr> (raw)
In-Reply-To: <F59198C8-1CC3-4C54-B803-99A781ABC61D@inria.fr>
[-- Attachment #1.1: Type: text/plain, Size: 1146 bytes --]
Hello Bruno,
I'm far from being an expert in ocaml, but that's my explanation so for:
The specification comes from Hilbert's epsilon operator, which picks an
unspecified element from a set (for details, see e.g. [1]). Since
epsilon is a function (of the set), it must always return the same
element. An example which comes to mind is to have a quick check for the
inequality of sets:
let ineq s1 s2 =
if (S.choose s1 <> S.choose s2) then
false
else
not (
(S.for_all (fun x -> S.mem x s1) s2) &&
(S.for_all (fun x -> S.mem x s2) s1)
)
I hope that helps,
cheers, Martin
[1] https://plato.stanford.edu/entries/epsilon-calculus/
On 06/20/2017 07:46 AM, Bruno Guillaume wrote:
> Dear Ocamlers,
>
> In a context not directly related to OCaml, I want to define the semantics of a “choose” function on a set.
> In the doc of Set.Make, for the “choose" function, it is said:
>
> “but equal elements will be chosen for equal sets.”
>
> What is the rationale behind this specification? Do you have examples where this specific requirement is needed?
>
> Thanks,
>
> Bruno
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-06-20 15:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 5:46 Bruno Guillaume
2017-06-20 15:19 ` Martin Riener [this message]
2017-06-20 16:52 ` Gabriel Scherer
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=36cdaad0-efa4-a4f3-4d14-46985a5f1101@inria.fr \
--to=martin.riener@inria.fr \
--cc=caml-list@inria.fr \
/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