What is Propositional Logic?
Propositional Logic is the simplest logical language for
representing knowledge. It deals with propositions (statements that can be true or false)
and logical connectives.
Key Characteristics:
- Atomic Propositions: Basic statements that are either true or false
- Logical Connectives: Operators that combine propositions
- No Internal Structure: Propositions are indivisible
- Boolean Values: Only true (T) or false (F)
Syntax: Building Well-Formed Formulas
The syntax of propositional logic defines how to construct
valid expressions (well-formed formulas or WFFs).
Basic Components:
Symbols:
- Atomic Propositions: P, Q, R, S, ...
- Logical Connectives: ¬, ∧, ∨, →, ↔
- Parentheses: ( ) for grouping
- Constants: T (true), F (false)
Connectives:
¬
(NOT)
∧
(AND)
∨
(OR)
→
(IMPLIES)
↔
(IFF)
Well-Formed Formula Rules:
- Every atomic proposition is a WFF
- If P is a WFF, then ¬P is a WFF
- If P and Q are WFFs, then (P ∧ Q), (P ∨ Q), (P → Q), (P ↔ Q) are WFFs
- Nothing else is a WFF
Examples of WFFs:
- P (atomic proposition)
- ¬P (negation)
- (P ∧ Q) (conjunction)
- (P ∨ Q) (disjunction)
- (P → Q) (implication)
- ((P ∧ Q) → R) (complex formula)
Semantics: Truth and Meaning
The semantics of propositional logic defines what formulas
mean and when they are true or false.
Truth Tables:
Truth tables define the meaning of each connective by showing all possible truth values.
| P |
Q |
¬P |
P ∧ Q |
P ∨ Q |
P → Q |
P ↔ Q |
| T |
T |
F |
T |
T |
T |
T |
| T |
F |
F |
F |
T |
F |
F |
| F |
T |
T |
F |
T |
T |
F |
| F |
F |
T |
F |
F |
T |
T |
Key Semantic Concepts:
- Model: An assignment of truth values to all atomic propositions
- Satisfaction: A model satisfies a formula if the formula is true in that model
- Validity: A formula is valid if it's true in all models
- Contradiction: A formula is contradictory if it's false in all models
Logical Equivalences
Two formulas are logically equivalent if they have the same
truth value in all models.
| Name |
Equivalence |
Description |
| Double Negation |
¬¬P ≡ P |
Two negations cancel out |
| De Morgan's Laws |
¬(P ∧ Q) ≡ ¬P ∨ ¬Q ¬(P ∨ Q) ≡ ¬P ∧ ¬Q |
Distribute negation over connectives |
| Distributive Laws |
P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R) P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R) |
Distribute connectives |
| Implication |
P → Q ≡ ¬P ∨ Q |
Implication as disjunction |
| Biconditional |
P ↔ Q ≡ (P → Q) ∧ (Q → P) |
Biconditional as mutual implication |
| Contrapositive |
P → Q ≡ ¬Q → ¬P |
Reverse and negate |
Entailment in Propositional Logic
In propositional logic, we can determine entailment using model checking
or inference rules.
Model Checking Approach:
- List all possible models (truth value assignments)
- Check if KB is true in each model
- Check if α is true in all models where KB is true
- If yes, then KB ⊨ α
Example: Model Checking
Given: KB = {P → Q, P}, α = Q
Models:
- P=T, Q=T: KB=T, α=T ✓
- P=T, Q=F: KB=F (P→Q is false)
- P=F, Q=T: KB=T, α=T ✓
- P=F, Q=F: KB=T, α=F ✗
Result: KB ⊨ α (Q is true in all models where KB is true)
Wumpus World in Propositional Logic
Let's see how propositional logic can be used to represent knowledge in the Wumpus World:
Wumpus World Propositions:
Percepts:
- S₁,₁: Stench in (1,1)
- B₁,₁: Breeze in (1,1)
- G₁,₁: Glitter in (1,1)
- W₁,₁: Wumpus in (1,1)
- P₁,₁: Pit in (1,1)
Rules:
- S₁,₁ ↔ (W₁,₁ ∨ W₁,₂ ∨ W₂,₁)
- B₁,₁ ↔ (P₁,₁ ∨ P₁,₂ ∨ P₂,₁)
- ¬W₁,₁ ∧ ¬P₁,₁ → Safe₁,₁
Reasoning Process:
- Agent perceives stench in (1,1): S₁,₁
- Applies rule: S₁,₁ ↔ (W₁,₁ ∨ W₁,₂ ∨ W₂,₁)
- Concludes: W₁,₁ ∨ W₁,₂ ∨ W₂,₁
- Agent moves to (1,2), no stench: ¬S₁,₂
- Concludes: ¬W₁,₂
- Updates knowledge: W₁,₁ ∨ W₂,₁
Limitations of Propositional Logic
While propositional logic is powerful, it has significant limitations:
Expressiveness Limitations:
- No Objects: Can't represent "John" or "Mary"
- No Relations: Can't represent "loves(John, Mary)"
- No Quantifiers: Can't represent "all" or "some"
- No Functions: Can't represent "father(John)"
Scalability Issues:
- Exponential Growth: 2ⁿ models for n propositions
- No Structure: Can't exploit regularities
- Repetitive Rules: Must state each case separately
- No Abstraction: Can't represent general principles
Solution: First-Order Logic
These limitations motivate the need for First-Order Logic (FOL),
which we'll explore in the next topic. FOL adds objects, relations, and quantifiers
to overcome these limitations.
Key Takeaways
Syntax:
- Atomic propositions + logical connectives
- Well-formed formulas (WFFs)
- Simple but limited expressiveness
Semantics:
- Truth tables define meaning
- Models and satisfaction
- Validity and contradiction
Reasoning:
- Model Checking: Check all possible models
- Inference Rules: Apply logical rules
- Both approaches: Sound and complete
Next Steps:
Now that we understand propositional logic, we'll explore how to extend it with
objects, relations, and quantifiers in Topic 5: First-Order Logic (FOL).