2
$\begingroup$

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 ?

$\endgroup$
3

2 Answers 2

2
$\begingroup$

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)].$

$\endgroup$
6
  • $\begingroup$ Thanks for your answer and Mauro ALLEGRANZA' s comment too. It turns out I've really misunderstood this question . $\endgroup$
    – CPS_001
    Apr 14, 2020 at 8:25
  • $\begingroup$ I do not agree with the statement that $\land$ and $\lor$ are left-associative. $\endgroup$ Apr 14, 2020 at 9:06
  • $\begingroup$ They are both left- and right-associative. $\endgroup$
    – Wuestenfux
    Apr 14, 2020 at 9:36
  • $\begingroup$ 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 ! $\endgroup$
    – CPS_001
    Apr 14, 2020 at 10:38
  • 1
    $\begingroup$ @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. $\endgroup$ Apr 14, 2020 at 13:04
0
$\begingroup$

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)))$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .