Subject: RE: Circular references

From: Katzer Joachim <[email-masked]>
Date: Fri, 15 Sep 2000 09:11:41 +0200

> -----Ursprungliche Nachricht-----
> Von:	Douglas Miles (Volt Computer) [SMTP:[email-masked]]
> Gesendet am:	Freitag, 15. September 2000 03:41
> An:	'Gordon Streeter'; [email-masked]
> Betreff:	RE: Circular references
> 
> Gordon, 
> 
>     A = a(A), assert(A).
> 
> generally assert and friends are limited to what you can write/1 
> 
[Katzer Joachim]   
This is not true for all Prolog systems. IF/Prolog *can* write cyclic terms, e.g.:

[user] ?- A = a(A), write(A).
_165 :: a(_165)
A       = _165 :: a(_165) 

yes

[user] ?- assertz((a(A) :- A = a(A) )).

A       = _164 

yes

[user] ?- a(A).

A       = _209 :: a(_209) 

yes

But 

?- A = a(A), assertz(A).

woud crash too.