Subject: Re: [SWIPL] out of stack space-SWI/C++

From: Jan Wielemaker <[email-masked]>
Date: Wed, 3 Oct 2001 12:35:18 +0200

> I'm using the SWI-Prolog C++ interface, o.s. Win2k, MSVC++ 6.0.
> 
> I'm using SWI-Prolog like a Logic Engine,
> so I load my_algo.pl in the engine, 
> then I make some "assert()" and 
> at the very end I ask for 
> a query(PlQuery q("expand", termv);):
> 
>  PlEngine e("my_algo.pl");
>  
>  //I add some PlCall("assert(.....)") like below:
>  PlCall ("assert(autof(X1, cognomeproprietario(X1), nomeproprietario(X1),
>             marca(X1), modello(X1)) :- denf(_, X1))" );
>  PlCall ("assert(autof(T, C, N, M, M) :- auto(T, C,N, M, M))" );
>  PlCall ("assert(denf(D, T) :- den(D, T))" );
>  //...or more, it's just an example!
> 
>  //then I add the following clause (or more):
>  PlCall ("assert(expand(Ris) :- reform(h(X),[autf(X,_,_,_,_),
>                                 denf(_,X)]],Ris)  )" );
> 
> And here there's a PlException that says:
>     "OUT OF STACK SPACE"
> 
> I think it depends from the number of PlCall() and length of 
> its argument, infact writing the last PlCall() in a shorter way
> it works properly!(without denf(...))
> 
> I changed the "Prolog Stack Limit" (SWI-Prolog registry preferences), 
> using the ?- manpce. ...but the result remains the same!

I wouldn't be surprised if the out-of-stack is a false alarm.  If
this code is fairly general C++, please send me the code and I'll have
a look.

	Regards --- Jan