3. planning in situational calculas
TRANSCRIPT
1
Planning in situational calculus
2
Situation Calculus
• The idea behind situation calculus is that (reachable) states are definable in terms of the actions required to reach them.
• These reachable states are called situations. What is true in a situation can be defined in terms of relations with the situation as an argument.
3
Situation Calculus contd..
• Situation calculus is defined in terms of situations. A situation is either
• init, the initial situation, or • do(A,S), the situation resulting from doing
action A in situation S, if it is possible to do action A in situation S.
4
Contd..
• Situations are connected by the Result function
• e.g. s1= Result(a,s0) is the function giving the situation that results from doing action a while in situation s0
• Here, we represent an action sequence (plan) by a list [first | rest ] where
5
Contd..
• 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))
6
Contd..
• Provides a framework for representing change, actions and reasoning about them.
• Situational calculus:• - is based on FOPL;• - a situation variable models new stars of the
world;• - action objects model activities;• - uses inference methods developed for FOPL to
do the reasoning.
7
Planning in Situational Calculus • Situational calculus is a dialect of first order predicate
calculus formalization of states, actions and the effects of actions on states.
• Actions:- every change requires actions. The constant and function symbols for actions are completely dependent on the application. Actions typically have preconditions.
• Situations:- denote possible world histories.
– Constant s0 and function symbol do are used, s0 denotes the initial situation before any action has been performed.
– do(a, s) denotes the new situation that results from the performing action a in situation s.
8
SITUATIONAL CALCULUSSituational calculus is based on FOPL plus: Special variables: s,a – objects of type situation and action Action functions: return actions.
E.g., move(A, TABLE, B) represents a move action move(x, y, z) represents an action schema
Two special function symbols of type situation s0 – initial situation do(a,s) – denotes the situation obtained after
performing an action a in situation s.Situation-dependent functions and relations
also called fluents Relation: on(x, y, s) – object x is on object y in situation
s; Function: above(x, s) – object that is above x in
situation s.
9
• Shopping Problem– “Get a liter of milk, a bunch of bananas and a variable-
speed cordless drill.”• Need to define– Initial state– Operations
• A planning problem represented in situational calculus by logical sentences
– initial state : For shopping problemat(Home,s0) ¬have(Milk, s0) ¬have(Banana, s0) ¬have(Drill,s)
– goal state: a logical querys: at(Home,s) have(Milk,s) have(Bananas,s) have(Drill,s)
Situational Calculus Example
10
• Operators : description of actions a,s: have(Milk,Result(a,s)) [(a=buy(Milk)
at(Supermarket,s) (have(Milk,s) a drop(Milk))]
• Result’(l,s) means result from sequence of actions l starting in s.s: Result’([],s)=s a,p,s: Result’([a|p],s)=Result’(p,Result(a,s))
Operators in Situational Calculus
11
• Solutions– solution : a plan that an agent guarantees achievement of
the goal– a solution is a complete and consistent plan– a complete plan : every precondition of every step is
achieved by some other step– a consistent plan : no contradictions in the ordering or
binding constraints. When we meet a inconsistent plan we backtrack and try another branch
Solutions in Situational Calculus
12
• A solution to the shopping problem is a plan P, applied to so, that yields a situation satisfying the goal query :
at(Home, Result’(p,s0)) have(Milk,Result’(p, s0)) have(Bananas,
result’(p, s0) have(Drill,Result’ (p, s0))
P = [Go(Supermarket),Buy(Bananas),Go(HardwareStore),Buy(Drill),
Go(Home)]
• To make planning practical:1. Restrict the language2. use a special-purpose algorithm
Solutions in Situational Calculus: Example