<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
For the case when r2 has the 'not'. When 4 doesn't exist r3 is true,
when r3 fires it asserts 4, thus r3 can no longer be true, however r4
retracts the 4 and 2&nbsp; still exists, thus enabling r3 to match again
which causes the recursion - basically the insertion and retracting of
4 is toggling r3 on and off. Best thing to do is always use the audit
log so you can visualise what's going on.<br>
<br>
Mark<br>
lukichev wrote:
<blockquote
 cite="mid:020001c80433$6136e590$a6ca2b8d@informatik.tucottbus.de"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
  <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
  </style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="Section1">
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Dear Mark,<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I have a question
concerning rule execution algorithm in
JBoss 4.0.1.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">There are 2 rule sets,
one runs in a circle and another one
stops. <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">The first one, which
stops:<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 color="green" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">"r1"</span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$num1:Integer(intValue == 1)</span></font><font face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">insert</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span></font><b><font
 color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">new</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
Integer(2));</span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">end</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 color="green" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">"r2"</span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$num1:Integer(intValue == 2)</span></font><font face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">insert</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span></font><b><font
 color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">new</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
Integer(3));</span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">end</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 color="green" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">"r3"</span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$num1:Integer(intValue == 2)</span></font><font face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</span></font><b><font color="#960000" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">insert</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span></font><b><font
 color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">new</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
Integer(4));</span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">end</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><b><font color="#960000"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 color="green" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">"r4"</span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$num1:Integer(intValue == 3)</span></font><font face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$num2:Integer(intValue == 4)</span></font><font face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">retract</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">($num2);</span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal"><b><font color="#960000" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">end<o:p></o:p></span></font></b></p>
  <p class="MsoNormal"><b><font color="#960000" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;"><o:p>&nbsp;</o:p></span></font></b></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">The second one, which
runs in a circle, is different from
the one above by the additional condition in r3:<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#960000" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">not</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">
$num2:Integer(intValue == 4)<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I would expect the same
behavior of
these two rule sets, but it is different. Could you, please, comment,
why this
is so?<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Sincerely,<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Sergey Lukichev<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Research Assistant,
REWERSE I1, rule
modeling and markup<o:p></o:p></span></font></p>
  </div>
</blockquote>
<br>
</body>
</html>