If you read the NOT (!) operator as "AND NOT" or "BUT NOT" you will get the correct search.dmaynes wrote:I'm wondering if the ! (NOT) operator is being parsed and handled as a binary logical operator.
For example, if you want to find all the scriptures containing LAMAN but not LEMUEL, you would enter <<laman ! lemuel>>. If you want to find all the scriptures containing NEPHI and LEHI but not JERUSALEM, you would enter <<nephi & lehi ! jerusalem>>.
It makes no sense to say "but not JERUSALEM and NEPHI and LEHI." Therefore, this syntax is invalid.
Because the ! operator is read "BUT NOT," it makes no sense to combine "AND BUT NOT". It is already a conjunctive operator. Being a conjunctive operator, it is commutative with AND (as long as it is not first in the logical phrase). It is not commutative with OR. If you need to use an OR operator, you should use parenthesis.
So, <<pillar & cloud & ! fire>> is invalid because you cannot read find "pillar AND cloud AND BUT NOT fire."Search priority or precedence appears to follow a strict left-to-right ordering. If you want the ordering with precedence on the right, you need to use parenthesis. The search <<pillar ! fire | cloud>> is read "pillar BUT NOT fire OR cloud." It is performed strictly left-to-right. The verses are found (1) those containing pillar, then those with fire are removed and finally any additional verses with cloud are added. It cannot be reordered with parenthesis. The search <<pillar | cloud ! fire>> has two possible orderings: <<(pillar | cloud) ! fire>> (this is the default ordering) and <<pillar | (cloud ! fire)>>. This second ordering is the same as <<cloud ! fire | pillar>>, and is read "cloud BUT NOT fire OR pillar.
A mathematician would view these operators as set operations. While there exist equivalences between set and logical operators, the exact operation is important. In terms of sets the AND (&) operation is equivalent to the intersection operator, the OR (|) operation is equivalent to the union operator, and the BUT NOT (!) operation is equivalent to the set subtraction operator.
Thanks,
Dennis