<div><br></div> Simon,<div><br></div><div> The behavior seems correct to me as B is justified by either A or C (or both). Of course, from the initial state, A is required for C to first exist, but once it starts to exist, your rules say that B and C justify each other and so both remain in memory.</div>
<div><br></div><div> This is design as intended, but do you think that is wrong?</div><div><br></div><div> Edson<br><br><div class="gmail_quote">2011/3/7 Simon Chen <span dir="ltr"><<a href="mailto:simonchennj@gmail.com">simonchennj@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
An interesting finding:<br>
<br>
I have three simple rules:<br>
rule "A2B"<br>
when<br>
A()<br>
then<br>
insertLogical(new B());<br>
end<br>
rule "B2C"<br>
when<br>
B()<br>
then<br>
insertLogical(new C());<br>
end<br>
rule "C2B"<br>
when<br>
C()<br>
then<br>
insertLogical(new B());<br>
end<br>
<br>
Basically, once we have an A(), we'll logically insert a B(). Once we<br>
have a B(), we'll logically insert a C(). Once we have a C(), we'll<br>
logically insert a B().<br>
<br>
So, I first insert an A(), print all the objects. Retract A(), and<br>
print all the objects. Here's what I got:<br>
com.sample.B@42<br>
com.sample.C@43<br>
com.sample.A@548997d1<br>
after retract!<br>
com.sample.B@42<br>
com.sample.C@43<br>
<br>
So, B() and C(), which should be logically depend on A(), somehow are<br>
not retracted. The problem I see is the truth maintenance system allow<br>
B() and C() to depend on each other, thus not affected by losing A().<br>
<br>
Is this a bug or my bad usage?<br>
<br>
Thanks.<br>
-Simon<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>