From p.singleton@keele.ac.uk  Wed Aug 23 15:39:29 2000
Received: from cmailg1.svr.pol.co.uk (cmailg1.svr.pol.co.uk [195.92.195.171])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id PAA27954
	for <prolog@swi.psy.uva.nl>; Wed, 23 Aug 2000 15:39:24 +0200 (MET DST)
Received: from modem4294967281.events.dialup.pol.co.uk ([195.92.2.15] helo=keele.ac.uk)
	by cmailg1.svr.pol.co.uk with esmtp (Exim 3.13 #0)
	id 13Rakl-00038z-00; Wed, 23 Aug 2000 14:39:40 +0100
Message-ID: <39A3D35C.3EEF0A54@keele.ac.uk>
Date: Wed, 23 Aug 2000 14:36:28 +0100
From: Paul Singleton <p.singleton@keele.ac.uk>
Organization: SmartArts Computing Consultancy
X-Mailer: Mozilla 4.74 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: "Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
CC: prolog@swi.psy.uva.nl
Subject: Re: representing terms canonically
References: <200008202349.LAA21776@atlas.otago.ac.nz>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

"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

