View Single Post
Old 08-12-2018, 11:37 PM   #7
please55
Connoisseur
please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.please55 did not drink the Kool Aid.
 
Posts: 71
Karma: 72010
Join Date: Nov 2014
Device: none
Quote:
Originally Posted by chaley View Post
Entering Boolean Algebra zone ...

It doesn't work because the expression you wrote will match any publisher that isn't both vintage and faber, which clearly can never happen. Why does it match?

The OR operator returns TRUE if either the left or the right expression returns TRUE. The only way OR can return FALSE is if both the left and right return FALSE. Consider a book with publisher "vintage". The first expression (not publisher:vintage) returns FALSE, but the second expression (not publisher:faber) returns TRUE. FALSE or TRUE equals TRUE. The same is true for a book with publisher "faber". The first expression returns TRUE because faber is not vintage. The second expression returns FALSE because faber is faber. TRUE or FALSE returns TRUE.

You are looking for books that are neither vintage nor faber. In other words you are looking for books where either (not both) the left or the right expression returns FALSE. This requires the AND operator, which returns TRUE if both the left and right expressions return TRUE, otherwise it returns FALSE.

FWIW 1: this site shows the "truth tables" for boolean operators such as AND and OR. A "truth table" provides the result for all possible inputs.

FWIW 2: Adoby's response makes use of something called De Morgan's laws. These "laws" provide conversions between AND and OR expressions so that the expressions provide the same answer.
Thank you everyone. This always tricked me up when I did intro CS courses.

@ducks picked up this method after rereading manual shortly before coming back here. Somehow escaped my mind to use windows ctrl function for multiple selection.

Last edited by please55; 08-12-2018 at 11:45 PM.
please55 is offline   Reply With Quote