ai unit 3-2
ai unit 3-2
22MDC45 - Unit 3
Sample: Wumpus World
■ Show original wumpus game
■ goal is to shoot wumpus
■ example of logical reasoning
■ http://www.inthe70s.com/games/wumpus/i
ndex.shtml
■ Our version:
■ Find gold, avoid wumpus, climb back out of
cave
A Wumpus Agent
■ Agent does not perceive its own location
(unlike sample game), but it can keep track
of where it has been
■ Percepts:
■ Stench – wumpus is nearby
■ Breeze – pit is nearby
■ Glitter – gold is here
■ Bump – agent has just bumped against a wall
■ Scream – agent has heard another player die
Wumpus Agent
■ Actuators:
■ Forward, Turn Left, Turn Right
■ Grab (gold)
■ Shoot (shoots arrow forward until hits
wumpus or wall)
■ agent only has one arrow
■ Climb (exit the cave)
■ Environment:
■ 4x4 grid, start at (1,1) facing right
Wumpus Agent
■ Death
■ Agent dies if it enters a pit or square with
wumpus
■ Goal: get gold and climb back out. Don’t
die.
■ 1000 points for climbing out of cave with
gold
■ 1 point penalty for each action taken
■ 10,000 point penalty for death
Some complex reasoning
examples
■ Start in (1,1)
■ Breeze in (1,2) and (2,1)
■ Probably a pit in (2,2)
■ Smell in (1,1) – where can you go?
■ Pick a direction – shoot
■ Walk in that direction
■ Know where wumpus is
The use of logic
■ A logic: formal language for
representing information, rules for
drawing conclusions
■ Two kinds of logics:
■ Propositional Logic (Chap 7)
■ Represents facts
■ And-Elimination
And-Introduction
■ “Or Introduction”
Common inference rules for
propositional logic
■ Double-Negation Elimination
■ Unit Resolution
■ Resolution
Example of using logic in
Wumpus World
■ KB contains:
Stench
Agent
Start Breeze
KB also contains knowledge of
environment
■ No stench no wumpus nearby
■ And-Elimination
Inference continued...
■ Modus Ponens and And-Elimination again:
Wumpus is in (1,3)!!!
Shoot it. Shoot where?
Determining action based on
knowledge