Docsity

AI Lecture Notes: Situation Calculus & Planning in CSE150, Spring '07, Study notes of Computer Science

Partial preview of the text

Download AI Lecture Notes: Situation Calculus & Planning in CSE150, Spring '07 and more Study notes Computer Science in PDF only on Docsity!

Situation Calculus Situation Calculus

Introduction to Artificial Intelligence Cse 150

The Midterm The Midterm

  • Will cover Chapters 1-
  • Yes, it will graded on a curve

Other News Other News

  • Charles Elkan will lecture on Tuesday
  • What he covers most likely won’t be on the

midterm, but will be on the final!

This lecture This lecture

  • Situation Calculus
  • Planning Reading Reading
  • Chapter 10

Planning Planning

Find a sequence of operator instances that transform an initial state into a state in which the goal is satisfied. Issues:

  1. Representation of states
  2. Representation of actions
  3. Representation of goals
  4. Representation of plans

Wumpus world: Building an agent using FOL Wumpus world: Building an agent using FOL

  • We can ask the KB what action to do: Ask(KB, ∃a Action(a,5))
  • The FOL system would then have to infer whether the KB entails any particular actions for t=5.
  • Answer: Yes, {a/Shoot}  substitution (binding list)
    • [USING BOOK’S NOTATION!!!]
  • Given a sentence S and a substitution σ, Sσ denotes the result of substituting (plugging in) σ into S - S = Bigger(x,y) - σ = {x/Cow, y/Lamb} - Sσ = Bigger(Cow, Lamb)
  • Ask(KB,S) returns some/all σ such that KB S σ

Deducing Hidden Properties Deducing Hidden Properties

  • “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. diagnostic rule doesn’t tell us that if there is no breeze then there isn’t a pit nearby.
  • Definition of Breezy predicate: ∀y Breezy(y) ⇔ [∃x Pit(x) ∧ Adjacent(x,y)]

Describing actions I 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 repeatedcopy-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, …

Describing actions II Describing actions II

Successor-state axioms solve the representational frame problem

  • Combine effect and frame axioms
  • List all ways in which a predicate can be true or become false
  • 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≠ Release)]

Planning in situation calculus Planning in situation calculus

  • Situations are connected by the Result function e.g. s 1 = Result(a,s 0 ) is the function giving the situation that results from doing action a while in situation s 0 Here, we represent an action sequence (plan) by a list [first | rest ] where first is the initial action and rest is a list of remaining actions. PlanResult(p,s) generalizes Result to give the situation resulting from executing p starting from state s: ∀s PlanResult([],s) = s ∀s,a,p PlanResult([a | p], s) = PlanResult(p, Result(a,s))

Planning in situation calculus Planning in situation calculus

Initial state: At(Home,S 0 ) ∧ ¬Have(Milk,S 0 ) ∧ ¬Have(Bananas,S 0 ) ∧ … Actions as Successor State axioms: Have(Milk,Result(a,s)) ⇔ [(a=Buy(Milk) ∧ At(Supermarket,s)) ∨ (Have(Milk,s) ∧ a≠Drop(Milk))] Query: ∃p (s=PlanResult(p,S 0 )) ∧ At(Home,s) ∧ Have(Milk,s) ∧ Have(Bananas,s) ∧… Solution p = [Go(Supermarket),Buy(Milk),Buy(Bananas),Go(HWS), Buy(Drill), … ] Consider the task: get milk, bananas, and a cordless drill

Search vs. Planning Search vs. Planning

  • Standard search algorithms seem to fail miserably:
  • Why? Huge branching factor & heuristics & goal tests are inadequate Consider the task: get milk, bananas, and a cordless drill

Search vs. planning contd. Search vs. planning contd.

Planning systems do the following:

  1. open up action and goal representation to allow selection
  2. divide-and-conquer by subgoaling
  3. relax requirement for sequential construction of solutions Search Planning States Lisp data structures Logical sentences Actions Lisp code Preconditions/outcomes Goal Lisp code (func of state) Logical sentence (conjunction) Plan Sequence from S 0 Constraints on actions

STRIPS operators: STRIPS operators:

A restrictive language A restrictive language

Action description: name & variable symbols Precondition: Conjunction of positive literals Effect: conjunction of literals (positive or negative) Example: Action: Buy(x) Precondition: At(p), Sells(p,x) Effect: Have(x)

  • Operator Schema : an operator with variables
  • An operator is applicable in state s if there is some way to instantiate the variables so every precondition is true in s
  • In STRIPS, No situation variables – situation variables are implicit. A depiction of an operator schema

A note A note ……

STRIPS: STanford Research Institute Problem Solver Original notation in STRIPS language found elsewhere:

  • Precondition
  • Delete List
  • Add List Shakey