Path: utzoo!attcan!uunet!husc6!think!ames!pasteur!agate!labrea!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: representation of infinite lists Keywords: infinite data structures Message-ID: <190@quintus.UUCP> Date: 23 Jul 88 04:33:22 GMT References: <7037@burdvax.PRC.Unisys.COM> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 26 In article <7037@burdvax.PRC.Unisys.COM> lang@othello.PRC.Unisys.COM (Francois-Michel Lang) writes: >[In Quintus Prolog release 2.2] >If I call the goal >| ?- L = [x|L]. >[he gets the output he expected] >However, if I call the goal >| ?- L = [x|L], M = [x|M]. (0) Why not send technical questions about Quintus Prolog to Quintus? We're more likely to know the answers than the net. (1) Undefined is undefined: if you create cyclic terms you're on your own. Quintus Prolog makes no pretence of doing anything clever with them. (2) You've been hit by a feature: the Quintus Prolog top level, before printing out the bindings of the variables, checks to see whether any of them are identical. For example, | ?- L = a, M = a. prints L = M = a If QP ever got around to noticing that L and M *are* identical, it would print them out as L = M = [x,x,x,x,x,x,x,x,.... The difference between the two examples was that the first had only one variable, so there was nothing to check, while the second had two variables with isomorphic cyclic values.