Thanks for bringing this up, it's an important issue.

I've deleted the discussion below because there are a lot of details
that aren't relevant, and I should add right awy that calling
undefrule is absolutely unnecessary before redefining an existing rule
(one look at the Java source for Rete.addDefrule would show you that.)

What's happening is that if when a new rule is defined, there are
already facts in the working memory, and at least one of those facts
causes a pattern-matching error when the rule is updated, then Jess's
rulebase ends up in a strange state. The new rule isn't added to the
list of rules that gets returned by the (rules) command, but the rule
has in fact been added to the Rete network. Because it's not in the
list, it can never be removed from the network, either, except by a
(clear) command. If the pattern-matching error was due to an error in
the way the rule was written (as it was in Mikael's case) this means
that there's essentially no way to get things working right without
restarting Jess. Although this should only be a problem in a
development/debugging environment, it's an inconvenience nonetheless.

The fix involves making slight modifications to the exception-handling
code in several classes, to make sure that no matter what happens,
things end up in a consistent state. I'll correct this in the next
release. 


I think Mikael Rundqvist (ERA) wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
> I've got a strange behaviour when using Jess60b2 and the utility command batch. If 
>it is because of a bug or me missunderstanding something I dare not say.
> The situation follows...



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to