# 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 $p_{1},p_{2},\ldots$

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

• $\wedge$ represents and.

• $\vee$ represents or.

• $\to$ or $\implies$ represents implies.

• $\neg$ 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 $(p\vee q)$, or $(p\implies(q\wedge(\neg r)))$. But just like eifaefeaioj is a legitimate string of letters that isn’t a meaningful word, $\wedge\implies pq)\neg$ 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 $\phi$ and $\psi$ are any two WFFs then

• 2.1

$(\phi\wedge\psi)$ is a WFF,

• 2.2

$(\phi\vee\psi)$ is a WFF,

• 2.3

$(\phi\implies\psi)$ is a WFF, and

• 2.4

$\neg\phi$ 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.

• $(p\implies q)$ is a WFF by using rule 1 twice then rule 2.3.

• $\neg r$ by using rule 1 then rule 2.4.

• $((p\implies q)\vee\neg r)$ is a WFF as rule 1 says $p$, $q$, $r$ are WFFs, rule 2.3 and rule 2.4 say that $(p\implies q)$ and $\neg r$ are WFFs, and finally rule 2.2 says the whole thing is a WFF.

• $\neg\neg(p\implies q)$ 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

 $r\wedge\implies pq)\neg$

using the rules above (can you prove it?), so it’s not a WFF. You can’t even build $p\vee q$ or $(p\wedge q\wedge r)$, so these aren’t WFFs either.