Abbreviating WFFs

“The word “abbreviation” sure is long for what it means.”
—Zach Galifianakis

Earlier, we noted that English language has problems with ambiguities. Even if there is no disagreement about the meanings of each word individually, a sentence like

He saw a girl with a telescope

has two different meanings depending on whether we read this as

He saw (a girl with a telescope)

or

He saw (a girl) with a telescope.

Similarly, even if we agreed that \land means “and”, \lor means “or”, \to means “implies”, formulas like

PQRPQR¬STP\land Q\lor R \qquad\qquad P\to Q\to R \qquad\qquad \lnot \,S\lor T

leave open the question of whether the first formula should be interpreted as “(PP and QQ) or RR” or ”PP and (QQ or RR)” and whether the second formula should be interpreted as “(PP implies QQ) implies RR” or ”PP implies (QQ implies RR)”, or whether the third equation means “(not SS) or TT” or “not (SS or TT)”. The answer matters, because we can use truth tables to verify that the possibilities are not logically equivalent.

Our official definition of Well-Formed Formulas requires parentheses around every conjunction, disjunction, and implication. This solves the problem (for logicians), because the above formulas are simply not considered well-formed. Instead, we are required to write whichever of

((PQ)R)(P(QR))((P\land Q)\lor R) \qquad\qquad (P\land (Q\lor R))
((PQ)R)(P(QR))((P\to Q)\to R) \qquad\qquad (P\to (Q\to R))
(¬S  T)¬(ST)(\lnot S \ \lor\ T) \qquad\qquad \lnot (S\lor T)

we intended to say. By requiring parentheses, every WFF is either unambiguously a propositional variable (e.g., PP), a propositional constant (e.g., \bot), a negation, and conjunction, and disjunction, or an implication, and it’s unambiguous what subformulas are intended.

Example

  • The WFF ((PQ)(RS))((P\land Q)\lor(R\to S)) can only be interpreted as the disjunction of (PQ)(P\land Q) and (RS)(R\to S).
  • The WFF ¬(PQ)\lnot(P\to Q) can only be interpreted as the negation of PQP\to Q.
  • The WFF (¬P  (QR))(\lnot P\ \to\ (Q\lor R)) can only be interpreted as saying that ¬P\lnot P implies QRQ\lor R.

This lack of ambiguity is incredibly convenient for the study of logical systems. However, when we humans are working with large formulas one must admit it is tedious to have to write

(((((PQ)R)S)T)((UV)W))(((((P\land Q)\land R)\land S)\land T)\to((U\lor V)\lor W))

instead of just

PQRST    UVW.P\land Q\land R\land S\land T \ \ \to \ \ U\lor V\lor W.

Therefore, we will make the following compromise.

  1. Officially, all WFFs remain completely parenthesized. Thus, when logicians studying the properties of this logical system want prove something about all WFFs, they can assume they only have to consider unambiguous, fully-parenthesized formulas.
  2. However, we allow ourselves to write “abbreviations” for WFFs with fewer parentheses, by defining a set of rules for how ambiguous-looking formulas should be unambiguously interpreted.

Definition

When writing WFFs, we can write abbreviated forms, and use the following rules to figure out which WFF we are referring to:

  • Precedence: ¬\lnot groups most tightly, followed in order by \land, \lor, and \to.
  • Associativity: \land and \lor are left-associative, but \to is right-associative.
  • Other: we allow ourselves to write ABA\leftrightarrow B instead of ((AB)(BA))((A\to B)\land(B\to A)) (where AA and BB here represent arbitrary WFFs). The \leftrightarrow operator has lowest precedence.

Example

  • PQRP\land Q\lor R abbreviates  ((PQ)R)\ ((P\land Q)\lor R)
    since \land groups tighter than \lor.
  • PQRP\to Q\to R abbreviates  (P(QR))\ (P\to (Q\to R))
    since \to is right-associative.
  • ¬ST\lnot \,S\lor T abbreviates  (¬ST)\ (\lnot S\lor T)
    since ¬\lnot groups tighter than \lor.
  • PQRP\land Q\leftrightarrow R abbreviates the WFF
    (((PQ)R)(R(PQ)))(((P\land Q)\to R)\land(R\to(P\land Q)))

    since \land binds tighter than \leftrightarrow.