From luis@opera.dia.fi.upm.es  Mon Oct 16 16:14:28 2000
Received: from goofy.fi.upm.es (goofy.fi.upm.es [138.100.8.23])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA25172
	for <prolog@swi.psy.uva.nl>; Mon, 16 Oct 2000 16:14:27 +0200 (MET DST)
Received: from conversion.relay.fi.upm.es by relay.fi.upm.es
 (PMDF V6.0-24 #46251) id <01JVET4PA28G000C3F@relay.fi.upm.es> for
 prolog@swi.psy.uva.nl; Mon, 16 Oct 2000 16:14:12 +0200 (MET-DST)
Received: from opera.dia.fi.upm.es ([138.100.11.43])
 by relay.fi.upm.es (PMDF V6.0-24 #46251)
 with ESMTP id <01JVET4OWN2Y0003YU@relay.fi.upm.es> for prolog@swi.psy.uva.nl;
 Mon, 16 Oct 2000 16:14:11 +0200 (MET-DST)
Received: from localhost (luis@localhost)
	by opera.dia.fi.upm.es (8.9.3+Sun/8.9.3) with ESMTP id QAA02651	for
 <prolog@swi.psy.uva.nl>; Mon, 16 Oct 2000 16:12:14 +0100 (BST)
Date: Mon, 16 Oct 2000 16:12:14 +0100 (BST)
From: Luis Iraola <luis@opera.dia.fi.upm.es>
Subject: Strange behaviour with large lists
X-Sender: luis@opera
To: prolog@swi.psy.uva.nl
Message-id: <Pine.GSO.4.21.0010161611380.682-100000@opera>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII

Hello _,

Version 3.4.0 on Windows NT and 98 behaves funny when managing large lists
(10^5 elements) and the same goal is repeated several times.

The first time the goal is asked the systems answers quickly:

Welcome to SWI-Prolog (Version 3.4.0)
Copyright (c) 1990-2000 University of Amsterdam. 
Copy policy: GPL-2 (see www.gnu.org)

For help, use ?- help(Topic). or ?- apropos(Word).

?- findall(N,between(1,100000,N),L), findall(N,select(N,L,_),L).

N = _G5
L = [1, 2, 3, 4, 5, 6, 7, 8, 9|...] 

Yes

--------------- 0 -----------------
Second time, a couple of errors are raised immediately:

?- findall(N,between(1,100000,N),L), findall(N,select(N,L,_),L).
ERROR: Out of global stack
ERROR: Out of global stack
% Execution Aborted

--------------- 0 -----------------

Third time, a single error is raised after some time:

?- findall(N,between(1,100000,N),L), findall(N,select(N,L,_),L).
ERROR: Out of local stack
?- 

If the goal is asked a fourth or fifth time, the answer obtained is the
same as the third one.

The same behaviour is displayed if member/2 or append/3 is used instead of
select/3 in the second findall/3:

?- findall(N,between(1,100000,N),L), findall(N,member(N,L),L).
?- findall(N,between(1,100000,N),L), findall(N,append(_,[N|_],L),L).

With the first goal, the systems answers rightly, the second and third
times stack errors are reported.

On the contrary, if just the first findall/3 is queried, the system
behaves consistently all the times it is asked:

?- findall(N,between(1,100000,N),L).

Regards,

Luis.



