From a-doug@microsoft.com  Fri Sep 15 03:41:44 2000
Received: from mail5.microsoft.com (mail5.microsoft.com [131.107.3.121])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id DAA12390
	for <prolog@swi.psy.uva.nl>; Fri, 15 Sep 2000 03:41:43 +0200 (MET DST)
Received: from 157.54.9.108 by mail5.microsoft.com (InterScan E-Mail VirusWall NT); Thu, 14 Sep 2000 18:41:29 -0700 (Pacific Daylight Time)
Received: by INET-IMC-05 with Internet Mail Service (5.5.2651.58)
	id <S56FAPWV>; Thu, 14 Sep 2000 18:41:28 -0700
Message-ID: <56791EC22E349D428D0C05C89EAB8A2421A219@red-msg-05.redmond.corp.microsoft.com>
From: "Douglas Miles (Volt Computer)" <a-doug@microsoft.com>
To: "'Gordon Streeter'" <GordonStreeter@bigfoot.com>, prolog@swi.psy.uva.nl
Subject: RE: Circular references
Date: Thu, 14 Sep 2000 18:41:00 -0700
X-Mailer: Internet Mail Service (5.5.2651.58)

Gordon, 

    A = a(A), assert(A).

generally assert and friends are limited to what you can write/1 

try    

	A=a(A),write(A).

you should get the same error


Do you want A to be turned inside out? so that A was the inverse of a(A) ?
and yet still be A?

I think you may mean to do this:
	
	P = circular_reference(A=a(A)) , assert(P).

or 

	B=A, C=a(A), assert(B=C). 

Programmatically you could be asking the prolog database to remember
something very neat about the current prolog state durring the =/2 you were
in while the assert/1 was happening. One possible state to allow this would
be 0xc00000fd :) (unless this was an access violation then you would have
need for infinate amount of memory and thus reaching a proximal Zen)  

You and i can look at it and not even attempt to break our laws of logic.
 
Your first part of the query was
	 A=something(A)

Take in math:
	  A = X * A .. 
We know that only  A=0 could be true..
but maybe infinity or square root of negative 1 would be also acceptable?

Back to "A=a(A)."

Prolog doesnt look it first, it will assume we asked it to find some value
in existance for A that will make the statement true.. 
some strange term possibly..  So prolog could work hard on reaching an
imaginary value/state that will allow something to be itself as well as
something other then itself at the same given time. 


-----Original Message-----
From: Gordon Streeter [mailto:GordonStreeter@bigfoot.com]
Sent: Thursday, September 14, 2000 1:47 PM
To: prolog@swi.psy.uva.nl
Subject: Circular references


I'm having various troubles dealing with circular references.  The biggest
problem is in trying to assert a term with a circular reference.  My
application is more complex, but here is a simple test:

    A = a(A), assert(A).

This causes an exception (0xc00000fd) in PLWIN.EXE on WinNT 4.0, SP6, for
SWI-Prolog 3.2.8, 3.3.6, and 3.3.10.

Any help would be appreciated.

Thanks,

G

GordonStreeter@bigfoot.com

