Skip to main content
added 142 characters in body
Source Link
Raphael
  • 72.9k
  • 30
  • 181
  • 393

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$.

David's warning is apt, though: if you want to be clear, don't rely on implicit precedences. Typesetting can help -- you can e.g. group terms with spacings -- but in case of doubt, just put the parentheses. In a larger body of work, you can also state your convention once and safe symbols afterwards, provided you stick to your own rules.

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$.

David's warning is apt, though: if you want to be clear, don't rely on precedences. Typesetting can help -- you can e.g. group terms with spacings -- but in case of doubt, just put the parentheses.

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$.

David's warning is apt, though: if you want to be clear, don't rely on implicit precedences. Typesetting can help -- you can e.g. group terms with spacings -- but in case of doubt, just put the parentheses. In a larger body of work, you can also state your convention once and safe symbols afterwards, provided you stick to your own rules.

added 202 characters in body
Source Link
Raphael
  • 72.9k
  • 30
  • 181
  • 393

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$.

David's warning is apt, though: if you want to be clear, don't rely on precedences. Typesetting can help -- you can e.g. group terms with spacings -- but in case of doubt, just put the parentheses.

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$.

David's warning is apt, though: if you want to be clear, don't rely on precedences. Typesetting can help -- you can e.g. group terms with spacings -- but in case of doubt, just put the parentheses.

Source Link
Raphael
  • 72.9k
  • 30
  • 181
  • 393

If you look at formal definitions of the syntax of propositional logic, you will find that

$\qquad p \land \lnot q \to r$

is not a proper sentence; parentheses are needed to avoid exactly the ambiguity you mention.

Operator precedences can be used for implicit parenthesisation. You seem to be asking if there are agreed-upon operator precedences in logic.

I don't think formal logics contains this concept; formal grammars just do not lend themselves to model precedences (or any ambiguity) very well. In practice (by which I mean both blackboard writing and implemented logic parsers), we do use precedences; usual conventions include

  1. $\lnot$,
  2. $\land$,
  3. $\lor$,
  4. $\implies$,
  5. $\iff$

in decreasing order of precedence. Using these, your example is equivalent to

$\qquad (p \land (\lnot q)) \to r$