h-approximation: History-Based Approximation of Possible World Semantics as ASP

04/17/2013 ∙ by Manfred Eppe, et al. ∙ 0

We propose an approximation of the Possible Worlds Semantics (PWS) for action planning. A corresponding planning system is implemented by a transformation of the action specification to an Answer-Set Program. A novelty is support for postdiction wrt. (a) the plan existence problem in our framework can be solved in NP, as compared to Σ_2^P for non-approximated PWS of Baral(2000); and (b) the planner generates optimal plans wrt. a minimal number of actions in Δ_2^P. We demo the planning system with standard problems, and illustrate its integration in a larger software framework for robot control in a smart home.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Dealing with incomplete knowledge in the presence of abnormalities, unobservable processes, and other real world considerations is a crucial requirement for real-world planning systems. Action-theoretic formalizations for handling incomplete knowledge can be traced back to the Possible Worlds Semantics () of Moore [14]. Naive formalizations of the  result in search with complete knowledge in an exponential number of possible worlds. The planning complexity for each of these worlds again ranges from polynomial to exponential time [1] (depending on different assumptions and restrictions). Baral et al. [2] show that in case of the action language  the planning problem is complete (under certain restrictions). This high complexity is a problem for the application of epistemic planning in real-world applications like cognitive robotics or smart environments, where real-time response is needed. One approach to reduce complexity is the approximation of . Son and Baral [19] developed the 0-approximation semantics for which results in an NP-complete solution for the plan existence problem. However, the application of approximations does not support all kinds of epistemic reasoning, like postdiction – a useful inference pattern of knowledge acquisition, e.g., to perform failure diagnosis and abnormality detection. Abnormalities are related to the qualification problem: it is not possible to model all conditions under which an action is successful. A partial solution to this is execution monitoring (e.g. [17]), i.e. action success is observed by means of specific sensors. If expected effects are not achieved, one can postdict about an occurred abnormality.

In Section 3 we present the core contribution of this paper: a ‘history’ based approximation of the  — called h-approximation () — which supports postdiction. Here, the notion of history is used in an epistemic sense of maintaining and refining knowledge about the past by postdiction and commonsense law of inertia. For instance, if an agent moves trough a door (say at ) and later (at some ) comes to know that it is behind the door, then it can postdict that the door must have been open at . Solving the plan-existence problem with h-approximation is in NP and finding optimal plans is in . Despite the low complexity of  compared to 111Throughout the paper we usually refer to the full  semantics of . Whenever referring to the 0-approximation semantics this is explicitly stated. it is more expressive in the sense that it allows to make propositions about the past. Hence, the relation between  and  is not trivial and deserves a thorough investigation which is provided in Section 4: We extend  and define a temporal query semantics () which allows to express knowledge about the past. This allows us to show that  is sound wrt. a temporal possible worlds formalization of action and knowledge.

A planning system for  is developed via its interpretation as an Answer Set Program (ASP). The formalization supports both sequential and (with some restrictions) concurrent planning, and conditional plans are generated with off-the-shelf ASP solvers. We provide a case study in a smart home as a proof of concept in Section 5.

2 Related Work

Approximations of the  have been proposed, primarily driven by the need to reduce the complexity of planning with incomplete knowledge vis-a-vis the tradeoff with support for expressiveness and inference capabilities. For such approximations, we are interested in: (i) the extent to which postdiction is supported; (ii) whether they are guaranteed to be epistemically accurate, (iii) their tolerance to problem elaboration [12] and (iv) their computational complexity. We identified that many approaches indeed support postdiction, but only in an ad-hoc manner: Domain-dependent postdiction rules and knowledge-level effects of actions are implemented manually and depend on correctness of the manual encoding. For this reason, epistemic accuracy is not guaranteed. Further, even if postdiction rules are implemented epistemically correct wrt. a certain problem, then correctness of these rules may not hold anymore if the problem is elaborated (see Example 1): Hence, ad-hoc formalization of postdiction rules is not elaboration tolerant.

Epistemic Action Formalisms.Scherl and Levesque [18] provide an epistemic extension and a solution to the frame problem for the Situation Calculus (SC) , and Patkos and Plexousakis [15] as well as Miller et al. [13] provide epistemic theories for the Event Calculus. These approaches are all complete wrt.  and hence suffer from a high computational complexity. Thielscher [20] describes how knowledge is represented in the Fluent Calculus (FC). The implementation in the FC-based framework FLUX is not elaboration-tolerant as it requires manual encoding of knowledge-level effects of actions. Liu and Levesque [10] use a progression operator to approximate . The result is a tractable treatment of the projection problem, but again postdiction is not supported. The PKS planner [16] is able to deal with incomplete knowledge, but postdiction is only supported in an ad-hoc manner. Vlaeminck et al. [23] propose a first order logical framework to approximate . The framework supports reasoning about the past, allows for elaboration tolerant postdiction reasoning, and the projection problem is solvable in polynomial time when using their approximation method. However, the authors do not provide a practical implementation and evaluation and they do not formally relate their approach to other epistemic action languages. To the best of our knowledge, besides [23, 13] there exists no approach which employs a postdiction mechanism that is based on explicit knowledge about the past.

There exist several PDDL-based planners that deal with incomplete knowledge. These planners typically employ some form of  semantics and achieve high performance via practical optimizations such as BDDs [3]

or heuristics that build on a relaxed version of the planning problem

[7]. The way how states are modeled can also heavily affect performance, as shown by To [21] with the minimal-DNF approach. With , we propose another alternative state representation which is based on explicit knowledge about the past.

The -Family of Languages. The action language  [6] is originally defined for domains with complete knowledge. Later, epistemic extensions which consider incomplete knowledge and sensing were defined. Our work is strongly influenced by these approaches [11, 19, 22]:  Lobo et al. [11]

use epistemic logic programming and formulate a

 based epistemic semantics. The original  semantics is based on  and (under some restrictions) is sound and complete wrt. the approaches by Lobo et al. [11] and Scherl and Levesque [18]. Tu et al. [22] introduce  and add Static Causal Laws (SCL) to the 0-approximation semantics of . They implement  in form of the ASCP planning system which – like  – is based on ASP. The plan-existence problem for  is still NP-complete [22]. The authors demonstrate that SCL can be used for an ad-hoc implementation of postdiction. However, we provide the following example to show that an ad-hoc realisation of postdiction is not elaboration tolerant:

Example 1

A robot can drive into a room through a door . It will be in the room if the door is open: causes(drive,in,{open}). An auxiliary fluent did_drive represents that the action has been executed: causes(drive,did_drive,); A manually encoded SCL if(open,{did_drive,in}) postdicts that if the robot is in the destination room after driving the door must be open. The robot has a location sensor to determine whether it arrived: determines(sense_in,in). Consider an empty initial state , a door and a sequence . Here  correctly generates a state where the door is open if the robot is in the room. Now consider an elaboration of the problem with two doors () and a sequence . By Definitions 4–8 and the closure operator in [22],  produces a state where the agent knows that door 1 is open, even though it may actually be closed: this is not sound wrt.  semantics.

Another issue is concurrent acting and sensing. Son and Baral [19] (p. 39) describe a modified transition function for the 0-approximation to support this form of concurrency: they model sensing as determining the value of a fluent after the physical effects are applied. However, this workaround does not support some trivial commonsense inference patterns:

Example 2

Consider a variation of the Yale shooting scenario where an agent can sense whether the gun was loaded when pulling the trigger because she hears the bang. Without knowing whether the gun was initially loaded, the agent should be able to immediately infer whether or not the turkey is dead depending on the noise. This is not possible with the proposed workaround because it models sensing as the acquisition of a fluent’s value after the execution of the sensing: Here the gun is unloaded after executing the shooting, regardless of whether it was loaded before.  allows for such inference because here sensing yields knowledge about the value of a fluent at the time sensing is executed.

3 h-approximation and its Translation to ASP

The formalization is based on a foundational theory and on a set of translation rules T that are applied to a planning domain . is modelled using a PDDL like syntax and consists of the language elements in (1a-1f) as follows: Value propositions () denote initial facts (1a); Oneof constraints () denote exclusive-or knowledge (1b); Goal propositions () denote goals222 is either weak or strong. A weak goal must be achieved in only one branch of the conditional plan while a strong goal must be achieved in all branches (see e.g. [3]). (1c); Knowledge propositions () denote sensing (1d); Executability conditions () denote what an agent must know in order to execute an action (1e); Effect propositions () denote conditional action effects (1f).

(:init ) (1a)
(oneof ) (1b)
(:goal type (and )) (1c)
(:action (1d)
:observe )
(:action executable (1e)
(:action :effect (1f)
when (and ) )

Formally, a planning domain is a tuple where:

  • is a set of value propositions (1a) and oneof-constraints (1b)

  • is a set of actions. An action is a tuple consisting of a set of effect propositions (1f), a set of knowledge propositions (1d) and an executability condition (1e).

  • is a set of goal propositions (1c).

An ASP translation of , denoted by LP(), consists of a domain-dependent theory and a domain-independent theory:

  • Domain-dependent theory (): It consists of a set of rules representing initial knowledge; representing actions; and representing goals.

  • Domain-independent theory (): This consists of a set of rules to handle inertia (); sensing (); concurrency (), plan verification () as well as plan-generation & optimization ().

The resulting Logic Program LP() is given as:

(2)

Notation. We use the variable symbols A for action, EP for effect proposition, KP for knowledge proposition, T for time (or step), BR for branch, and F for fluent. L denotes fluent literals of the form F or F. denotes the complement of L. For a predicate p(,L,) with a literal argument, we denote strong negation “” with the symbol as prefix to the fluent. For instance, we denote -knows(F,T,T,BR) by knows( F,T,T,BR). is used to “positify” a literal, i.e.  and . Respective small letter symbols denote constants. For example knows(,,,) denotes that at step in branch it is known that literal holds at step .

3.1 Translation Rules: ( )

The domain dependent theory is obtained by applying the set of translation rules on a planning domain .

Actions / Fluents Declarations (T1). For every fluent or action , LP() contains:

(T1)

Knowledge (). Facts for initial knowledge are obtained by applying translation rules (T2-T3). For each value proposition (1a) we generate the fact:

(T2)

For each oneof-constraint (1b) with the set of literals we consider one literal . Let be the subset of literals except . Then, for each we generate the LP rule:

(T3a)
(T3b)

(T3a) denotes that if all literals except one are known not to hold, then the remaining one must hold. Rules (T3b) represent that if one literal is known to hold, then all others do not hold. At this stage of our work we only support static causal laws (SCL) to constrain the initial state, because this is the only state in which they do not interfere with the postdiction rules.

Actions (). The generation of rules representing actions covers executability conditions, knowledge-level effects, and knowledge propositions.

Executability Conditions. These reflect what an agent must know to execute an action. Let of the form (1e) be the executability condition of action in . Then LP() contains the following constraints, where an atom occ(,,) denotes the occurrence of action at step in branch :

(T4)

Effect Propositions. For every effect proposition , of the form (when (and ), LP() contains (T5), where hasPC/2 (resp. hasNC/2) represents postive (resp. negative) condition literals, hasEff/2 represents effect literals and hasEP/2 assigns an effect proposition to an action:

(T5)

Knowledge Level Effects of Non-Sensing Actions. (T6a-T6c)333The frame problem is handled by minimization in the stable model semantics (see e.g. [9]).

(T6a)
(T6b)
(T6c)

Causation (T6a). If all condition literals of an EP (1f) are known to hold at , and if the action is applied at , then at , it is known that its effects hold at . The atom apply(,,) represents that with the EP happens at in .

Positive postdiction (T6b). For each condition literal of an effect proposition we add a rule (T6b) to the LP. This defines how knowledge about the condition of an effect proposition is postdicted by knowing that the effect holds after the action but did not hold before. For example, if at in it is known that the complement of an effect literal of an EP holds at some (i.e., knows(,,,)), and if the EP is applied at , and if it is known that the effect literal holds at (knows(,,,)), then the EP must have set the effect. Therefore one can conclude that the conditions of the EP must hold at .

Negative postdiction (T6c). For each potentially unknown condition literal of an effect proposition we add one rule (T6c) to the program, where are the condition literals that are known to hold. This covers the case where we postdict that a condition must be false if the effect is known not to hold after the action and all other conditions are known to hold. For example, if at it is known that the complement of an effect literal holds at some with , and if the EP is applied at , and if it is known that all condition literals hold at , except one literal for which it is unknown whether it holds. Then the complement of must hold because otherwise the effect literal would hold at .

Knowledge Propositions. We assign a KP (1d) to an action using hasKP/2:

(T7)

Goals (). For literals in a strong goal proposition and in a weak goal proposition we write:

(T8a)
(T8b)

where an atom sGoal(,) (resp. wGoal(,)) represents that the strong (resp. weak) goal is achieved at in .

3.2 – Foundational Theory (F1–F5)

The foundational domain-independent -theory is shown in Listing 1. It covers concurrency, inertia, sensing, goals, plan-generation and plan optimization. Line 1 sets the maximal plan length maxS and width maxBr.

F1. Concurrency () Line 1 applies all effect propositions of an action if that action occurs. We need two restrictions regarding concurrency of non-sensing actions: effect similarity and effect contradiction. Two effect propositions are similar if they have the same effect literal. Two EPs are contradictory if they have complementary effect literals and if their conditions do not contradict (l. 1). The cardinality constraint l. 1 enforces that two similar EPs (with the same effect literal) do not apply concurrently, whereas l. 1 restricts similarly for contradictory EPs.

F2. Inertia () Inertia is applied in both forward and backward direction similar to [6]. To formalize this, we need a notion on knowing that a fluent is not initiated (resp. terminated). This is expressed with the predicates kNotInit/kNotTerm.444For brevity Listing 1 does only contain rules for kNotInit; the rules for kNotTerm are analogous resp. to ll. 1-1. A fluent could be known to be not initiated for two reasons: (1) if no effect proposition with the respective effect fluent is applied, then this fluent can not be initiated. initApp(,,) (l. 1) represents that at an EP with the effect fluent is applied in branch . If initApp(,,) does not hold then is known not to be initiated at in (l. 1).

1s(0..maxS). ss(0..maxS-1). br(0..maxBr). 
2 Concurrency ()
3apply(EP,T,BR) :- hasEP(A,EP), occ(A,T,BR). 
4contra(EP1,EP) :- hasPC(EP1,F),hasNC(EP,F). 
5:- 2{apply(EP,T,BR):hasEff(EP,F)},br(BR), s(T), fluent(F).
6:- apply(EP,T,BR), hasEff(EP,F), apply(EP1,T,BR),       hasEff(EP1,F), EP != EP1, not contra(EP1,EP).
7 Inertia ()
8initApp(F,T,BR) :- apply(EP,T,BR),hasEff(EP,F). 
9kNotInit(F,T,T1,BR) :- not initApp(F,T,BR),               uBr(T1,BR), s(T), fluent(F). 
10kNotInit(F,T,T1,BR) :- apply(EP,T,BR), hasPC(EP,F1),    hasEff(EP,F) ,knows(F1,T,T1,BR), T1>=T.
11knows(F,T+1,T1,BR) :- knows(F,T,T1,BR), kNotTerm(F,T,T1,BR),T<T1, s(T).
12knows(F,T-1,T1,BR) :- knows(F,T,T1,BR),               kNotInit(F,T-1,T1,BR), T>0, T1>=T, s(T).
13knows(L,T,T1+1,BR) :- knows(L,T,T1,BR),T1<maxS,s(T1).
14 Sensing and Branching ()
15uBr(0,0). uBr(T+1,BR) :- uBr(T,BR), s(T). 
16kw(F,T,T1,BR):- knows(F,T,T1,BR). 
17kw(F,T,T1,BR):- knows(F,T,T1,BR).  
18sOcc(T,BR) :- occ(A,T,BR), hasKP(A,_). 
19leq(BR,BR1) :- BR <= BR1, br(BR), br(BR1).  
201{nextBr(T,BR,BR1): leq(BR,BR1)}1 :- sOcc(T,BR). 
21:- 2{nextBr(T,BR,BR1) :br(BR):s(T)},br(BR1). 
22uBr(T+1,BR) :- sRes(F,T,BR). 
23sRes(F,T,BR) :- occ(A,T,BR),hasKP(A,F),not knows(F,T,T,BR).
24sRes(F,T,BR1) :- occ(A,T,BR),hasKP(A,F),not kw(F,T,T,BR), nextBr(T,BR,BR1). 
25knows(L,T,T+1,BR) :- sRes(L,T,BR). 
26knows(F1,T,T1,BR1) :- sOcc(T1,BR), nextBr(T1,BR,BR1),     knows(F1,T,T1,BR), T1>=T. 
27apply(EP,T,BR1) :- sOcc(T1,BR), nextBr(T1,BR,BR1),        uBr(T1,BR), apply(EP,T,BR), T1>=T.
28:-2{occ(A,T,BR):hasKP(A,_)}, br(BR), s(T).
29 Plan verification ()
30allWGsAchieved :- uBr(maxS,BR), wGoal(maxS,BR). 
31notAllSGAchieved :- uBr(maxS,BR), not sGoal(maxS,BR). 
32planFound :- allWGsAchieved, not notAllSGAchieved.  
33:- not planFound. 
34notGoal(T,BR) :- not wGoal(T,BR), uBr(T,BR). 
35notGoal(T,BR) :- not sGoal(T,BR), uBr(T,BR). 
36 Plan generation and optimization ()
371{occ(A,T,BR):a(A)}1 :- uBr(T,BR), notGoal(T,BR),           br(BR), ss(T). % Sequential planning 
38%1{occ(A,T,BR):a(A)} :- uBr(T,BR), notGoal(T,BR),           br(BR), ss(T). % Concurrent planning 
39#minimize {occ(_,_,_) @ 1}   % Optimal planning 
Listing 1: Domain independent theory ()

(2) a fluent is known not to be initiated if an effect proposition with that fluent is applied, but one of its conditions is known not to hold (l. 1). Note that this requires the concurrency restriction (l. 1). Having defined kNotInit/4 and kNotTerm/4 we can formulate forward inertia (l. 1) and backward inertia (l. 1). Two respective rules for inertia of false fluents are not listed for brevity. We formulate forward propagation of knowledge in l. 1. That is, if at it is known that was true at , then this is also known at .

F3. Sensing and Branching () If sensing occurs, then each possible outcome of the sensing uses one branch. uBr(,) denotes that branch is used at step . Predicate kw/4 in ll. 1-1 is an abbreviation for knowing whether. We use sOcc(,) to state that a sensing action occurred at in (l. 1). By leq(,) the partial order of branches is precomputed (l. 1); it is used in the choice rule l. 1 to “pick” a valid child branch when sensing occurs. Two sensing actions are not allowed to pick the same child branch (l. 1). Lines 1-1 assign the positive sensing result to the current branch and the negative result to the child branch. Sensing results affect knowledge through l. 1. Line 1 represents inheritance: Knowledge and application of EPs is transferred from the original branch to the child branch (l. 1). Finally, in line l. 1, we make the restriction that two sensing actions cannot occur concurrently.

F4. Plan Verification () Lines 1-1 handle that weak goals must be achieved in only one branch and strong goals in all branches. Information about nodes where goals are not yet achieved (ll. 1-1) is used in the plan generation part for pruning.

F5. Plan Generation and Optimization () Line 1 and l. 1 implement sequential and concurrent planning respectively. Optimal plans in terms of the number of actions are generated with the optimization statement l. 1.

3.3 Plan Extraction from Stable Models

A conditional plan is determined by a set of occ/3, nextBr/3 and sRes/3 atoms.

Definition 1 (Planning as ASP Solving)

Let be a stable model for the logic program LP(), then solves the planning problem if is exactly the subset containing all occ/3, nextBr/3 and sRes/3 atoms of .

For example, consider the atoms occ(,,), sRes(,,), sRes(, ,), nextBr(,,), occ(,,) and occ(,,). With a syntax as in [22], this is equivalent to the conditional plan ;[if then else ].

3.4 Complexity of h-approximation

According to [22], we investigate the complexity for a limited number of sensing actions, and feasible plans. That is, plans with a length that is polynomial wrt. the size of the input problem.

Theorem 1 ((Optimal) Plan Existence)

The plan existence problem for the h-approximation is in NP and finding an optimal plan is in .

Proof Sketch: The result emerges directly from the complexity properties of ASP (e.g. [5]).

  1. The translation of an input problem via (T1-T8) is polynomial.

  2. Grounding the normal logic program is polynomial because the arity of predicates is fixed and maxS and maxBr are bounded due the polynomial plan size.

  3. Determining whether there exists a stable model for a normal logic program is NP-complete.

  4. Finding an optimal stable model for a normal logic program is -complete.

3.5 Translation Optimizations

Although optimization of  is not in the focus at this stage of our work we want to note two obvious aspects: (1) By avoiding unnecessary action execution, e.g. opening a door if it is already known to be open, search space is pruned significantly. (2) Some domain specificities (e.g., connectivity of rooms) are considered as static relations. For these, we modify translation rules (T4) (executability conditions) and (T2) (value propositions), such that knows/4 is replaced by holds/1.

4 A Temporal Query Semantics for

 is not just an approximation to  as implemented in . It is more expressive in the sense that  allows for propositions about the past, e.g. “at step 5 it is known that the door was open at step 3”. To find a notion of soundness of  with  (and hence -based approaches in general), we define a temporal query semantics () that allows for reasoning about the past. The syntactical mapping between  and  is presented in the following table:

 PDDL dialect
Value prop. initially( (:init )
Effect prop. causes(,, {}) (:action :effect when (and ) )
Executability executable(, {}) (:action :executable (and))
Sensing determines (,{,}) (:action :observe )

An  domain description D can always be mapped to a corresponding  domain specification due to the syntactical similarity. Note that for brevity we do not consider executability conditions in this section. Their implementation and intention is very similar in h-approximation and . Further we restrict the  semantics to allow to sense the value of only one single fluent with one action.

4.1 Original  Semantics by Son and Baral [19]

 is based on a transition function which maps an action and a so-called c-state to a c-state. A c-state is a tuple , where is a state (a set of fluents) and is a k-state (a set of possible belief states). If a fluent is contained in a state, then its value is , and otherwise. Informally, represents how the world is and represents the agent’s belief. In this work we assume grounded c-states for , i.e.  is grounded if . The transition function for non-sensing actions and without considering executability is:

(3)
(4)
(5)

reflects that if all conditions of an effect proposition hold, then the effect holds in the result. The transition function for sensing actions is:

(6)

For convenience we introduce the following notation for a k-state :

(7)

It reflects that a fluent is known to hold if it holds in all possible worlds in .

4.2 Temporal Query Semantics –

Our approach is based on a re-evaluation step with a similar intuition as the update operator” in [23]: Let be the set of all possible initial states of a (complete) initial c-state of an  domain D. Whenever sensing happens, the transition function will remove some states from the k-state, i.e.  , where and . To reason about the past, we re-evaluate the transition. Here, we do not consider the complete initial state, but only the subset of initial states which “survived” the transition of a sequence of actions. If a fluent holds in all states of a k-state , where is the result of applying actions on , then after the -th action, it is known that a fluent holds after the -th action.

Definition 2

Let be a sequence of actions and be a possible initial state, such that . We define as the set of initial belief states in which are valid after applying : .555Consider that according to (4) if is a sensing action. We say that

is known to hold after on

if where

4.3 Soundness wrt. 

The following conjecture considers soundness for the projection problem for a sequence of actions:

Conjecture 1

Let be a domain specification and be a sequence of actions. Let be a -logic program without rules for plan generation (), plan verification () and goal specification (). Let contain rules about action occurrence in valid branches, i.e.  Then for all fluents and all steps with , there exists a branch such that:

(8)

where denotes the stable model of the logic program.

The following observation is essential to formally investigate soundness:

Observation 1

We investigate (Listing 1) and and observe that an atom
knows(,,,) can only be produced by (a) Initial Knowledge (T2) (b) Sensing (l. 1) (c) Inheritance (l. 1) (d) Forward inertia (l. 1) (e) Backward inertia (l. 1) (f) Forward propagation (l. 1) (g) Causation (T6a) (h) Positive postdiction (T6b) or (i) Negative postdiction (T6c).

4.3.1 Conditional Proof Sketch

This conditional proof sketch contains circular dependencies and hence can not be considered as a full proof. However, it does provide evidence concerning the correctness of Conjecture 1.

To demonstrate soundness we would investigate each item (ai) in Observation 1 and show that if produced by this item, then must hold for some . However, for reasons of brevity we consider only some examples (b, e, h) for positive literals and without executability conditions:

  1. Sensing (b).  The soundness proof for sensing is by induction over the number of sensing actions. For the base step we have that (l. 1). A case distinction for positive () and negative () sensing results is required: With (ll. 1-1) the positive sensing result is applied to the original branch and the negative result is applied to a child branch determined by nextBr/3. The hypothesis holds wrt. one of these branches. The  restriction that sensing and non-sensing actions are disjoint ensures that the sensed fluent did not change during the sensing. Hence, its value after sensing must be the same as at the time it was sensed. This coincides with our semantics where sensing returns the value of a fluent at the time it is sensed.

  2. Backward Inertia (e). Backward inertia (l. 1) generates knows(,,,) with if both of the following is true:

    • knows(,,,) is an atom in the stable model. If this is true and we assume that the conjecture holds for , then .

    • kNotInit(,,,) is an atom in the stable model. This again is only true if (i) no action with an EP with the effect literal is applied at (ll. 1-1) or (ii) an action with an EP with the effect literal is applied at , but this EP has at least one condition literal which is known not to hold (l. 1). As of the result function (4) this produces in both cases that .

    With A: and B: , we can tell by the transition function (3) that and the case of backward inertia is conditionally proven if the conjecture holds for knows(,,,).

  3. Positive Postdiction (h).  Positive postdiction (T6b) generates an atom knows(,,,) if apply(,,), knows(,,,) and knows(,,,) with and where is a condition literal and is an effect literal of . We can show that positive postdiction generates correct results for the condition literals if Conjecture 1 holds for knowledge about the effect literal: That is, if we assume that (i) and (ii) , then with the result function (4), (i) and (ii) can only be true if for all . Considering the restriction that only one EP with a certain effect literal may be applied at once (l. 1), can only hold if for all conditions : .

The case for causation, negative postdiction, forward inertia, etc. is similar.

5 Evaluation and Case-Study

In order to evaluate practicability of  we compare our implementation with the ASCP planner by Tu et al. [22] and show an integration of our planning system in a smart home assistance system.

Comparison with ASCP. We implemented three well known benchmark problems for  and the 0-approximation based ASCP planner:666We used an Intel i5 (2GHz, 6Gb RAM) machine running clingo [5] with Windows 7. Tests were performed for a fixed plan length and width. Bomb in the toilet (e.g. [7]; potential bombs need to be disarmed in a toilet), Rings (e.g. [3]; in ringlike connected rooms windows need to be closed/locked), and Sickness (e.g. [22]; one of diseases need identified with a paper color test). While  outperforms ASCP for the Rings problem (e.g.  10s to 170s for 3 rooms), ASCP outperforms  for the other domains (e.g.  280s to 140s for 8 bombs and 160s to 1360s for 8 diseases). For the first problem,  benefits from static relations and for the latter two problems ASCP benefits from a simpler knowledge representation and the ability to sense the paper’s color with a single action where  needs actions. In both ASCP and  grounding was very fast and the bottleneck was the actual solving of the problems.

Application in a Smart Home. The  planning system has been integrated within a larger software framework for smart home control in the Bremen Ambient Assisted Living Lab (BAALL) [8]. We present a use-case involving action planning in the presence of abnormalities for an robotic wheelchair: The smart home has (automatic) sliding doors, and sometimes a box or a chair accidentally blocks the door such that it opens only half way. In this case, the planning framework should be able to postdict such an abnormality and to follow an alternative route. The scenario is illustrated in Fig. 1.

[] [] [] [] [] []
Figure 1: The wheelchair operating in the smart home BAALL

Consider the situation where a person instructs a command to the wheelchair (e.g., to reach location; []). An optimal plan to achieve this goal is to pass D1. A more error tolerant plan is: Open D1 and verify if the action succeeded by sensing the door status []; If the door is open, drive through the door and approach the user. Else there is an abnormality: Open and pass D3 []; drive through the bedroom []; pass D4 and D2 []; and finally approach the sofa [].777Abnormalities are considered on the alternative route but skipped here for brevity. If it is behind the door then the door was open. For this particular use-case, a sub-problem follows:

(:action open_door :effect when ab_open open)
(:action drive :executable (and open  in_liv)
               :effect in_liv) 
(:action sense_open :observe open) 
(:init in_liv open)      (:goal weak in_liv)

The solution to this subproblem is depicted in Fig. 2 (see also state in Fig. 1). There is an autonomous robotic wheelchair outside the living room (in_liv) and the weak goal is that the robot is inside the living room. The robot can open the door (open_door) to the living room. Unfortunately, opening the door does not always work, as the door may be jammed, i.e. there may be an abnormality. However, the robot can perform sensing to verify whether the door is open (sense_open). Figure 2 illustrates our postdiction mechanism. Initially (at and ) it is known that the robot is in the corridor at step . The first action is opening the door, i.e. the stable model contains the atom occ(open_door,0,0). Inertia holds for in_liv, because nothing happened that could have initiated in_liv. The rules in ll. 1-1 trigger kNotInit(in_liv,0,0,0) and l. 1 triggers knows(in_liv,0,1,0), such that in turn the forward inertia rule (l. 1) causes atom knows(in_liv,1,1,0) to hold. Next, sensing happens, i.e. occ(sense_open,1,0). According to the rule in l. 1, the positive result is assigned to the original branch and sRes(open,1,0) is produced. According to the rule in l. 1, the negative sensing result at step in branch is assigned to some child branch (denoted by nextBr(,,)) with (l. 1). In the example we have: sRes(open,1,1), and due to l. 1 we have knows(open,1,2,1). This result triggers postdiction rule (T6c) and knowledge about an abnormality is produced: knows(ab_open,0,2,1). Consequently, the wheelchair has to follow another route to achieve the goal. For branch 0, we have knows(open,1,2,0) after the sensing. This result triggers the postdiction rule (T6b): Because knows(open,0,2,0) and knows(open,1,2,0) hold, one can postdict that there was no abnormality when open occurred: knows(ab_open,0,2,0). Finally, the robot can drive through the door: occ(drive,2,0) and the causation rule (T6a) triggers knowledge that the robot is in the living room at step 3: knows(in_liv,3,3,0).

Figure 2: Abnormality detection as postdiction with h-approximation

6 Conclusion

We developed an approximation of the possible worlds semantics with elaboration tolerant support for postdiction, and implemented a planning system by a translation of the approximation to ASP. We show that the plan existence problem in our framework can be solved in NP. We relate our approach to the  semantics of  by extending  semantics to allow for temporal queries. We show that  is sound wrt. this semantics. Finally, we provide a proof of concept for our approach with the case study in Section 5. An extended version of the Case Study will appear in [4]. Further testing revealed the inferiority of the  implementation to dedicated PDDL planners like CFF [7]. This result demands future research concerning the transfer of heuristics used in PDDL-based planners to ASP.

References

  • Bäckström and Nebel [1995] C. Bäckström and B. Nebel. Complexity results for SAS+ planning. Computational Intelligence, 11:625–655, 1995.
  • Baral et al. [2000] C. Baral, V. Kreinovich, and R. Trejo. Computational complexity of planning and approximate planning in the presence of incompleteness. Artificial Intelligence, 122, 2000.
  • Cimatti et al. [2003] A. Cimatti, M. Pistore, M. Roveri, and P. Traverso. Weak, strong, and strong cyclic planning via symbolic model checking. Artificial Intelligence, 147:35–84, 2003.
  • Eppe and Bhatt [2013] M. Eppe and M. Bhatt. Narrative based Postdictive Reasoning for Cognitive Robotics. In 11th Int’l Symposium on Logical Formalizations of Commonsense Reasoning, 2013.
  • Gebser et al. [2012] M. Gebser, R. Kaminski, B. Kaufmann, and T. Schaub. Answer Set Solving in Practice. Morgan and Claypool, 2012.
  • Gelfond and Lifschitz [1993] M. Gelfond and V. Lifschitz. Representing action and change by logic programs. The Journal of Logic Programming, 17:301–321, 1993.
  • Hoffmann and Brafman [2005] J. Hoffmann and R. I. Brafman. Contingent planning via heuristic forward search with implicit belief states. In ICAPS Proceedings, 2005.
  • Krieg-Brückner et al. [2010] B. Krieg-Brückner, T. Röfer, H. Shi, and B. Gersdorf. Mobility Assistance in the Bremen Ambient Assisted Living Lab. Journal of GeroPsyc, 23:121–130, 2010.
  • Lee and Palla [2012] J. Lee and R. Palla. Reformulating the situation calculus and the event calculus in the general theory of stable models and in answer set programming. JAIR, 43:571–620, 2012.
  • Liu and Levesque [2005] Y. Liu and H. J. Levesque. Tractable reasoning with incomplete first-order knowledge in dynamic systems with context-dependent actions. In IJCAI Proceedings, 2005.
  • Lobo et al. [2001] J. Lobo, G. Mendez, and S. Taylor. Knowledge and the Action Description Language A. Theory and Practice of Logic Programming, 1:129–184, 2001.
  • McCarthy [1998] J. McCarthy. Elaboration tolerance. In Commonsense Reasoning, 1998.
  • Miller et al. [2013] R. Miller, L. Morgenstern, and T. Patkos. Reasoning About Knowledge and Action in an Epistemic Event Calculus. In 11th Int’l Symposium on Logical Formalizations of Commonsense Reasoning, 2013.
  • Moore [1985] R. Moore. A formal theory of knowledge and action. In J. Hobbs and R. Moore, editors, Formal theories of the commonsense world, pages 319–358. Ablex, Norwood, NJ, 1985.
  • Patkos and Plexousakis [2009] T. Patkos and D. Plexousakis. Reasoning with Knowledge , Action and Time in Dynamic and Uncertain Domains. In IJCAI Proceedings, pages 885–890, 2009.
  • Petrick and Bacchus [2004] R. Petrick and F. Bacchus. Extending the knowledge-based approach to planning with incomplete information and sensing. In ICAPS Proceedings, 2004.
  • Pettersson [2005] O. Pettersson. Execution monitoring in robotics: A survey. Robotics and Autonomous Systems, 53:73–88, 2005.
  • Scherl and Levesque [2003] R. B. Scherl and H. J. Levesque. Knowledge, action, and the frame problem. Artificial Intelligence, 144:1–39, 2003.
  • Son and Baral [2001] T. C. Son and C. Baral. Formalizing sensing actions - A transition function based approach. Artificial Intelligence, 125:19–91, 2001.
  • Thielscher [2000] M. Thielscher. Representing the knowledge of a robot. In Proc. of KR, 2000.
  • To [2011] S. T. To. On the impact of belief state representation in planning under uncertainty. In IJCAI Proceedings, 2011.
  • Tu et al. [2007] P. H. Tu, T. C. Son, and C. Baral. Reasoning and planning with sensing actions, incomplete information, and static causal laws using answer set programming. Theory and Practice of Logic Programming, 7:377–450, 2007.
  • Vlaeminck et al. [2012] H. Vlaeminck, J. Vennekens, and M. Denecker. A general representation and approximate inference algorithm for sensing actions. In Australasian Conference on AI, 2012.