From ok@atlas.otago.ac.nz  Fri Sep 15 02:24:15 2000
Received: from atlas.otago.ac.nz (atlas.otago.ac.nz [139.80.32.250])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id CAA08531
	for <prolog@swi.psy.uva.nl>; Fri, 15 Sep 2000 02:24:14 +0200 (MET DST)
Received: (from ok@localhost)
	by atlas.otago.ac.nz (8.9.3/8.9.3) id MAA17632;
	Fri, 15 Sep 2000 12:24:25 +1200 (NZST)
Date: Fri, 15 Sep 2000 12:24:25 +1200 (NZST)
From: "Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
Message-Id: <200009150024.MAA17632@atlas.otago.ac.nz>
To: GordonStreeter@bigfoot.com, prolog@swi.psy.uva.nl
Subject: Re:  Circular references

	I'm having various troubles dealing with circular references.

Cyclic terms are a big headache all over the place, and the fact that
Prolog ever failed to block them is in the "Top 3 Design Misfeatures" list.
The best way to fix your problem is "Don't do that".
Find another way to represent your information (there is *always*
a better method than cyclic terms).

  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 =3D a(A), assert(A).
	
This particular example could be handled by code:
	assert(( a(A) :- A = a(A) )).

Any cyclic term can be handled this way, by adding suitable equations
to the body.  You will find it hard to write the code that does that,
but that should make it a bit clearer why cyclic terms are a BAD THING.

