# Problem with logical operators precedence

I'm studying logical operators for school and there's a weird question that keeps bugging me even though it seems pretty basic.
I was asked to evaluate the proposition : p -> q -> r with p, r are False and q is True.
I tried evaluating it from left to right like this: ( ( p -> q ) -> r ) and got wrong answer.
Then, I checked my result with an online tool at https://web.stanford.edu/class/cs103/tools/truth-table-tool/ and it evaluates the proposition from right to left like this: ( p -> ( q -> r ) ) ( you can see in this picture ). I tried calculating the result again with this order and it was accepted as right answer !
That's really odd because my lecturer said that if operators are at the same level then the proposition should be evaluated from left to right. Have I misunderstood something ?

Well, the operations $$\wedge,\vee,\Leftrightarrow$$ are left-associative while the operation $$\Rightarrow$$ is right-associative. So

$$[p\Rightarrow q\Rightarrow r ]\Longleftrightarrow [p\Rightarrow (q\Rightarrow r)].$$

• Thanks for your answer and Mauro ALLEGRANZA' s comment too. It turns out I've really misunderstood this question . Apr 14, 2020 at 8:25
• I do not agree with the statement that $\land$ and $\lor$ are left-associative. Apr 14, 2020 at 9:06
• They are both left- and right-associative. Apr 14, 2020 at 9:36
• So, I checked everything again using web.stanford.edu/class/cs103/tools/truth-table-tool and it showed that ↔ is right associative. It's different from your answer ! Apr 14, 2020 at 10:38
• @CPS_001 - the issue is that the "symmetric" operators ($\land,\lor,\leftrightarrow$) are associative, both left- and right-. Thus, the simplest rule is: right-associativity for all binary connectives. Apr 14, 2020 at 13:04

The full convention is as follows: Outermost parentheses may be omitted, and in the absence of parentheses, the order of operations is

1. $$\lnot$$
2. $$\land$$
3. $$\lor$$
4. $$\impliedby$$ and $$\implies$$ have equal precedence
5. $$\iff$$

$$\impliedby$$ is left associative, and as Wuestenfux stated, $$\implies$$ is right associative while $$\iff$$ is left associative.

An example using everthing would be: $$a\lor b\impliedby ~a\iff a\land\lnot a\lor b$$, which reads $$(a\lor b\impliedby (~a\iff ((a\land\lnot a)\lor b)))$$.