I think [EMAIL PROTECTED] wrote:
> 
> Ernest,
> Thanks for the answers to my previous questions, now I have another one.
> Could you please explain why following code behaves differently in Jess 4.3
> and 5.0a3:
> 
> (deftemplate param
>   (multislot groups))
> 
> (defrule test-empty-multislot
>   ?f <- (param (groups))
>   =>
>   (modify ?f (groups 1))
>   (printout t "modified" crlf))
> 
> (assert (param))
> (run)
> 
> In Jess 4.3 rule "test-empty-multislot" executes once.
> In Jess 5.0a3 it enters infinite loop.
> 
> Thanks.
> 
> Miroslav Madecki, I/T specialist - RS/6000
>    Internet: [EMAIL PROTECTED]
>     Tel: +385-1-6308-156, Fax: +385-1-6111-119
>     IBM Croatia, Lastovska 23, 10000 Zagreb, Croatia
> 


This one is a bug - thanks for finding it. You have to make two
trivial changes to fix this: in jess/ReteCompiler.java, at line 296,
change
            if (p.getSlotLength(j) != 0) 

to

            if (p.getSlotLength(j) != -1) 

And in jess/Pattern.java, at line 335, change

            return 0;
to
            return -1;  


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [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. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to