[rules-users] forall is satisfied when there is nothing?

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jan 8 03:28:20 EST 2014


On 08/01/2014, Davide Sottara <dsotty at gmail.com> wrote:
> Indeed it is true by convention, see also
> http://en.wikipedia.org/wiki/Universal_quantification
>
> The only other alternative is to deprecate quantifiers altogether ;)
>

Ah, *by convention*, yes. One should exercise some care with "vacuous
truths", however. Uttering statements such as "All the little green
men in my room are from Mars" may not brand you as a liar, but you
could be called "batty". ;-)

-W

> Davide
>
> On 01/07/2014 11:53 AM, Wolfgang Laun wrote:
>> Please comment on
>> http://en.wikipedia.org/wiki/First-order_logic#Empty_domains
>> -W
>>
>> On 07/01/2014, Davide Sottara <dsotty at gmail.com> wrote:
>>> First order logic does permit empty domains, and the universal
>>> quantifier evaluates to true in that case.
>>> Davide
>>>
>>> On 01/07/2014 11:11 AM, Wolfgang Laun wrote:
>>>> It is true that first-order logic usually assumes that the domain of a
>>>> formula
>>>> be a nonempty set. As so often, things aren't quite so simple when
>>>> formulae
>>>> are evaluated on a computer. What should be done in this case, forall
>>>> with an empty domain? Throw an exception? Not very convenient, since
>>>> there's no reasonable way of handling exceptions thrown on the LHS.
>>>> Return false? That doesn't make sense, because you can't inspect what
>>>> isn't there. Return true? If it isn't false - what else?
>>>>
>>>> If first-order logic does permit empty domains, it must be treated as
>>>> a special case.
>>>>
>>>> -W
>>>>
>>>> On 07/01/2014, Sonata <plz.write.to at gmail.com> wrote:
>>>>> Hi, I am using the "forall" keyword on the LHS and it seems the
>>>>> condition
>>>>> is
>>>>> satisfied when there is nothing to match. e.g. "forall (MyClass(value
>>>>> ==
>>>>> "test"))" fires the rule when there is no MyClass() object in the
>>>>> working
>>>>> memory. My workaround is add "exists (MyClass())".
>>>>>
>>>>> Also, same for "not (exists (MyClass(value != "test")))", but I can
>>>>> understand this, as there is no MyClass() object, it doesn't exists
>>>>> and
>>>>> hence "not" gives true.
>>>>>
>>>>> But for "forall", it doesnt sound right to me. I wonder if "forall" is
>>>>> actually implemented as "not exists" in the engine.
>>>>>
>>>>> Please clarify if this is by design or a bug. Build is 5.5.0.Final
>>>>>
>>>>> Thank you
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://drools.46999.n3.nabble.com/forall-is-satisfied-when-there-is-nothing-tp4027553.html
>>>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> rules-users mailing list
>>>>> rules-users at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>>>
>>>> _______________________________________________
>>>> rules-users mailing list
>>>> rules-users at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>>
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list