caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: OCAML <caml-list@inria.fr>
Subject: [Caml-list] Implementation of posets?
Date: Mon, 21 May 2001 16:12:52 +0200	[thread overview]
Message-ID: <20010521161252.A8457@miss.wu-wien.ac.at> (raw)

Hello,

could somebody, please, point me to references of efficiently implemented
partially ordered sets (or maps)? They need not necessarily be purely
functional, but this would be preferable. It will be important that all
operations require bounded stack space only (i.e. they are composed out
of tail-recursive functions only), though I'd surely be able to transform
any other solution into this form.

What I want to do in particular is maintain a datastructure that is
parameterized over a partial order, e.g.:

  module MakePOSet (PartOrd : PARTIAL_ORDER) = struct
    type poset = ...
    ...
  end

and allows the following operations efficiently:

  val add : PartOrd.el -> poset -> handle * poset

"add" inserts an element into the partially ordered set. "handle" should
allow me to quickly remove the associated element as in e.g.:

  val remove : handle -> poset -> poset

  val fold_top : (PartOrd.el -> 'a -> 'a) -> poset -> 'a -> 'a
  val fold_bot : (PartOrd.el -> 'a -> 'a) -> poset -> 'a -> 'a

"fold_top" folds over all top elements of the ascending chains in the
poset, "fold_bot" does so for all the bottom elements.

  val sucs : handle -> HandleSet.t
  val prds : handle -> HandleSet.t

"sucs" should give me a set of all successors of an element in the poset,
"prds" the set of all predecessors.

Especially pointers on how to soundly and efficiently manipulate
Hasse-diagrams of partially ordered sets with the "add"-operation would
probably be a good start into the right direction. Any hints one where
to find those?

Thanks a lot for your help!

Best regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


                 reply	other threads:[~2001-05-21 14:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010521161252.A8457@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --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;
as well as URLs for NNTP newsgroup(s).