I suppose that the proposed refraction (with onChange as control mechanism)<br>is based on &quot;fine-grained&quot; WM updates - the question is, how fine the grain is.<br>This is important for determining whether a rule will fire again, due to<br>
the LHS becoming false and then true again.<br><br>(These are contrived, but simple, examples.)<br><br>rule &quot;insert-retract&quot;<br>when<br>   $a : Elem()<br>   $b : Elem( this != $a )<br>then<br>   retract( $a );<br>
   // now LHS is false<br>   insert( $a );<br>   // now LHS true again<br>end<br><br>rule &quot;increment-both-facts&quot;<br>when<br>   $a : Elem( $slot : slot )<br>
   $b : Elem( slot == $slot, this != $a )<br>then<br>   modify( $a ){<br>       setSlot( $a.getSlot() +  1 )<br>   }<br>    // now LHS is false<br>   modify( $b ){<br>
       setSlot( $b.getSlot() +  1 )<br>
   }<br>    // now LHS is true again<br>end<br><br>rule &quot;increment-both-slots&quot;<br>
when<br>
   $a : Elem( $slot1 : slot1, slot2 == slot1 )<br>
then<br>
  modify( $a ){<br>
       setSlot1( $a.getSlot1() +  1 ),<br>       // now LHS is false<br>       setSlot2( $a.getSlot2() +  1 )<br>
       // now LHS is false<br>   }<br>end<br>
<br>
I&#39;m guessing that &quot;insert-retract&quot; and &quot;increment-both-facts&quot; will loop<br>even with the proposed change. I&#39;m not quite so sure about the fate<br>of  &quot;increment-both-slots&quot;, but I&#39;d bet my money on &quot;loop&quot; here, too.<br>
<br>But won&#39;t a &quot;naive&quot; interpretation of the refraction as proposed<br>lead to the assumption that none of these three rules will loop?<br><br>Anyway, a precise definition of when and how the true-false and<br>
false-true transitions may occur will be essential.<br><br>=*=<br><br>Another question arises in combination with &quot;virtual&quot; fields.<br><br>class Board { // a square board<br>   int dim;<br>   int getDim(){ return dim; }<br>
   void setDim( int dim ){ this.tim = dim; }<br>   int getFields(){ return dim*dim; }<br>}<br><br>rule &quot;enlarge-board&quot;<br>when<br>    Limit( value )<br>    $b : Board( onChange == [fields], fields &lt; value )<br>
then<br>   modify( $b ){<br>      setDim( $b.getDim() + 1 )<br>  }<br>end<br><br>I suppose this will not loop (until Limit.value is reached), but<br>I (being naive!) did say onChange == [fields]. <br><br>-W<br><br><div class="gmail_quote">
On 31 July 2010 20:53, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
  <a href="http://blog.athico.com/2010/07/slot-specific-and-refraction.html" target="_blank">http://blog.athico.com/2010/07/slot-specific-and-refraction.html</a><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br>