Wumpus World is a compact environment for studying the difference between hidden truth, evidence,
logical consequence, and action under uncertainty. The agent senses only its current square. A
breeze indicates at least one adjacent pit, a stench indicates an adjacent Wumpus, and glitter
indicates gold in the current square.
The percept-knowledge-action loop
After each percept, the agent adds facts to a knowledge base and derives consequences. No breeze
rules out pits in adjacent cells. No stench rules out the Wumpus in adjacent cells. If both hazards
have been ruled out for a cell, the cell is proven safe. Positive percepts create disjunctive
constraints: a breeze says at least one adjacent cell has a pit, not which one.
True, false, and unknown
A fact can be true in the hidden world without being derivable from the agent's current knowledge.
An unknown square is therefore not the same as a dangerous square, and failure to prove danger is
not proof of safety. This is open-world reasoning: absence of a fact from the knowledge base is not
automatically treated as evidence that the fact is false.
Logical entailment is stronger than plausibility. A conclusion is entailed only when it is true in
every possible world consistent with the knowledge base.
Three action strategies
- Pure logic: moves only through squares proven safe. It may stop even when a
safe route exists, because the available evidence does not entail that route's safety.
- Hybrid: uses logical conclusions first, then may shoot, leave, or take a
heuristic risk when no safe frontier remains.
- Probabilistic: enumerates hazard configurations consistent with the current
constraints and ranks unresolved frontier cells by estimated pit probability. Lowest estimated
risk is still not the same as proven safety.
How the simplified inference works
The local rule engine repeatedly performs hazard elimination, unique-candidate inference, and safe
consolidation. These rules are sound for the patterns they encode but weaker than complete
propositional inference. Some conclusions require combining several constraints through resolution,
model checking, or a SAT solver. The teacher view reveals the hidden world only for comparison; it
is not information the agent normally receives.
What this model leaves out
Full Wumpus agents can represent orientation, forward motion, turning, shooting, bumps, screams,
action costs, and utility-sensitive planning. A probabilistic agent also needs a prior over hazard
layouts and a decision rule that balances survival probability against reward. This applet separates
those layers so learners can see where deduction ends and additional risk assumptions begin.
For teachers
Curriculum: Percepts, knowledge bases, entailment, possible worlds,
sound inference, unknown versus false, logical agents, probability under uncertainty, and action selection.
Pre-exploration prompts:
- What does one breeze establish, and what does it leave unresolved?
- Can a square be safe in reality while the agent cannot prove it safe?
- What additional assumption is needed to choose among several unknown squares?
Post-exploration prompts:
- Run pure logic until it stops. Does stopping establish that every frontier cell is dangerous?
- Reveal the world and identify one true fact that the agent cannot yet derive.
- Compare hybrid and probabilistic risk choices. Which rule ranks or selects uncertainty?
- Find a conclusion the local rules miss. What combination of constraints would a complete solver need?
Misconceptions to test: the agent sees the board; unknown means dangerous;
missing knowledge means false; pure logic deliberately gambles; a probability estimate proves safety.
Wumpus 世界是研究隐藏真相、证据、逻辑后果和不确定行动之间区别的紧凑环境。智能体只能感知当前格子。微风表示至少一个相邻格子有陷阱,臭味表示相邻处有 Wumpus,闪光表示当前格子有金子。
感知、知识与行动循环
每次获得感知后,智能体把事实加入知识库并推出结论。没有微风会排除相邻格子的陷阱,没有臭味会排除相邻格子的 Wumpus。如果某格子的两种危险都被排除,该格子就被证明安全。正向感知产生析取约束:有微风表示至少一个相邻格子有陷阱,却不说明具体是哪一个。
真、假与未知
一个事实可能在隐藏世界中为真,却无法从智能体当前知识中推出。因此,未知格子不等于危险格子,无法证明危险也不等于证明安全。这属于开放世界推理:知识库中没有某个事实,不会被自动视为该事实为假的证据。
逻辑蕴含比可能性更强。只有当某结论在所有与知识库一致的可能世界中都为真时,它才被知识库蕴含。
三种行动策略
- 纯逻辑:只进入已证明安全的格子。即使真实世界中存在安全路线,如果当前证据不能蕴含其安全性,智能体仍可能停止。
- 混合策略:先使用逻辑结论,在没有安全前沿时可能射击、离开或依据启发式承担风险。
- 概率策略:枚举与当前约束一致的危险配置,并按估计陷阱概率对未解决前沿格子排序。风险最低仍不等于已证明安全。
简化推理如何运行
局部规则引擎会反复执行危险排除、唯一候选推理和安全合并。这些规则对自身编码的模式是可靠的,但弱于完整命题推理。有些结论需要通过归结、模型检查或 SAT 求解器组合多个约束。教师视图只用于比较而揭示隐藏世界,并不是智能体通常能够获得的信息。
这个模型省略了什么
完整 Wumpus 智能体还可以表示方向、前进、转向、射箭、撞墙、尖叫、动作成本和考虑效用的规划。概率智能体还需要危险布局的先验分布,以及在生存概率和奖励之间权衡的决策规则。本工具把这些层分开,让学习者看到演绎推理在哪里结束,额外风险假设从哪里开始。
教师指导
课程目标:感知、知识库、蕴含、可能世界、可靠推理、未知与假的区别、逻辑智能体、不确定性概率和行动选择。
探索前问题:
- 一次微风能确定什么,又留下什么未解决?
- 一个格子能否在真实世界中安全,而智能体无法证明它安全?
- 在多个未知格子之间选择,需要增加什么假设?
探索后问题:
- 运行纯逻辑直到停止。停止是否说明每个前沿格子都危险?
- 揭示世界,找出一个真实但智能体尚无法推出的事实。
- 比较混合策略和概率策略的风险选择。哪条规则负责排列或选择不确定性?
- 找出局部规则遗漏的一个结论。完整求解器需要组合哪些约束?
需要检验的误解:智能体能看到整个棋盘;未知等于危险;知识缺失等于假;纯逻辑会主动赌博;概率估计能够证明安全。