Upcoming SlideShare
×

# 3. planning in situational calculas

431 views

Published on

Published in: Technology, Education
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
431
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
10
0
Likes
1
Embeds 0
No embeds

No notes for slide

### 3. planning in situational calculas

1. 1. Planning in situational calculus 1
2. 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. 2
3. 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. 3
4. 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 4
5. 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)) 5
6. 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. 6
7. 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. 7
8. 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. 8
9. 9. Situational Calculus Example• 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 problem at(Home,s0)  ¬have(Milk, s0)  ¬have(Banana, s0)  ¬have(Drill,s) – goal state: a logical query s: at(Home,s)  have(Milk,s)  have(Bananas,s)  have(Drill,s) 9
10. 10. Operators in Situational Calculus• 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)) 10
11. 11. Solutions in Situational Calculus• 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 11
12. 12. Solutions in Situational Calculus: Example• 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 language 2. use a special-purpose algorithm 12