Issue #12110 has been updated by Martin Drst.


Tsuyoshi Sawada wrote:

> In natural language, universal quantification carries a presupposition that the domain is non empty; the meaning of "for all x in A, p(x)" is undefined when A is empty, just like "the king of the United States" is undefined. And whenever universal quantification is defined, the entailment holds: "for all x in A, p(x) вк for some x in A, p(x)" (And the word "any" in a question is the same as "some" here). That is probably what Andrew Vit was mentioning. And that is where natural language and formal systems differ, which makes the latter a bit counter-intuitive.

I agree that in natural language, expressions that are similar to universal quantification usually assume that the underlying set is not empty. But this isn't so much because that's how natural language works. It is more because natural language is used in context, and it's usually clear from context already that the underlying set is not empty. If it's known that the underlying set is empty, then statements with universal quantifications are simply not made, because they are not needed. This is different from Mathematics and programming, where we as much as possible don't want to treat the empty set as special.

----------------------------------------
Feature #12110: Create a method to avoid vacuous truth?
https://bugs.ruby-lang.org/issues/12110#change-57395

* Author: Waldyr de Souza
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
I often find myself running into unexpected results when using #all? for example

[].all? { |e| false } # => true

Even though it's logically correct could we have a method that express the following?

foo.any? && foo.all?(&:bar)



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>