What is the order of operations for $p \implies q \implies r$

2.2k Views Asked by At

I've been studying mathematical logic recently and we have briefly covered the order of operations for operators like AND/OR/IMPLIES, etc.

However, we have a challenge question regarding how the following statement should be interpreted in terms of order of operations, and I don't believe we have covered this material nor can I find the same question answered online.

The statement is $p \implies q \implies r$

The question asks if the above statement is correctly represented by $(p \implies q) \implies r$, or $p \implies (q \implies r)$, or neither - i.e. what is the correct order of operations when there are no brackets and the two logic operators are equally weighted.

I have used a truth table to determine that the above two statements are not equivalent, but are either the logical equivalent to the first statement, or neither?

3

There are 3 best solutions below

0
On

The usual convention for omitting parentheses (see e.g. Herbert Enderton, A Mathematical Introduction to Logic, Academic Press (2nd ed. 2001)) is:

  1. The outermost parentheses need not be explicitly mentioned.

  2. The negation symbol applies to as little as possible.

  3. The conjunction and disjunction symbols apply to as little as possible.

  4. Where one connective symbol is used repeatedly, grouping is to the right.

Thus, $p \to q \to r$ must be read as:

$p \to (q \to r)$.

But every convention may be checked with the formal specifications of the language used in your textbook.

2
On

The answer for the purposes of your course (or if you were to see it in a paper specifically on logic) may be different, but in general mathematical usage this is shorthand for "$p\Rightarrow q$ and $q\Rightarrow r$", similar to constructs like $a\leq b\leq c$.

(If something other than this is meant, I think parentheses should always be used.)

2
On

I don't know how widely used it is, but I find the following convention to be the most natural and convenient:

Descending Order of Precedence for Logical Operators

  1. Innermost most brackets from left to right
  2. NOT ($\neg$) from right to left
  3. AND ($\land$) from left to right
  4. OR ($\lor$) from left to right
  5. IMPLIES ($\implies$) from left to right
  6. IFF ($\iff$) from left to right

Examples

  1. $P\implies Q \implies R$ would be interpreted as $[P\implies Q ]\implies R$.
  2. $A\land B\space \lor C \land \neg D$ would be interpreted as $[A\land B] \lor [ C \land [\neg D]]$.

But, as Mauro said, "Every convention may be checked with the formal specifications of the language used in your textbook."