5
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 definition An 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.

6
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).

9
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.

10
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)

13
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)

15
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.

16
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.

18
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)

19
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.

22
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.

23
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.

24
Qualification Problem – Example Apples are usually red: Apple(x)   Ab(x)  Red(x) If we write Ab(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.

25
Other Issues – that we will not see Non-deterministic effects Continuous change Concurrent actions with cumulative/canceling effects Triggered actions Non-atomic actions (duration)

37
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”.

48
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.