Hi Joe.
Actually that example is showing off truth maintenance and logical
assertions.
That rule should not be fired if Hope was a normal "stated" assertion, but
it is not, it is a logical assertion (ie it depends on the truth that
supported it). In that example the "truth" that it is based on is that an
HonestPolitician exists (at least one). Once the last honest politician is
gone, then Hope will be automatically gone ( no need to retract it by hand).
If you want to learn more about truth maintenance - take a look in the
manual, its got some flow charts and descriptions of other examples etc that
go into much more detail, but the above is it in a nutshell.
Michael.
On 3/18/07, Joe Kutner <jpkutner(a)gmail.com> wrote:
Hello,
I have a question regarding the execution of the HonestPolitician
example. Why does the "Hope is Dead" rule get fired? I understand that an
activation for that rule will be included in the agenda during the first
pass ( i.e. when no Hope object exists in working memory). But shouldn't
that activation be removed once the "We have an honest Politician" rule is
fired (and thus a Hope object is asserted to working memory)?
The output I get when running the example is:
Hurrah!!! Democracy Lives
I'm an evil corporation and I have corrupted schroder
I'm an evil corporation and I have corrupted chirac
I'm an evil corporation and I have corrupted bush
I'm an evil corporation and I have corrupted blair
We are all Doomed!!! Democracy is Dead
Maybe this question is more directed rule-engines in general. Should all
rule-engines have the same output when given the exact same rule-set? Or is
there a subjectivity to how a particular rule-engine processes the agenda?
Thank you,
J
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users