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

 
 

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

Submitted by:  None
Submitted on:  Tue 22 Feb 2011 07:47:54 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 4 - ImportantStatus: Done
Privacy: PublicAssigned to: Daniel Thomas <drt24>
Originator Email: -unavailable-Open/Closed: Closed
Operating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Only
:- 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 AdministratorIn charge of this item.
Tue 22 Feb 2011 08:24:06 PM UTC, comment #3:

headslap

Okay, that explains a lot.

Perhaps ensureLoaded could validate the prolog file...

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

both syntactically correct prolog inputs?

Anonymous
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)
{
System.err.println(loadingErrors);
return;
}

(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),

Daniel

(file #22760, file #22761)

Daniel Thomas <drt24>
Project AdministratorIn charge of this item.
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)

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

Hello,

using GNU Prolog for Java I get an IllegalArgumentException

and "The goal is not currently active".

Trace:

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

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. :-)

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #22760:  GNUPrologBug.java added by drt24 (2kB - application/octet-stream - Fixed files - bug now fixed)
file #22761:  umlsecrules.pro added by drt24 (955B - application/octet-stream - Fixed files - bug now fixed)
file #22758:  GNUPrologBug.java added by None (1kB - application/octet-stream)
file #22759:  umlsecrules.pro 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
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Feb 2011 08:11:20 PM UTCdrt24Attached File-=>Added GNUPrologBug.java, #22760
      Attached File-=>Added umlsecrules.pro, #22761
      StatusNone=>Done
      Assigned toNone=>drt24
      Open/ClosedOpen=>Closed
    Tue 22 Feb 2011 07:47:54 PM UTCNoneAttached File-=>Added GNUPrologBug.java, #22758
      Attached File-=>Added umlsecrules.pro, #22759

    Back to the top


    Powered by Savane 3.1-cleanup