Propositional and Predicate Logic
1.1 Propositional Logic
A proposition is a statement that is either true or false. Propositional logic deals with Propositions and their combinations using logical connectives.
Basic connectives:
| Symbol | Name | Meaning |
|---|---|---|
| Negation | NOT | |
| Conjunction | AND | |
| Disjunction | OR | |
| Implication | IF…THEN | |
| Biconditional | IF AND ONLY IF |
Truth tables. The implication is false only when is true and is false.
Logical equivalence. Two propositions are logically equivalent () if they have the Same truth value for all assignments.
Important equivalences:
- (De Morgan)
- (De Morgan)
1.2 Predicate Logic
Predicates extend propositional logic with variables and quantifiers.
- Universal quantifier: — ” holds for all .”
- Existential quantifier: — “there exists such that holds.”
Negation of quantifiers:
Nested quantifiers must be read carefully. The order matters:
The first says “for every there is a (possibly different) .” The second says “there exists a Single that works for all .“
1.3 Validity and Satisfiability
A formula is valid (a tautology) if it is true under all interpretations. A formula is satisfiable if it is true under at least one interpretation.
Theorem 1.1. A formula is valid if and only if its negation is unsatisfiable.
1.4 Truth Table Construction Methods
For a propositional formula with distinct variables, the truth table has rows (one per Assignment). Two systematic methods ensure no assignment is missed.
Method 1: Binary counting. Treat the first variable as the most significant bit. Enumerate all Binary -tuples from to . The first variable changes most slowly (only every rows), while the last variable alternates every row.
Method 2: Recursive splitting. For variables, the table splits into two blocks of Rows: the top block has the first variable as The bottom as . Recurse on the remaining variables within each block.
Worked Example. Construct the truth table for .
Solution
With 3 variables we have rows.
| T | T | T | T | T | T |
| T | T | F | T | F | F |
| T | F | T | F | T | F |
| T | F | F | F | T | F |
| F | T | T | T | T | T |
| F | T | F | T | F | F |
| F | F | T | T | T | T |
| F | F | F | T | T | T |
The formula is satisfiable (e.g., ) but not a tautology (e.g., ).
Worked Example. Verify that hypothetical syllogism is a tautology.
Solution
Extending the table above:
| T | T | T | T | T | T |
| T | T | F | F | F | T |
| T | F | T | F | T | T |
| T | F | F | F | F | T |
| F | T | T | T | T | T |
| F | T | F | F | T | T |
| F | F | T | T | T | T |
| F | F | F | T | T | T |
The final column is all Confirming the tautology.
1.5 Natural Deduction
Natural deduction is a …/1-number-and-algebra/3proof-and-logic system that mirrors ordinary mathematical reasoning. Each connective Has introduction rules (how to _derive a formula with that connective) and elimination rules (how to use a formula with that connective).
Rules of inference:
| Rule | Premises | Conclusion |
|---|---|---|
| -I | , | |
| -E | ||
| -E | ||
| -I | ||
| -I | ||
| -E | , , | |
| -I | ||
| -E | , | |
| -I | ||
| -E | , | |
| DNE | ||
| RAA |
Square brackets denote an assumption that is discharged after the rule is applied.
Worked Example. Prove: (contraposition).
Solution
- — premise
- — assumption (for -I)
- — assumption (for -I)
- — -E on 1, 3
- — -E on 4, 2
- — -I on 3—5, discharging
- — -I on 2—6, discharging
Worked Example. Prove: (disjunctive syllogism).
Solution
- — premise
- — premise
- — assumption (left case for -E)
- — -E on 3, 2
- — ex falso on 4
- — assumption (right case for -E)
- — reiterate 6
- — -E on 1, 3—5, 6—7
Worked Example. Prove: (distribution).
Solution
- — premise
- — -E on 1
- — -E on 1
- — assumption (left case for -E on 3)
- — -I on 2, 4
- — -I on 5
- — assumption (right case for -E on 3)
- — -I on 2, 7
- — -I on 8
- — -E on 3, 4—6, 7—9
:::caution Common Pitfall In natural deduction, always track which assumptions are discharged. A common mistake is to use a Discharged assumption in a later step. Each discharged assumption is only valid within the scope Indicated by the rule that discharges it. :::
1.6 CNF and DNF
A literal is a propositional variable or its negation. A clause is a disjunction of literals. A term (or cube) is a conjunction of literals.
- Disjunctive Normal Form (DNF): a disjunction of terms, e.g. .
- Conjunctive Normal Form (CNF): a conjunction of clauses, e.g. .
Theorem 1.2. Every propositional formula is equivalent to a formula in CNF and to a formula in DNF.
Conversion to CNF:
- Eliminate and : And .
- Push inward using De Morgan”s laws and double negation () until every applies to a single variable.
- Distribute over : .
Conversion to DNF: Same steps 1—2; in step 3 distribute over instead.
Worked Example. Convert to CNF.
Solution
Step 1: No or to eliminate.
Step 2: No to push inward.
Step 3: Distribute over :
.
Since is a tautology we may simplify to .
Worked Example. Convert to CNF.
Solution
Step 1: Eliminate : .
Step 2: Push inward: .
Step 3: Distribute over : .
This is in CNF.
:::caution Common Pitfall Distributing over can cause exponential blowup. A DNF formula with terms can Produce up to clauses when converted to CNF. This exponential growth underlies the hardness Of many satisfiability problems. :::
1.7 Resolution
The resolution rule is a single inference rule that is refutation-complete for propositional Logic.
Resolution rule. From clauses and Derive the resolvent Where and are (possibly empty) sets of literals and is a propositional Variable.
Resolution refutation. To show that clauses entail clause :
- Add to the clause set.
- Repeatedly apply the resolution rule to derive new clauses.
- If the empty clause is derived, the entailment holds.
Theorem 1.3 (Refutation completeness). If a set of clauses is unsatisfiable, the empty clause Can be derived by resolution.
Worked Example. Show that entails .
Solution
Add the negation of the conclusion: clause (4) .
Clauses: (1) ; (2) ; (3) ; (4) .
Resolve (2) and (4) on : (5) . Resolve (1) and (5) on : (6) . Resolve (3) and (6) on : (7) . Resolve (7) and (4) on : (8) .
Since is derived, the entailment holds.
1.8 The SAT Problem
The Boolean satisfiability problem (SAT) asks: given a propositional formula Is there a Truth assignment that makes true?
Definition. An instance of SAT is a propositional formula. The answer is YES if is Satisfiable, NO otherwise.
k-SAT. A restricted version where the formula is in CNF and every clause has exactly Literals.
- 1-SAT: solvable in linear time (each clause is a single literal).
- 2-SAT: solvable in time using the implication graph and strongly connected components, where is the number of variables and the number of clauses.
- 3-SAT: NP-complete (Cook—Levin theorem, 1971). This was the first problem proven NP-complete.
Theorem 1.4 (Cook—Levin). SAT is NP-complete. Consequently, 3-SAT is also NP-complete.
SAT solvers (DPLL, CDCL) are widely deployed in hardware verification, software model checking, and AI planning. Modern solvers routinely handle instances with millions of variables.
:::caution Common Pitfall Do not confuse satisfiability with validity. A formula is satisfiable if it is true under some Assignment; it is valid (a tautology) if true under all assignments. Checking validity is Co-NP-complete, not NP-complete.
:::