1 Logic

1.2 Well-formed formulas

We’re now going to develop a formal language for expressing logical propositions and how they are combined using connectives.

1.2.1 Variables and connective symbols

Because we want to talk abstractly about how to reason, we don’t want to confine ourselves to particular propositions but to explore what can be said about all propositions. For that reason we introduce propositional variables: symbols that represent a proposition. Traditionally lower case English letters p, q, r, …are used for propositional variables, or letters with subscripts p1,p2,

In additional to propositional variables, the language we use will have symbols for some of the logical connectives we discussed before.

  • represents and.

  • represents or.

  • or represents implies.

  • ¬ represents not.

Finally, we will also use brackets: ( and ).

We’ve now got the “letters” of our language: propositional variables, connective symbols, and brackets. Just like the letters a, b, c…z can be used to make English sentences, we can now build what we will call formulas, like (pq), or (p(q(¬r))). But just like eifaefeaioj is a legitimate string of letters that isn’t a meaningful word, pq)¬ doesn’t seem like something we can give a useful logical interpretation to. Collections of propositional variables, connectives, and brackets to which we can give a sensible meaning will be called well-formed formulas, and we are going to see next what the rules are for a formula to be well-formed.

1.2.2 Definition of a well-formed formula

We need rules to say which strings of connectives, brackets, and variables are well-formed formulas, or WFFs for short. We do this by specifying rules for constructing WFFs. By definition, something is a WFF if and only if it can be constructed using these rules.

  1. 1.

    A propositional variable is a WFF.

  2. 2.

    If ϕ and ψ are any two WFFs then

    • 2.1

      (ϕψ) is a WFF,

    • 2.2

      (ϕψ) is a WFF,

    • 2.3

      (ϕψ) is a WFF, and

    • 2.4

      ¬ϕ is a WFF.

1.2.3 WFF examples

Suppose p and q are propositional variables. Then the following are WFFs:

  • p is a WFF because of rule 1.

  • (pq) is a WFF by using rule 1 twice then rule 2.3.

  • ¬r by using rule 1 then rule 2.4.

  • ((pq)¬r) is a WFF as rule 1 says p, q, r are WFFs, rule 2.3 and rule 2.4 say that (pq) and ¬r are WFFs, and finally rule 2.2 says the whole thing is a WFF.

  • ¬¬(pq) by rule 1, then rule 2.3, then rule 2.4 twice.

Only things that can be built using the rules are WFFs. You can’t build

rpq)¬

using the rules above (can you prove it?), so it’s not a WFF. You can’t even build pq or (pqr), so these aren’t WFFs either.