1

I'm currently in a disagreement with a colleague over how one should intrepret the precedence of the ¬ operator in boolean algebra, and I hope someone here may enlighten me.

We both agree that the ¬ operator has a higher precedence than the ∨ operator (just like it is usually considered that ∧ has a higher precedence than ∨), but we disagree when it comes to interpreting this fact.

Considering the fact stated above and the formula "¬ (p ∨ r) ∨ r", if we wanted to be fully explicit by putting parentheses everywhere we can, should we say that:

a) "¬ (p ∨ r) ∨ r" <=> "¬ ((p ∨ r) ∨ r)"

or

b) "¬ (p ∨ r) ∨ r" <=> "(¬ (p ∨ r)) ∨ r"

I'm on the b) side, while my colleague is on the a) side. Does someone know if one interpretation is right and not the other, or if there's a lack of consensus about the question? No matter the answer, a clear explanation would be greatly appreciated.

Thanks a lot!

  • 1
    You are indeed correct: $(b)$ is correct. – amWhy Oct 13 '14 at 18:51
  • If you agree that $\neg$ has higher precedence than $\lor$ isn't it clear that $\neg(p \lor q)$ would be evaluated first? – Tyler Gaona Oct 13 '14 at 18:54
  • Well, I think so, since this seems to be the principle of precedence for unary operators, but simply saying that won't convince my colleague, and I can't find a stronger, more clear explanation. – user1729422 Oct 13 '14 at 18:55

1 Answers1

1

You are correct: the higher precedence of $\neg$ means precisely that it in $\neg(p\lor q)\lor r$ it binds to the $(p\lor q)$ before the final $\lor$ is performed. Thus, the expression is equivalent to $(\neg(p\lor q))\lor r$.

Brian M. Scott
  • 616,228