users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Mark Roulo
Subject: Re: Very small size limit of Gnu Prolog "database"?
Date: Wed, 12 Dec 2012 06:50:42 -0800 (PST)

Thanks!

The good news for us is that we can proceed with gprolog if we
think the capability will arrive. I can keep SWI as the backup plan :-)

Regards,
Mark Roulo


From: Daniel Diaz <address@hidden>;
To: Mark Roulo <address@hidden>;
Cc: address@hidden <address@hidden>;
Subject: Re: Very small size limit of Gnu Prolog "database"?
Sent: Wed, Dec 12, 2012 1:05:14 PM

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é.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]