Propositional Logic
This is an article about propositional logic (PL), a formal language with propositions used to make statements. Logical agents use propositional logic to make decisions.
Propositional logic is a fundamental tool used by logical agents in AI to represent and reason about knowledge. It deals with propositions (statements that are either true or false) and logical connectives. You can refer to our logic refresher for more information on propositional logic: Logic Refresher.

Key Components of Propositional Logic
- Propositions: Simple statements (e.g., "There is a pit in room 1,1")
- Logical Connectives: AND (∧), OR (∨), NOT (¬), IMPLIES (→), EQUIVALENT (↔)

Representing Knowledge in Propositional Logic
In the context of the Wumpus World:
- Let
P(x,y)represent "There is a pit in room (x,y)" - Let
W(x,y)represent "The Wumpus is in room (x,y)" - Let
B(x,y)represent "There is a breeze in room (x,y)" - Let
S(x,y)represent "There is a stench in room (x,y)"
Example propositions:
¬P(1,1): "There is no pit in room (1,1)"B(1,1) ↔ (P(1,2) ∨ P(2,1)): "There is a breeze in (1,1) if and only if there is a pit in (1,2) or (2,1)"
Inference and Rules of Inference
Inference is the process of deriving new knowledge from existing knowledge using logical rules.
Modus Ponens:
- If
A → Bis true, andAis true, thenBmust be true
Example:
- We know:
S(1,1) → W(1,2) ∨ W(2,1) - We observe:
S(1,1)is true - We can infer:
W(1,2) ∨ W(2,1)is true
- If

Modus Tollens:
- If
A → Bis true, andBis false, thenAmust be false
Example:
- We know:
B(1,1) → P(1,2) ∨ P(2,1) - We observe:
¬P(1,2) ∧ ¬P(2,1) - We can infer:
¬B(1,1)
- If

Other inference rules can be found in the table below:

Building a Knowledge Base
A logical agent's knowledge base (KB) is constructed using propositional logic statements. For the Wumpus World:
¬P(1,1): The starting room has no pit¬W(1,1): The starting room has no WumpusB(x,y) ↔ (P(x-1,y) ∨ P(x+1,y) ∨ P(x,y-1) ∨ P(x,y+1)): A room is breezy if and only if there's an adjacent pitS(x,y) ↔ (W(x-1,y) ∨ W(x+1,y) ∨ W(x,y-1) ∨ W(x,y+1)): A room has a stench if and only if there's an adjacent Wumpus
Reasoning with the Knowledge Base
As the agent explores the Wumpus World, it:
- Adds new observations to its KB
- Uses inference rules to derive new knowledge
- Makes decisions based on what it knows and what it can infer
Example:
- Agent observes:
¬B(1,1)and¬S(1,1) - Agent can infer:
¬P(1,2) ∧ ¬P(2,1) ∧ ¬W(1,2) ∧ ¬W(2,1) - Decision: It's safe to move to (1,2) or (2,1)
Limitations of Propositional Logic
- Limited expressiveness: Cannot easily represent general statements about multiple objects
- Inability to handle uncertainty: Propositions are either true or false, with no in-between
- Complexity: As the number of propositions grows, reasoning can become computationally expensive