[rules-users] Negating a constraint group?

Edson Tirelli tirelli at post.com
Tue Apr 8 06:50:58 EDT 2008


    Yes and yes.

    Edson

PS: it is not that difficult... ;)

2008/4/8 Dirk Bergstrom <dirk at juniper.net>:

> I want to write a rule that says "Find all long-eared dogs that do not
> have
> short, black hair".  This seems like the simple way to do it:
>
> collect( Dog( ears=="long", not (hair=="short" && color=="black") )
>
> But that doesn't parse.  Some digging through the archives unearthed a
> mention
> of De Morgan's laws, which leads to:
>
> http://en.wikipedia.org/wiki/De_Morgan's_laws<http://en.wikipedia.org/wiki/De_Morgan%27s_laws>
>
> Which explains that I can instead write:
>
> collect( Dog( ears=="long", (hair!="short" || color!="black") )
>
> Which, after some mental effort, turns out to be the right thing.
>
> However, had I not found the reference to De Morgan's Law, it would have
> taken
> me a long time to get there (if indeed I ever would have).  The end result
> is
> also quite difficult to parse if you're not a logician, and thus not very
> user-friendly.
>
> Does anyone think it would be worthwhile to open a Jira requesting the
> ability
> to negate a constraint group?  And, if I did open such a thing, do the
> developers think it would be reasonably easy to implement?
>
> --
> Dirk Bergstrom               dirk at juniper.net
> _____________________________________________
> Juniper Networks Inc.,          Computer Geek
> Tel: 408.745.3182           Fax: 408.745.8905
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080408/f8bcbd67/attachment.html 


More information about the rules-users mailing list