Problems with large terms

Simile support <[email protected]> Fri, 07 Feb 2014 12:56:10 +0000
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
I am finding that manipulating terms with large (actually not that 
large!) numbers of primitives is causing gprolog to run out of stack 
space, even when it is set very generously. For instance, the attached 
file just contains B = 9.4+9.4+...+9.4. (total of 1024 values). But I 
have tried to consult it with the v1.4.3 release and with the very 
latest unstable version uploaded today, and I get:

$ export GLOBALSZ=524288
$ gprolog
GNU Prolog 1.4.4 (64 bits)
Compiled Feb  7 2014, 12:45:24 with gcc
By Daniel Diaz
Copyright (C) 1999-2014 Daniel Diaz
| ?- consult(big).
compiling /home/jaspert/Test/PrologLimits/big.pl for byte code...
/home/jaspert/Test/PrologLimits/big.pl:1: warning: singleton variables 
[B] for (=)/2

Fatal Error: global stack overflow (size: 524288 Kb, reached: 524285 Kb, 
environment variable used: GLOBALSZ)
compilation failed

no
| ?-
Is this a simple thing to fix? I use Prolog to parse equations entered 
by my users, and some of them tend to write very long ones...
Cheers
     --Jasper

_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog
big.pl (application/x-perl, 4 KB)
B = 9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4+9.4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