info-gnuprologjava
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-gnuprologjava] Re: Seriously stumped


From: Daniel Thomas
Subject: [Info-gnuprologjava] Re: Seriously stumped
Date: Tue, 22 Feb 2011 17:22:44 +0000

Hello,

You should always look at the return value of runOnce and execute and
similar instructions as they tell you whether the call actually worked
or not which is really rather helpful when debugging/running.

runOnce should avoid any problems with goals not being currently active
as it does all that for you. However without a line number or code that
I can actually run from that I can't debug what you have supplied well
enough to work out where the mistake is or if this is a bug.

Please could you send me a java file (which compiles) containing the
code which breaks and the prolog rules file. You might want to use the
support tracker
https://savannah.gnu.org/support/?func=additem&group=gnuprologjava to do
that.

Daniel

On Tue, 2011-02-22 at 12:00 +0100, Daniel Warzecha wrote:
> Hello,
> 
> 
> 
> I tried your last suggestion with the assert-Code. It throws an
> IllegalArgumentException and says "The goal is not currently active."
> 
> 
> I appended the rules file, maybe I did something wrong there. Don't
> worry, it's not very long. Perhaps you can tell me what went wrong?
> 
> 
> Code snippets:
> public static final String PATH_PROLOGRULES =
> "Prolog/umlsecrules.pro";
> 
> 
> prologEnv.ensureLoaded(AtomTerm.get(PATH_PROLOGRULES));
> prologEnv.runInitialization(prologInterpreter); 
> 
> 
>   Term [] invkeyArg = {AtomTerm.get(keyMatcher.group())}; //
> keyMatcher.group() is "k_c" here  
> CompoundTerm [] invkeyComp =
> {new CompoundTerm(AtomTerm.get("inverseOf"), invkeyArg)};
> CompoundTerm assertCT = new CompoundTerm("asserta",invkeyComp);
> try {
> prologInterpreter.runOnce(assertCT);
> }
> catch (PrologException e) {
> System.out.println(e.toString());
> }
> 
> 
> Greetings,
> Daniel Warzecha
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]