source code limits

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

source code limits

Fred Bapst-2
Before trying to discover the details by myself, I was wondering whether someone
has an idea of the actual limits concerning the following aspects of Prolog
input files (ours are automatically generated by a translator; we try to attack
fd optimization problems with thousands of boolean variables and constraints):

- maximal size of list literals ([a,b,c,d...])
- maximal number of goals in a rule body
- maximal number variables appearing in a rule
- maximal number of fd variables
- maximal size of expressions inside constraints (3*A+4*B+2*C+...#<Z)
- maximal number of constraints
- maximal arity of a term

I bet those limits correspond to some constants/macros in the sources of
gprolog; it would be great to point us to the right place, so that we can adapt
and rebuild our own version.

Thanks in advance.

_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
Reply | Threaded
Open this post in threaded view
|

Re: source code limits

Daniel Diaz-3
Le 26/06/2015 10:22, Fred Bapst a écrit :

> Before trying to discover the details by myself, I was wondering whether someone
> has an idea of the actual limits concerning the following aspects of Prolog
> input files (ours are automatically generated by a translator; we try to attack
> fd optimization problems with thousands of boolean variables and constraints):
>
> - maximal size of list literals ([a,b,c,d...])
> - maximal number of goals in a rule body
> - maximal number variables appearing in a rule
> - maximal number of fd variables
> - maximal size of expressions inside constraints (3*A+4*B+2*C+...#<Z)
> - maximal number of constraints
> - maximal arity of a term
>
> I bet those limits correspond to some constants/macros in the sources of
> gprolog; it would be great to point us to the right place, so that we can adapt
> and rebuild our own version.
>
> Thanks in advance.
>
> _______________________________________________
> Users-prolog mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/users-prolog
>
Hi Fred,

there are 2 different aspects: the compiler and the runtime.

The compiler is not very well optimized for large source files. More
precisely for predicates containing a lot of clauses or for large nested
terms. A workaround consists in writing a data file which is read by
your Prolog code (using open, read_term, close). There is a little
overhead but generally acceptable.

The runtime has its own limits. Some can be discovered with
current_prolog_flag/2 predicate (try current_prolog_predicate(X,Y)).
Some can be adjusted (this requires to recompile gprolog). See
src/BipsPl/b_params.h (e.g. MAX_VAR_IN_TERM  = 32768). If you modify
this file please do a
make clean
make

Daniel



--
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.


_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog