Since the following rule is just a variant of (Expert) Example 4.66, &quot;All Buses are Red&quot;, I think that there is a bug, in 5.1.1:<br><br>// Does not fire even though all Triangle have all sides &gt; 0<br>rule &quot;All triangle sides are greater than 0&quot;<br>
when<br>    forall( Triangle( a &gt; 0, b &gt; 0, c &gt; 0 ) )<br>then<br>    System.out.println( &quot;All triangle sides are &gt; 0.&quot; );<br>end<br><br>Also, the tortuous equivalent does not fire: <br><br>// Does not fire even though all Triangle have all sides &gt; 0<br>
rule &quot;All triangle sides are greater than 0&quot;<br>
when<br>
    forall( $t: Triangle()<br>               Triangle( this == $t, a &gt; 0, b &gt; 0, c &gt; 0 ) )<br>
then<br>
    System.out.println( &quot;All triangle sides are &gt; 0.&quot; );<br>
end<br><br>-W<br><br><br><div class="gmail_quote">On 12 September 2010 19:45, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</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;">
Given classes<br>   class Triangle { int a, b, c;... }<br>   class Quadrangle { int a, b, c, d;... }<br>with appropriate getters (but no hashCode or equals) and these facts<br>   Triangle( 3, 3, 3 )<br>   Triangle( 3, 3, 3 )  // a duplicate, intentional<br>

   Quadrangle ( 3, 4, 5, 6 );<br>the rule<br>   rule &quot;all equilaterals have a &#39;fitting&#39; quadrangle&quot;<br>   when<br>      forall( Triangle( $a: a, b == $a, c == $a )<br>         Quadrangle( a == $a || b == $a || c == $a || d == $a ) )<br>

   then // ...<br>   end<br>works as expected - it fires.<br><br>But the rule<br>   rule &quot;all equilaterals have a duplicate&quot;<br>
   when<br>
      forall( $t: Triangle( $a: a, b == $a, c == $a )<br>
         Triangle( this != $t, a == $a, b == $a , c == $a ) )<br>
   then // ...<br>
   end<br>does not fire, not even when I omit  this != $t. Why?<br><br>Do I have a white spot in my grey cells? Please tint my taint...<br><font color="#888888"><br>-W<br><br>
</font></blockquote></div><br>