Re: Very small size limit of Gnu Prolog "database"?

Daniel Diaz <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
Hi Mark,

Le 11/12/2012 19:49, Mark Roulo a écrit :

I am exploring the size limits for GNU Prolog

when used as a database. Right now I have

a prolog file that contains 10,000 simple facts.

It looks like this:

is_a_widget('GUID:Widget-0000000').

is_a_widget('GUID:Widget-0000001').

is_a_widget('GUID:Widget-0000002').

:

:

is_a_widget('GUID:Widget-0009995').

is_a_widget('GUID:Widget-0009996').

is_a_widget('GUID:Widget-0009997').

is_a_widget('GUID:Widget-0009998').

is_a_widget('GUID:Widget-0009999').

The GNU
Prolog compiler chokes when trying to compile it.

xyzzy:Src kt$ gplc -o program blatz.pl

Fatal Error: global stack overflow (size: 32768 Kb,
reached: 32765 Kb,

environment variable used: GLOBALSZ) compilation failed

Increasing
the GLOBALSZ variable to 300MB doesn't help:

xyzzy:Src kt$ GLOBALSZ=327650; export GLOBALSZ; gplc -o
program blatz.pl

Fatal Error: global stack overflow (size: 327652 Kb,
reached: 327649 Kb,

environment variable used: GLOBALSZ) compilation failed

The problem comes from the compiler (not the runtime) which is not
very optimized (the compiler is mainly the one I wrote in Prolog for
wamcc which an experimental research plate-form and it is cleary
unoptimized). I have to improve it to tackle large database/datalog
facts.

Is 10,000
facts a *REAL* limit? Or am I doing something very wrong?
Ideally

I'd like
to go to about 1,000,000 simple facts.

Clearly, the current version of gprolog cannot handle so large
predicates. SWI Prolog (whose compiler is written in C) should be
able to treat them (I didn't try but it is able to deal with large
database like wordnet).

Improving the compiler is already in my TODO list... I inform you
(via the list) as soon as I have something better...

Sorry.

Daniel

I created
my input prolog file with this C program:

#include <stdio.h>

int main(int argc, char *argv[])

{

FILE *fp = fopen(argv[1], "w");

for (int i = 0; i < 10000; ++i)

{

fprintf(fp, "is_a_widget('GUID:Widget-%07d').\n",
i);

}

fclose(fp);

return 0;

}

Thanks,

Mark
Roulo

--

Ce message a été vérifié par
MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.

_______________________________________________
Users-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/users-prolog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.