)is the situation that results from doing a ins Situations by the function Definition for therprdicate: rties of catons Keeping track of change Deducing hidden properties Knowledge base for the wumpus world .. Making plans Holding(Gold,)a Release) P true already and no action made P false Each axiom is"bouta predicate(not an ction per se) Describing actions II 111 Describing actions I Knowledge base for the wumpus world “Perception” ∀ b, g,t Percept([Smell, b, g],t) ⇒ Smelt(t) ∀ s, b,t Percept([s, b, Glitter],t) ⇒ AtGold(t) Reflex: ∀ t AtGold(t) ⇒ Action(Grab,t) Reflex with internal state: do we have the gold already? ∀ t AtGold(t) ∧ ¬Holding(Gold,t) ⇒ Action(Grab,t) Holding(Gold,t) cannot be observed ⇒ keeping track of change is essential Chapter 8 25 Deducing hidden properties Properties of locations: ∀ x,t At(Agent, x,t) ∧ Smelt(t) ⇒ Smelly(x) ∀ x,t At(Agent, x,t) ∧ Breeze(t) ⇒ Breezy(x) Squares are breezy near a pit: Diagnostic rule—infer cause from effect ∀ y Breezy(y) ⇒ ∃ x Pit(x) ∧ Adjacent(x, y) Causal rule—infer effect from cause ∀ x, y Pit(x) ∧ Adjacent(x, y) ⇒ Breezy(y) Neither of these is complete—e.g., the causal rule doesn’t say whether squares far away from pits can be breezy Definition for the Breezy predicate: ∀ y Breezy(y) ⇔ [∃ x Pit(x) ∧ Adjacent(x, y)] Chapter 8 26 Keeping track of change Facts hold in situations, rather than eternally E.g., Holding(Gold, Now) rather than just Holding(Gold) Situation calculus is one way to represent change in FOL: Adds a situation argument to each non-eternal predicate E.g., Now in Holding(Gold, Now) denotes a situation Situations are connected by the Result function Result(a, s) is the situation that results from doing a in s PIT PIT PIT Gold PIT PIT PIT Gold S0 Forward S1 Chapter 8 27 Describing actions I “Effect” axiom—describe changes due to action ∀ s AtGold(s) ⇒ Holding(Gold, Result(Grab, s)) “Frame” axiom—describe non-changes due to action ∀ s HaveArrow(s) ⇒ HaveArrow(Result(Grab, s)) Frame problem: find an elegant way to handle non-change (a) representation—avoid frame axioms (b) inference—avoid repeated “copy-overs” to keep track of state Qualification problem: true descriptions of real actions require endless caveats— what if gold is slippery or nailed down or . . . Ramification problem: real actions have many secondary consequences— what about the dust on the gold, wear and tear on gloves, . . . Chapter 8 28 Describing actions II Successor-state axioms solve the representational frame problem Each axiom is “about” a predicate (not an action per se): P true afterwards ⇔ [an action made P true ∨ P true already and no action made P false] For holding the gold: ∀ a, s Holding(Gold, Result(a, s)) ⇔ [(a = Grab ∧ AtGold(s)) ∨ (Holding(Gold, s) ∧ a 6= Release)] Chapter 8 29 Making plans Initial condition in KB: At(Agent, [1, 1], S0) At(Gold, [1, 2], S0) Query: Ask(KB, ∃ s Holding(Gold, s)) i.e., in what situation will I be holding the gold? Answer: {s/Result(Grab, Result(Forward, S0))} i.e., go forward and then grab the gold This assumes that the agent is interested in plans starting at S0 and that S0 is the only situation described in the KB Chapter 8 30