Propositional Logic

Introduction

Propositional logic is the formal language of Chapter 7. It is decidable, has tractable inference algorithms for moderate-sized problems, and is the foundation for all inference algorithms introduced later.


Syntax (BNF Grammar)

Sentence → AtomicSentence | ComplexSentence
AtomicSentence → True | False | Symbol
Symbol → P | Q | R | B_1_1 | Pit_2_3 | ...
ComplexSentence →
    ¬ Sentence
  | Sentence ∧ Sentence
  | Sentence ∨ Sentence
  | Sentence → Sentence
  | Sentence ↔ Sentence
  | ( Sentence )

Operator Precedence (high → low)

  1. ¬ (unary, highest)
  2. (right-associative)
  3. ↔︎ (lowest)

Terminology


Semantics: Truth Tables

All Connectives

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

Implication key insight: P → Q is false only when P=T and Q=F. Vacuously true when P=F.

Biconditional: true iff P and Q have the same truth value.


Sentence Evaluation Example

Model: m = {P=T, Q=F, R=T} Sentence: ¬P ∨ (Q → R)

  1. Q → R: F→T = T
  2. ¬P: ¬T = F
  3. F ∨ T = T ✓

Propositional Wumpus World Encoding

-- Breeze-pit axiom for [i,j]:
B_i_j ↔ (P_{i+1,j} ∨ P_{i-1,j} ∨ P_{i,j+1} ∨ P_{i,j-1})

-- Safe square:
OK_i_j ↔ ¬P_i_j ∧ ¬W_i_j

-- Percept at t=0:
¬B_1_1
¬S_1_1
¬P_1_1

Inference: {¬B_1_1, B_1_1 ↔︎ (P_1_2 ∨ P_2_1)} ⊨ ¬P_1_2 ∧ ¬P_2_1


Expressiveness Limitations

  1. Cannot write “for all squares” — must write one sentence per square.
  2. Cannot represent changing agent position without time-indexed symbols → symbol explosion.
  3. No quantifiers, no relations, no functions.

These limitations motivate first-order logic (Chapter 8).