lecture 14 situation calculus
play

Lecture 14 Situation Calculus 13 th February 2020 Outline 2 / 24 - PowerPoint PPT Presentation

Claudia Chirita School of Informatics, University of Edinburgh Based on slides by: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann, Vaishak Belle Informatics 2D Agents and Reasoning 2019/2020 Lecture 14 Situation Calculus 13 th


  1. Claudia Chirita School of Informatics, University of Edinburgh Based on slides by: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann, Vaishak Belle Informatics 2D ⋅ Agents and Reasoning ⋅ 2019/2020 Lecture 14 ⋅ Situation Calculus 13 th February 2020

  2. Outline 2 / 24 • Planning • Situations • Frame problem

  3. Using Logic to Plan We need ways of representing We haven’t said much about changing the world. Diffjculty After an action, new things are true, and some previously true facts are no longer true. 3 / 24 • the world • the goal • how actions change the world

  4. Situations Situations extend the concept of a state by additional logical terms situations generated by applying an action to a situation – by relating predicates to situations Actions are thus – performed in a situation, and – produce new situations with new facts 4 / 24 – consist of initial situation (usually called 𝑇 � ) and all Providing facts about situations e.g. instead of saying just 𝑃𝑜(𝐵, 𝐶) , say (somehow) 𝑃𝑜(𝐵, 𝐶) in situation 𝑇 � – e.g. Forward and Turn ( Right )

  5. Representing Predicates Relative to a Situation 1. Can add an argument for a situation to each predicate that can change. 5 / 24 – e.g. instead of On (𝐵, 𝐶) , write On (𝐵, 𝐶, 𝑇 � ) 2. Alternatively, introduce a predicate Holds – On etc. become functions – e.g. Holds ( On (𝐵, 𝐶), 𝑇 � ) – What do things like On (𝐵, 𝐶) mean now? A set of situations in which 𝐵 is on 𝐶 .

  6. How This Will Work Before some action, we might have in our KB A B After an action that moves A to the table, say, we add A B All these propositions are true. We have dealt with the issue of change, by keeping track of what is true when. 6 / 24 • On (𝐵, 𝐶, 𝑇 � ) • On (𝐶, Table , 𝑇 � ) • Clear (𝐶, 𝑇 � ) • On (𝐵, Table , 𝑇 � )

  7. Same Thing, Slightly Difgerent Notation Before A B After, add A B 7 / 24 • Holds ( On (𝐵, 𝐶), 𝑇 � ) • Holds ( On (𝐶, Table ), 𝑇 � ) • Holds ( Clear (𝐶), 𝑇 � ) • Holds ( On (𝐵, Table ), 𝑇 � )

  8. Representing Actions We need to represent – results of doing an action – conditions that need to be in place to perform an action – these are action types, because actions themselves are specifjc to time, etc. resulting from doing an action type in some situation”. 8 / 24 For convenience, we will defjne functions to abbreviate actions – e.g. Move (𝐵, 𝐶) denotes the action type of moving 𝐵 onto 𝐶 Now, introduce a function Result , designating “the situation – e.g. Result ( Move (𝐵, 𝐶), 𝑇 � ) means “the situation resulting from doing an action of type Move (𝐵, 𝐶) in situation 𝑇 � ”.

  9. How This Works Keep in mind that things like They can appear anywhere we would expect a situation. So we can say things like Alternatively, 9 / 24 Result ( Move (𝐵, 𝐶), 𝑇 � ) are terms and denote situations. 𝑇 � = Result ( Move (𝐵, 𝐶), 𝑇 � ) On (𝐵, 𝐶, Result ( Move (𝐵, 𝐶), 𝑇 � )) ≡ On (𝐵, 𝐶, 𝑇 � ) Holds ( On (𝐵, 𝐶), Result ( Move (𝐵, 𝐶), 𝑇 � ))

  10. Axiomatising Actions We can describe the results of actions, together with their preconditions. Alternatively, This is an efgect axiom. It includes a precondition as well. 10 / 24 e.g. “If nothing is on 𝑦 and 𝑧 , then one can move 𝑦 to on top of 𝑧 , in which case 𝑦 will then be on 𝑧 .” ∀𝑦, 𝑧, 𝑡. Clear (𝑦, 𝑡) ∧ Clear (𝑧, 𝑡) → On (𝑦, 𝑧, Result ( Move (𝑦, 𝑧), 𝑡)) ∀𝑦, 𝑧, 𝑡. Holds ( Clear (𝑦), 𝑡) ∧ Holds ( Clear (𝑧), 𝑡) → Holds ( On (𝑦, 𝑧), Result ( Move (𝑦, 𝑧), 𝑡))

  11. Situation Calculus This approach is called the situation calculus. We axiomatise all our actions, then use a general theorem prover to prove that a situation exists in which our goal is true. The actions in the proof would comprise our plan. 11 / 24

  12. Example KB + axioms about actions Goal B A C Table 12 / 24 𝑇 � On (𝐵, Table , 𝑇 � ) On (𝐶, 𝐷, 𝑇 � ) On (𝐷, Table , 𝑇 � ) Clear (𝐵, 𝑇 � ) Clear (𝐶, 𝑇 � ) ∃𝑡 � . On (𝐵, 𝐶, 𝑡 � )

  13. What happens? – Find axiom – Goal would be true if we could prove 13 / 24 • We want to prove On (𝐵, 𝐶, 𝑡 � ) for some 𝑡 � . ∀𝑦, 𝑧, 𝑡. Clear (𝑦, 𝑡) ∧ Clear (𝑧, 𝑡) → On (𝑦, 𝑧, Result ( Move (𝑦, 𝑧), 𝑡)) Clear (𝐵, 𝑡) ∧ Clear (𝐶, 𝑡) by backward chaining. – But both are true in 𝑇 � , so we can conclude On (𝐵, 𝐶, Result ( Move (𝐵, 𝐶), 𝑇 � )) • We are done! We look at the proof and see only one action, Move (𝐵, 𝐶) , which is executed in situation 𝑇 � , so this is our plan.

  14. 14 / 24 KB Table C A B Goal + axioms about actions Example ⋅ Same Situation, Harder Goal 1 𝑇 � On (𝐵, Table , 𝑇 � ) On (𝐶, 𝐷, 𝑇 � ) On (𝐷, Table , 𝑇 � ) Clear (𝐵, 𝑇 � ) Clear (𝐶, 𝑇 � ) ∃𝑡 � . On (𝐵, 𝐶, 𝑡 � ) ∧ On (𝐶, 𝐷, 𝑡 � ) � It’s not really harder, � is already on � , and we just showed how to put � on � .

  15. – Use same axiom – Again, by chaining, we can conclude If this were true, we are done. 15 / 24 With Goal On (𝐵, 𝐶, 𝑡 ′ ) ∧ On (𝐶, 𝐷, 𝑡 ′ ) • Suppose we try to prove the fjrst subgoal, On (𝐵, 𝐶, 𝑡 � ) . ∀𝑦, 𝑧, 𝑡. Clear (𝑦, 𝑡) ∧ Clear (𝑧, 𝑡) → On (𝑦, 𝑧, Result ( Move (𝑦, 𝑧), 𝑡)) On (𝐵, 𝐶, Result ( Move (𝐵, 𝐶), 𝑇 � )) – Abbreviating Result ( Move (𝐵, 𝐶), 𝑇 � ) as 𝑇 � , we have On (𝐵, 𝐶, 𝑇 � ) . • Substituting 𝑇 � for 𝑡 � in our other subgoal makes that On (𝐶, 𝐷, 𝑇 � ) . • But we have no reason to believe this is true! • Sure, On (𝐶, 𝐷, 𝑇 � ) , but how does the planner know this is still true, i.e., On (𝐶, 𝐷, 𝑇 � ) ? • In fact, it doesn’t, so it fails to fjnd an answer!

  16. The Frame Problem We have failed to express the fact that everything that isn’t changed by an action should really stay the same. There are lots of these! Is this a big problem? 16 / 24 Can fjx by adding frame axioms. ∀𝑦, 𝑡. Clear (𝑦, 𝑡) → Clear (𝑦, Result ( Paint (𝑦), 𝑡)) …

  17. 17 / 24 Better Frame Axioms • Can fjx with neater formulation: ∀𝑦, 𝑧, 𝑡, 𝑏. On (𝑦, 𝑧, 𝑡) ∧ (∀𝑨.𝑏 = Move (𝑦, 𝑨) → 𝑧 = 𝑨) → On (𝑦, 𝑧, Result (𝑏, 𝑡)) • Can combine with efgect axioms to get successor-state axioms: ∀𝑦, 𝑧, 𝑡, 𝑏. On (𝑦, 𝑧, Result (𝑏, 𝑡)) ↔ On (𝑦, 𝑧, 𝑡) ∧ (∀𝑨.𝑏 = Move (𝑦, 𝑨) → 𝑧 = 𝑨) ∨( Clear (𝑦, 𝑡) ∧ Clear (𝑧, 𝑡) ∧ 𝑏 = Move (𝑦, 𝑧))

  18. How Does This Help Our Example? – The fjrst conjunct is in the KB. – The second one is true since actions are the same ifg they 18 / 24 • We want to prove On (𝐶, 𝐷, Result ( Move (𝐵, 𝐶), 𝑇 � )) given that On (𝐶, 𝐷, 𝑇 � ) . • Axiom says ∀𝑦, 𝑧, 𝑡, 𝑏. On (𝑦, 𝑧, Result (𝑏, 𝑡)) ↔ On (𝑦, 𝑧, 𝑡) ∧ (∀𝑨.𝑏 = Move (𝑦, 𝑨) → 𝑧 = 𝑨) ∨( Clear (𝑦, 𝑡) ∧ Clear (𝑧, 𝑡) → 𝑏 = Move (𝑦, 𝑧)) • So we need to show On (𝐶, 𝐷, 𝑇 � ) ∧ (∀𝑨. Move (𝐵, 𝐶) = Move (𝐶, 𝑨) → 𝐷 = 𝑨) is true: have the same name and involve the exact same objects ∗ : 𝐵(𝑦 � , … , 𝑦 � ) = 𝐵(𝑧 � , … , 𝑧 � ) ifg 𝑦 � = 𝑧 � , … , 𝑦 � = 𝑧 � . So Move (𝐵, 𝐶) = Move (𝐶, 𝑨) is false. ∗ Another assumption in KB: �(� � , … , � � ) � �(� � , … , � � ) . These are known as Unique Action Axioms.

  19. Refutation Theorem Proving (Dual) Skolemisation Then skolemise (i.e drop the existential quantifjer): Intuition 19 / 24 Suppose ∀𝑦.∃𝑧.𝐻(𝑦, 𝑧) is the goal in resolution refutation. We need to negate the goal: ¬∀𝑦.∃𝑧.𝐻(𝑦, 𝑧) ≡ ∃𝑦.∀𝑧.¬𝐻(𝑦, 𝑧) ¬𝐻(𝑌 � , 𝑧) 𝑧 is to be unifjed to construct witness. 𝑌 � must not be instantiated.

  20. KB and Axioms as Clauses Variables Constants Initial State (neg.) Goal 20 / 24 𝑏, 𝑦, 𝑧, 𝑨, 𝑡 𝐵, 𝐶, 𝐷, 𝑇 � On (𝐵, Table , 𝑇 � ) On (𝐶, 𝐷, 𝑇 � ) On (𝐷, Tabl 𝑓, 𝑇 � ) Clear (𝐵, 𝑇 � ) Clear (𝐶, 𝑇 � ) ¬ On (𝐵, 𝐶, 𝑡 � ) ∨ ¬ On (𝐶, 𝐷, 𝑡 � )

  21. KB and Axioms as Clauses Efgect Axiom Skolem function Frame Axioms Unique Action Axioms Unique Name Axiom 21 / 24 ¬ Clear (𝑦, 𝑡) ∨ ¬ Clear (𝑧, 𝑡) ∨ On (𝑦, 𝑧, Result ( Move (𝑦, 𝑧), 𝑡)) ↙ ¬ On (𝑦, 𝑧, 𝑡) ∨ 𝑏 = Move (𝑦, 𝑎(𝑦, 𝑧, 𝑡, 𝑏)) ∨ On (𝑦, 𝑧, Result (𝑏, 𝑡)) ¬ On (𝑦, 𝑧, 𝑡) ∨ ¬𝑧 = 𝑎(𝑦, 𝑧, 𝑨, 𝑡, 𝑏) ∨ On (𝑦, 𝑧, Result (𝑏, 𝑡)) ¬ Move (𝐵, 𝐶) = Move (𝐶, 𝑨) ¬𝐷 � = 𝐷 � for every pair of distinct constants 𝐷 � and 𝐷 � in KB.

  22. Resolution Refutation 22 / 24

Recommend


More recommend