The meaning of "IF" – An Introduction to Formal Logic
When I was introduced to formal logic in my first year of university, the hardest thing for me was coming to understand what the word "if" means. Its use in every day language is similar to its logical definition, but differes just enough to cause great confusion.
In formal logic, words like "if", "and", "or", "but", and "not" are called junctors. They take either one or two truth values (either true or false) and produce another truth value. The simplest one is "not", which just inverts the truth value you give it:
| Input | Output |
|---|---|
| True | False |
| False | True |
If you apply NOT to true, you get false. If you apply NOT to false, you get true. Logicians use the symbol ¬ to denote the junctor NOT. So we can write:
- ¬true = false
- true = ¬false
- ¬true = ¬(¬false)
The same can be done for the other junctors. Logicians use the ∧ symbol for AND, and they use the ∨ symbol for OR. The definition of AND is what you would expect. It takes two truth values and produces true if both inputs are true and false if any one of them is false:
| Input #1 | Input #2 | Output |
|---|---|---|
| False | False | False |
| False | True | False |
| True | False | False |
| True | True | True |
The formal meaning of OR is different from how we use it in everday english. If I asked you, "Do you want cake or pie?", I'm really asking you to pick one or the other, but not both. So it seems that OR should be true when exactly one of its inputs is true, but that's actually a different junctor called xor. The right logical definition of OR is true when either or both of the inputs are true, and is false only when both inputs are false:
| Input #1 | Input #2 | Output |
|---|---|---|
| False | False | False |
| False | True | True |
| True | False | True |
| True | True | True |
Now we can begin to write simple sentences in predicate logic. Predicate logic works by combining predicates (think of them as variables that can hold truth values) with junctors. For example, if the predicate H means, "I am hungry", and the predicate S means, "I am sad", then the sentence "I am hungry and I am not sad" is written like this:
H ∧ (¬S)
This sentence is true when both H and ¬S are true. In other words, it is true when H is true (I am happy) and S is false (I am not sad).
As another example, here is how you can write the sentence "Joey likes cats or Joey likes dogs but Joey doesn't like fish", where C means "Joey likes cats", D means "Joey likes dogs", and F means "Joey likes fish":
(C ∨ D) ∧ (¬F)
Note that "but" means exactly the same thing as "and" in formal logic!


