It is an extension of predicate logic.
do(action,situation) [situation] ----------------> [do(action,situation)] action
Example: Goal: Save the princess from the dragon, or
dead(dragon,s) ^ ~dead(princess,s)
Goals:
Situations in Situation Calculus are sets of formulas.
S0 = {~dead(princess,S0), ~dead(dragon,S0),...}
Actions in Situation Calculus: poss(action,S) = α(S)
Effects in Situation Calculus: poss(action,S) --> α(do(action,S)
poss. do action α ( ) ---------> ( ) S S' = do(action,S)
S0 = {~dead(princess,S0), ~dead(dragon,S0),~heavy(gun),close_to(h,gun,S0)}
Find a plan to satisfy: dead(dragon,S)
Note: Effect axioms specify the(some) change in the environment
after the execution of an action. However they do not specify what must
remain unchanged.
We need special axioms called Frame Axioms to specify
relationships that must not change.
Frame axioms for load and has
poss(load(H,G),S) --> has(H,G,do(load(H,G,S)))
How about ~dead(princess,S4)?
Add frame axioms:
prec(take(H,O),S) ^ ~dead(princess,S) --> ~dead(princess,do(take(H,O),S))
take load aim shoot ( S0 ) ----> ( S1 ) ----> ( S2 ) ---> ( S3 ) -----> ( S4 )
Frame Axioms: poss(action,S) ^ l(S) ---> l(do(action,S))
Frame Problem: too many of these axioms are needed if there are n actions and m elements, then we need <= n.m frame axioms.
A a ( poss(a, S) ^ ~dead(princess, S) ^ a /= shoot(h,gun,princess) ^ a /= eat(dragon, princess) ---> ~dead(princess,do(a,S)) )
Goals in Situation Calculus: arbitrary formulas of S.C.
E.g. E s (dead(dragon,s) ^ ~dead(princess,s)) E s ( dead(dragon,s) ^ A s1 (acc(s,s1)) --> dead(dragon, s1)) A s acc(s,s1): a acc(sx,s) ( ) ----------> ( ) --->...---> ( ) s sx s1 As ( E sx acc(sx,s1) ^ E a (sx = do(a,s)) ---> acc(s,s1))
_ _ |A| |B| ---|---|---|--- 1 2 3 E s ( acc(s,s0) ^ on(B,1,s) ^ on(A,B,s) ) _ |A| |B| ---|---|---|--- 1 2 3
Given: initial situation s0 goal α (typically E s α(s)) AI agent's KB: KB = actions U s0 U info_about_past_state | | e.g. on(A,B,s0) clear(A,spost) Planing Task: KB |-- E s α(s) To answer the goal: E s α(s) We can use an automated reasoning system for S.C. (e.g. GOLOG) (Visit the Cognitive Robotics web page at UofT) An answer is given in the form: s = do(an, do(a(n-1), do(...,do(a1,s0)...))) s0 --a1--> s1 --> ... --> s(n-2) --a(n-1)--> s(n-1) --an--> sn Plan = a1, ..., a(n-1), an
\C1 / \ / R \_/ \_/ ---|---|---|---|---|---|---|---|---|---|--- d1 d2 d3 Clean the office: Es Ad (dirt(d) ---> Al (location(l) ---> ~on(d,l,s))) π d take(robot,d) (No-deterministicly select d) To make it more complete: π d (dirt(d) ---> take(robot,d)) We'll more into extension in future courses.