mainGNU Prolog for Java - Support: sr #107601, runOnce throws a...


sr #107601: runOnce throws a IllegalArgumentException; prologfile and code snippet included

Submitter:  None
Submitted:  Tue 22 Feb 2011 07:47:54 PM UTC
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  Done
Privacy:  Public Assigned to:  drt24
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  Microsoft Windows
* Mandatory Fields

Add a New Comment (Rich Markup)

Tue 22 Feb 2011 08:32:02 PM UTC, comment #4: 

:- dynamic(inverseOf/1).
is valid prolog.

In prolog all predicates use brackets to take arguments.

ensureLoaded does validate the prolog file but it stores the validation into the List<PrologTextLoaderError> which is obtainable using env.getLoadingErrors(); It is probable that both ensureLoaded and runInitialization should return false if there were errors generated and possibly throw an exception rather than just return void as they do at the moment.

I have taken out a bug with respect to that which should be fixed in the next release.

Daniel Thomas <drt24>
Project Administrator
Tue 22 Feb 2011 08:24:06 PM UTC, comment #3: 


Okay, that explains a lot.

Perhaps ensureLoaded could validate the prolog file...

or are
:- dynamic inverseOf/1.
:- dynamic(inverseOf/1).

both syntactically correct prolog inputs?

Tue 22 Feb 2011 08:11:20 PM UTC, comment #2: 

Ok wonderful I have found out what the problem was.

There were syntax errors in the prolog file which were causing things to not work as they should.

Adding in:
// Check to see if there were any errors while running the initialization
//  (syntax errors etc.)
List<PrologTextLoaderError> loadingErrors = env.getLoadingErrors();
if (loadingErrors.size() > 0)

(plus the needed imports) showed up the errors and helped me fix the bug in the prolog file.
It is
:- dynamic(inverseOf/1).
rather than
:- dynamic inverseOf/1 .
I probably wasn't clear enough in my previous email.

I attach the corrected files.

I should look into making the error thrown in this case much easier to understand as that was decidedly non-obvious.

I hope this helps and that your first time at using a bug tracker went well (you did it right),


(file #22760, file #22761)

Daniel Thomas <drt24>
Project Administrator
Tue 22 Feb 2011 07:59:46 PM UTC, comment #1: 

I also catch this error:

gnu.prolog.vm.PrologException: error(permission_error(modify,static_procedure,inverseOf / 1),error)

Tue 22 Feb 2011 07:47:54 PM UTC, original submission:  


using GNU Prolog for Java I get an IllegalArgumentException

and "The goal is not currently active".


java.lang.IllegalArgumentException: The goal is not currently active
at gnu.prolog.vm.Interpreter.stop(
at gnu.prolog.vm.Interpreter.runOnce(
at GNUPrologBug.generateBug(

The trace is edited so that you can see where the bug originates.

I'm sorry if I'm not a good bugtracker, I'm doing this for the first time. Please feel free to correct me. :-)



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #22760: added by drt24 (2KiB - application/octet-stream - Fixed files - bug now fixed)
file #22761: added by drt24 (955B - application/octet-stream - Fixed files - bug now fixed)
file #22758: added by None (1KiB - application/octet-stream)
file #22759: added by None (946B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-02-22 drt24 Attached File- Added, #22760
        Attached File- Added, #22761
        StatusNone Done
        Assigned toNone drt24
        Open/ClosedOpen Closed
    2011-02-22 None Attached File- Added, #22758
        Attached File- Added, #22759

    Back to the top

    Powered by Savane 3.11