Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: module Set
Date: Fri, 17 Oct 1997 15:46:30 +0200 (MET DST)	[thread overview]
Message-ID: <199710171346.PAA11819@sun-demons.lri.fr> (raw)
In-Reply-To: <199710170908.LAA29437@pauillac.inria.fr>


> Abstract data types have a specification and an implementation.
> The specification usually does not specify everything about the
> behavior of the implementation, if only to allow the implementation to
> change later without breaking user's code.
> 
> In the case of Set, the ordering property you see is a consequence of
> the implementation of sets as search trees.  But other implementations
> (e.g. using hashing) would break that property.

I perfectly agree. But I didn't ask for an interface specifying that
the implementation is based on AVL;  I was just asking for an interface
saying that the elements returned by "elements" are sorted. And it is
always possible to write such a function since the type of elements is
ordered (Independently from the implementation, it is always possible
to sort the lists of the elements of the set before returning it). 
The abstraction of the module Set is not endangered by this additional
property.

-- 
Jean-Christophe FILLIATRE
  mailto:Jean-Christophe.Filliatre@lri.fr
  http://www.lri.fr/~filliatr





  reply	other threads:[~1997-10-20  9:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-15 14:02 Jean-Christophe Filliatre
1997-10-17  9:08 ` Xavier Leroy
1997-10-17 13:46   ` Jean-Christophe Filliatre [this message]
1997-10-17 15:18   ` Judicael Courant
1997-10-17 15:38   ` Stefan Monnier
1997-10-20  8:04   ` Vincent Poirriez

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=199710171346.PAA11819@sun-demons.lri.fr \
    --to=jean-christophe.filliatre@lri.fr \
    --cc=Xavier.Leroy@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