[jboss-jira] [JBoss JIRA] (DROOLS-24) forall( p1 p2 p3...) --> not forall
Davide Sottara (JIRA)
jira-events at lists.jboss.org
Sat Sep 7 23:14:03 EDT 2013
[ https://issues.jboss.org/browse/DROOLS-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802586#comment-12802586 ]
Davide Sottara commented on DROOLS-24:
--------------------------------------
Remember the semantics of "not" and "forall" in Drools. The former is actually "not exists", while
forall( $x:A() B($x) C($x) )
reads as "for all $x such that A($x), there exists $b,$c : $b : B($x) and $c : C($x)"
which, by deMorgan, is equivalent to : "there is no $x such that, at the same time, A($x) and neither exists $b:B($x) nor exists $c:C($x)".
in DRL-like : not( $x:A() and not( B($x) and C($x) ) ) --> not( $x:A() and ( not B($x) or not C($x) ) )
So, while a bit cryptic, I think that the documentation is correct.
One might argue whether FOL is captured appropriately or not, but that's a different question
> forall( p1 p2 p3...) --> not forall
> -----------------------------------
>
> Key: DROOLS-24
> URL: https://issues.jboss.org/browse/DROOLS-24
> Project: Drools
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Affects Versions: 5.5.0.Final
> Environment: all
> Reporter: Marc Dzaebel
> Assignee: Mark Proctor
> Priority: Trivial
> Labels: documentation
>
> Expert guide:
> "As a side note, forall( p1 p2 p3...) is equivalent to writing:
> not(p1 and not(and p2 p3...))"
> --> insert not
> "As a side note, not forall ..."
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list