From jan@swi.psy.uva.nl Wed Oct 3 12:35:18 2001 Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30]) by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f93AZIv25672; Wed, 3 Oct 2001 12:35:18 +0200 (MET DST) Received: (from jan@localhost) by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f93AZI731436; Wed, 3 Oct 2001 12:35:18 +0200 Date: Wed, 3 Oct 2001 12:35:18 +0200 Message-Id: <200110031035.f93AZI731436@gollem.swi.psy.uva.nl> From: Jan Wielemaker Subject: Re: [SWIPL] =?iso-8859-1?Q?out=20of=20stack=20space=2DSWI/C=2B=2B?= To: luca.cia@tiscalinet.it, prolog@swi.psy.uva.nl In-Reply-To: luca.cia@tiscalinet.it's message of Wed, 3 Oct 2001 12:20:00 +0200 Phone: +31 - 20 - 525 6121 > 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