<br> Yes and yes.<br><br> Edson<br><br>PS: it is not that difficult... ;)<br><br><div class="gmail_quote">2008/4/8 Dirk Bergstrom <<a href="mailto:dirk@juniper.net">dirk@juniper.net</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I want to write a rule that says "Find all long-eared dogs that do not have<br>
short, black hair". This seems like the simple way to do it:<br>
<br>
collect( Dog( ears=="long", not (hair=="short" && color=="black") )<br>
<br>
But that doesn't parse. Some digging through the archives unearthed a mention<br>
of De Morgan's laws, which leads to:<br>
<br>
<a href="http://en.wikipedia.org/wiki/De_Morgan%27s_laws" target="_blank">http://en.wikipedia.org/wiki/De_Morgan's_laws</a><br>
<br>
Which explains that I can instead write:<br>
<br>
collect( Dog( ears=="long", (hair!="short" || color!="black") )<br>
<br>
Which, after some mental effort, turns out to be the right thing.<br>
<br>
However, had I not found the reference to De Morgan's Law, it would have taken<br>
me a long time to get there (if indeed I ever would have). The end result is<br>
also quite difficult to parse if you're not a logician, and thus not very<br>
user-friendly.<br>
<br>
Does anyone think it would be worthwhile to open a Jira requesting the ability<br>
to negate a constraint group? And, if I did open such a thing, do the<br>
developers think it would be reasonably easy to implement?<br>
<br>
--<br>
<font color="#888888">Dirk Bergstrom <a href="mailto:dirk@juniper.net">dirk@juniper.net</a><br>
_____________________________________________<br>
Juniper Networks Inc., Computer Geek<br>
Tel: 408.745.3182 Fax: 408.745.8905<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>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>