Subject: Re: representing terms canonically

From: Paul Singleton <[email-masked]>
Date: Wed, 23 Aug 2000 14:36:28 +0100

"Richard A. O'Keefe" wrote:

> Paul Singleton wrote:

>         What I think I need, is a (distinctly non-logical :-) term comparison which
>         immediately (without any recursive searching) reports whether two terms are
>         the same actual compound "cell" (or whatever Prolog implementors call it).

> No, what you need is versions of (=)/2 and (==)/2 that work the way they
> did in SICStus Prolog back in the early 80s.
> ...

OK, I think I understand the constructive part of your reply, but I'm having
trouble with "No" :-)

I'm worried that the (==)/2 you suggest has a cost which depends (somehow)
upon the size of the terms being compared, whereas my

  int PL_same_compound(term_t t1, term_t t2)

has a size-independent cost, and lets me detect cyclic terms more cheaply.

Paul Singleton