Subject: RE: Circular references

From: "Douglas Miles (Volt Computer)" <[email-masked]>
Date: Thu, 14 Sep 2000 18:41:00 -0700

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:[email-masked]]
Sent: Thursday, September 14, 2000 1:47 PM
To: [email-masked]
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

[email-masked]