Article View: comp.lang.prolog
Article #3506Re: representation of infinite lists
From: Richard A. O'Keefe
Date: Sat, 23 Jul 1988 04:33
Date: Sat, 23 Jul 1988 04:33
26 lines
1595 bytes
1595 bytes
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.
Technical Details
Message-ID:
<190@quintus.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!think!ames!pasteur!agate!labrea!sri-unix!quintus!okReferences:
<7037@burdvax.PRC.Unisys.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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