Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

51
Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας Θοδωρής Πάτκος Αναπαράσταση και Επεξεργασία Γνώσης ΗΥ- 467 2009

description

Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας. Θοδωρής Πάτκος. Αναπαράσταση και Επεξεργασία Γνώσης ΗΥ-467 2009. Outline. Introduction to Action Theories Basic Issues using the Event Calculus Frame Problem Ramification Problem Qualification Problem - PowerPoint PPT Presentation

Transcript of Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Page 1: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Reasoning about Actions and CausalityΘεωρίες Δράσης και Αιτιότητας

Θοδωρής Πάτκος

Αναπαράσταση και Επεξεργασία Γνώσης ΗΥ-467

2009

Page 2: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 3: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Commonsense Reasoning

• The process of inferring aspects of our world based on our current information and commonsense knowledge.

• Related issues– Representation– Effects of Events– Indirect Effects of Events– Context-dependent Effects– Non-deterministic Effects– Concurrent Events– Preconditions– Inertia– Actions with duration– Delayed Effects and Continuous Change– Default Reasoning– …

Page 4: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Cognitive Robotics

• Agent = Action Theory + High-Level Program

Page 5: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Action Theories

• Action Theories are formal tools used to automate the process of commonsense reasoning in dynamically-changing worlds, such as– predicting the outcome of a given action sequence– explaining observations– finding a situation in which certain goal conditions are met

• Informal definitionAn action theory consists of a formal language that allows adequate specifications of

action domains and scenarios, and it tells us precisely what conclusions can be drawn from these specifications.

Michael Thielscher – 2000

• The objective is to express the dynamics of the world, therefore always include a more or less implicit general notions of time, change and causality.

Page 6: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Action Theories and Logic

• Action theories have much in common with general purpose logics.

• They are based on a formal language and they include an entailment relation to determine the way conclusions are drawn from specifications.

• Yet entailment is somewhat different, because it reflects the special notions of change and causality inherent in action theories.

• Automated reasoning using action theories exploits the naturalness of the latter when it comes to formalizing domains and scenarios, but also the progress in automated deduction (in FOL for instance).

Page 7: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Formalisms for Reasoning about Action

• Situation Calculus

• Fluent Calculus

• Event Calculus

• Action Languages

• Other similar approaches– STRIPS - PDDL– Temporal Action Logic– Dynamic Logic

Page 8: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 9: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Event Calculus – A Multi-sorted FOL

• The EC distinguishes three kinds of objects – events, fluents and timepoints. To do this, it appeals to a sorted first-order language.

• Fluents are relations, whose truth value may vary from timepoint to timepoint.

• Semantically, the universe is partitioned into disjoint sub-universes, one for each sort. A variable will range over its own sub-universe, and a term will denote an element in its corresponding sub-universe.

• Still, multi-sorted logics are no more powerful than ordinary unsorted FOL.

Page 10: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Event Calculus – Basic Notions

• There are many different dialects; we will use the Discrete Event Calculus

• Commonsense Law of Inertia: things tend to persist unless affected by some event.

• Circumscription: The Event Calculus assumes by default that no unexpected events occur and there are no unexpected effects of events.

Fluent Predicates• HoldsAt(f,t)• ReleasedAt(f,t)• Happens(e,t)

• Initiates(e,f,t)• Terminates(e,f,t)• Releases(e,f,t)

Fluent Predicates• HoldsAt(f,t)• ReleasedAt(f,t)• Happens(e,t)

• Initiates(e,f,t)• Terminates(e,f,t)• Releases(e,f,t)

Page 11: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Event Calculus – Simple Example

• Initiates(WakeUp(a), Awake(a), t) (1.1)

• Terminates(Sleep(a), Awake(a), t) (1.2)

• HoldsAt(Awake(Nathan),0) (1.3)ReleasedAt(Awake(Nathan),0) (1.4)

• Happens(WakeUp(Nathan),0) (1.5)

• We have a domain axiomatization, observations and narrative of actions.• We can prove that Nathan will be awake at timepoint 3 (or at any t>0).• Why?? We need an Event Calculus Axiomatization (domain independent

axioms)

Page 12: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Event Calculus – Axiomatization

Fluent Predicates• HoldsAt(f,t)• ReleasedAt(f,t)• Happens(e,t)

• Initiates(e,f,t)• Terminates(e,f,t)• Releases(e,f,t)

Fluent Predicates• HoldsAt(f,t)• ReleasedAt(f,t)• Happens(e,t)

• Initiates(e,f,t)• Terminates(e,f,t)• Releases(e,f,t)

Page 13: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Event Calculus – Fluent and Action Preconditions

• HoldsAt(On(o),t) Initiates(Flip(o), On(o), t) (2.1)

HoldsAt(On(o),t) Terminates(Flip(o), On(o), t) (2.2)

• If the preconditions do not hold the action may still occur, but will not have the intended effect.

• Happens(WalkThroughDoor(a,d),t) HoldsAt(Near(a,d),t) (3.1)

• If the preconditions do not hold the action cannot occur (otherwise we get inconsistency)

Page 14: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 15: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Frame Problem• Happens(TurnOn(l),t) HoldsAt(On(l),t+1) (4.1)

• HoldsAt(On(Light1),0) (4.2)• HoldsAt(On(Light2),0) (4.3)• Happens(TurnOn(Light2),0) (4.4)

• Ok about Light2, but what can we say about Light1??

• The problem of representing which fluents do not change when an event occurs is known as the frame problem.

Page 16: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Frame Problem• The frame problem is understood as finding a way to succinctly specify the

effects and noneffects of actions, given the situations in which they are performed. Javier Pinto 1999

• A straightforward solution is to add frame axioms to specify when fluents remain unchanged.

• The problem arises because the number of these axioms in the general case is 2xAxF (where A – number of actions, F – number of fluents)

• The solution within Event Calculus: inertia + circumscription

• We will see other solutions later on.

Page 17: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 18: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Ramification Problem

• The problem of representing and reasoning about the indirect effects of events is known as the ramification problem.

• Consider for example an agent moving around while carrying an object; the object’s location changes due to the agent’s movement.

• The simplest solution is to divide fluents into primitive and derived and apply state constraints.

• Better, we can use context-dependent inertia with state constraints, i.e., HoldsAt(Holding(a,o),t) HoldsAt(InRoom(a,r),t)

HoldsAt(InRoom(o,r),t) (5.1)

Page 19: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Ramification Problem

• A multitude of benchmark problems have been proposed to reveal weaknesses and counterintuitive inferences, such as the Yale shooting scenario, Thielscher’s circuit etc

• A multitude of solutions have been proposed, but still this is an open and very interesting issue.

Page 20: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Ramification Problem – Shanahan’s circuit with vicious cycles

Close(S1)L

R

S3

S1

S2

L

R

S3

S1S2

Start(L)Activate(R)

L

R

S3

S1S2

L

R

S3

S1 S2

L

R

S3

S1 S2

Open(S2)

Stop(L)Deactivate(R)

Close(S2)

L S1 S2 Start(L)

R S1 S2 S3 Activate(R)

S2 R Open(S2)

L (S1 S2) Stop(L)

R (S1 S2 S3) Deactivate(R)

S2 R Close(S2)

Page 21: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 22: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Qualification Problem

• Whenever we intend to execute some plan we know that many things may go wrong, i.e., in order to drive to the university the car must have gas, its engine must not be broken, the tires must … … … …

• Still, if we lack any evidence to the contrary, commonsense instructs to proceed assuming that none of them holds.

• If, on the other hand, we obtain information that some of the abnormal situations is actually the case, then we must react appropriately and reconsider our plan.

• It is impossible to list all contingencies! This is the so-called qualification problem.

Page 23: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Qualification Problem• We must find a way to represent qualifications without exploding the domain

axiomatization with vast number of axioms.

• Not only this solution does not scale well, but also any change in our axiomatization will require tremendous effort.

• The Event Calculus assumes by default that no unexpected events occur and there are no unexpected effects of events.

• It uses a technique introduced by J. McCarthy called circumscription to minimize the extension of the language’s predicates.

• Circumscription allows us to perform default (nonmonotonic) reasoning.

Page 24: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Qualification Problem – Example• Apples are usually red:

Apple(x) Ab(x) Red(x)

• If we writeAb(x) GrannySmith(x) Rotten(x)and wish to add other conditions, we have to modify the formula.

• Alternatively, we can use a more elaboration tolerant approach:GrannySmith(x) Ab(x)Rotten(x) Ab(x)If we circumscribe Ab in these formulas, we get a formula equivalent to the one above.

• Circumscription provides the necessary and sufficient conditions given the specifications.

Page 25: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Other Issues – that we will not see

• Non-deterministic effects

• Continuous change

• Concurrent actions with cumulative/canceling effects

• Triggered actions

• Non-atomic actions (duration)

Page 26: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 27: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus

Page 28: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – Fluents

Page 29: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – Preconditions and Effects

Page 30: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – Limitations

Page 31: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – The Projection Problem

Page 32: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – The Legality Task

Page 33: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – The Frame Problem

Page 34: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – The Frame Problem

Page 35: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – Successor State Axioms

Page 36: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – Successor State Axioms

Page 37: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Situation Calculus – Axiomatization

• A domain theory for the Situation Calculus consists of

– Successor state axioms for each relational and functional fluent. They provide solution to the frame problem

– Actions precondition axioms for each action. They characterize the conditions required for the action to be applied in a particular situation.

– Unique names axioms for actions

– A set of initial situation axioms. The initial values of fluents

– Foundational axioms for situations. They are domain independent

• Instead of the principle of inertia, Situation Calculus adopts Reiter’s “causal completeness assumption”.

Page 38: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 39: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Comparing Action Theories

Page 40: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Comparing Action Theories

Page 41: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Comparing Action Theories

Page 42: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Comparing Action Theories

Page 43: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 44: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Golog

Page 45: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Golog

Page 46: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Planning – Using the Situation Calculus

Page 47: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Outline

• Introduction to Action Theories• Basic Issues using the Event Calculus

– Frame Problem– Ramification Problem– Qualification Problem

• Familiarization with the Situation Calculus• Comparison of Action Theories• Golog & Planning• Knowledge

Page 48: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

Knowledge

• As we saw, causality plays an essential role in commonsense reasoning.

• In real-world implementations, software agents or robots acquire information about their environment and extend their knowledge as they operate.

• A good plan for such agents is one that not only achieves the goal, but is also executable.

• Even if it can be shown that a plan must achieve the goal (and terminate), the agent may not have enough knowledge to execute it.

Page 49: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

GATE 1

GATE 2

GATE 3

Knowledge – Example

Page 50: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

GATE 1

GATE 2

GATE 3

??

??

????

The agent must be endowed with information about the world it inhabits and the ability to reason with and about this information.

Knowledge – Related Aspects

Page 51: Reasoning about Actions and Causality Θεωρίες Δράσης και Αιτιότητας

The end