From: John Skaller <skaller@users.sourceforge.net>
To: Andreas Rossberg <rossberg@ps.uni-sb.de>
Cc: "O'Caml Mailing List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Type abstraction and (polymorphic) equality
Date: Fri, 01 Jul 2005 05:54:06 +1000 [thread overview]
Message-ID: <1120161246.19517.37.camel@localhost.localdomain> (raw)
In-Reply-To: <42C3C098.6040303@ps.uni-sb.de>
[-- Attachment #1: Type: text/plain, Size: 1225 bytes --]
On Thu, 2005-06-30 at 11:51 +0200, Andreas Rossberg wrote:
> sejourne_kevin wrote:
> >
> > A generic equality should be one that work with recursives.
>
> Not so easy. In order to be a proper equivalence test for cyclic data
> structures it essentially had to test graph equivalence, which is the
> same as testing equivalence of DFAs. So it would be a completely
> different algorithm, with significant complexity in space and time.
I do not see that. The current algorithm is recursive descent
is it not? That can also be used with a trivial modification
to test graph equivalence, by simply keeping a list of visited
nodes and not revisiting them.
The problem of course is that the cost per node
is O(N) where N is the recursion depth.
Profiling indicates my code spends up to 60% of all time
doing comparisons.
> In Alice ML, where we have recently added such a co-recursive
> equivalence operation, we opted for turning it into a separate
> operation, to avoid these issues.
That seems reasonable, since the client will usually
know if the data structure contains cycles or not.
--
John Skaller <skaller at users dot sourceforge dot net>
Download Felix: http://felix.sf.net
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-06-30 19:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-29 0:31 Christophe TROESTLER
2005-06-29 9:12 ` [Caml-list] " Jon Harrop
2005-06-29 10:06 ` Andreas Rossberg
2005-06-29 13:32 ` Christophe TROESTLER
2005-06-29 23:39 ` brogoff
2005-06-30 7:46 ` Christophe Raffalli
2005-06-29 20:27 ` Christophe TROESTLER
2005-06-29 20:37 ` John Skaller
2005-06-30 9:53 ` Andreas Rossberg
2005-06-30 17:08 ` brogoff
2005-06-30 17:22 ` Andreas Rossberg
2005-06-30 19:56 ` John Skaller
2005-07-01 12:49 ` Andreas Rossberg
2005-06-29 9:45 ` Jean-Christophe Filliatre
2005-06-29 17:33 ` William Lovas
2005-06-29 18:08 ` sejourne_kevin
2005-06-30 9:51 ` Andreas Rossberg
2005-06-30 19:54 ` John Skaller [this message]
2005-06-30 22:24 ` Alain Frisch
2005-06-30 12:19 ` Alain Frisch
2005-06-30 12:32 ` padiolea
2005-06-30 12:57 ` Alain Frisch
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=1120161246.19517.37.camel@localhost.localdomain \
--to=skaller@users.sourceforge.net \
--cc=caml-list@inria.fr \
--cc=rossberg@ps.uni-sb.de \
/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