Propositional Logic
A system that deals with Proposition (statements).
Proposition
A declarative sentence that is either true or false (but not both) is a proposition.
Also known as a statement.
These sentences would be considered propositions:
- It is Thursday today (true).
- I am 14 years old (false).
- 1 + 1 = 3 (false).
Usually denoted using lowercase letters , , , or .
p = It rained yesterday. q = I am happy.
The truthfulness or falsity of a proposition is called its Truth Value. Denoted by or , or 1 and 0 in computer science.
We can use connectives to change or combine the meaning of propositions. For example, negates the value of p. If it's true, it becomes false and vice versa.
Truth Table
A truth table allows us to consider all possible combinations of proposition logic systems.
For example, consider :
1 | 0 |
0 | 1 |
We can use truth tables to help us understand the truth values of other connectives within propositional logic.
Connective
Negation (NOT)
Symbol:
An operator that negates a proposition.
- = I will pass my exam.
- = I will NOT pass my exam.
In Boolean Algebra, it's equivalent to
Truth table
1 | 0 |
0 | 1 |
Disjunction (OR)
Symbol:
True when p OR q is true.
Truth table
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 1 |
0 | 0 | 0 |
Equivalent to
Conjunction (AND)
Symbol:
True only when p AND q is true.
Truth table:
1 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 1 |
0 | 0 | 0 |
Equivalent to multiplication
Implication (If...Then)
Symbol:
If p is true, then q is true.
Truth table
1 | 1 | 1 |
0 | 1 | 1 |
1 | 0 | 0 |
0 | 0 | 1 |
Think of it as a promise. Only false when promise is broken.
Bi-conditional:
Symbol:
Truth table
1 | 1 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
0 | 0 | 1 |
Equivalent to equality check:
Exclusive-Or
Symbol:
p or q but not both.
Also called XOR.
Truth Table
1 | 1 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
0 | 0 | 0 |
Truth table is opposite of bi-conditional.
Operator Precendence
Tautology
A statement that is always true.
For example: is always true.
1 | 0 | 1 |
0 | 1 | 1 |
Consistent
A formula that is true in at least one scenario.
Contradiction
A formula that is never true.
For example:
1 | 0 | 0 |
0 | 1 | 0 |
Also called "inconsistent".
Equivalence
If two formula are equivalent if they have identical truth tables.
Denoted by:
means A and B have the same Truth Table.
Note: equivalence is relation, not connective.
Can prove De Morgan's Laws using a truth table.
1 | 1 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 1 | 1 |
0 | 1 | 1 | 1 | 0 | 1 |
0 | 0 | 1 | 1 | 1 | 1 |
Laws of logic
See Laws of Logic.