Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#203 times_call/3 on windows: nesting problem

wrong answer
open
nobody
None
5
2013-08-31
2013-08-31
Michael Kifer
No

On Windows, XSB doesn't clear out the nesting flag of timed_call/3 after exception:

| ?- timed_call(true,1,throw(a)).
++Error[XSB/Runtime] Unhandled Exception: a
| ?- timed_call(true,10,throw(a)).
++Error[XSB/Runtime/P]: [Permission (Operation) nested_call on predicate: timed_call(true)] in timed_call/3

So, after the first exception is thrown, XSB still thinks it is in a nested situation.

This does not hapen on Linux (and probably not also on a Mac). To construct this on Linux, we need to use a slightly different example because 1ms is too short.

| ?- assert((p(X):-p(X))).
X = _h174

then

| ?- timed_call(p(X),10,throw(a)).
++Error[XSB/Runtime] Unhandled Exception: a
| ?- timed_call(p(X),10,throw(a)).
++Error[XSB/Runtime] Unhandled Exception: a

That is, on Linux XSB does not think it is ina nested call situation.

Discussion