Computational Complexity of Planning Based on Partial Information about the System's Present and...

Post on 05-Mar-2023

2 views 0 download

Transcript of Computational Complexity of Planning Based on Partial Information about the System's Present and...

Computational Complexity of PlanningBased on Partial Information AboutThe System's Present and Past StatesChitta Baral1, Le-Chi Tuan1, Ra�ul Trejo2, and Vladik Kreinovich21 Dept. of Computer Science & EngineeringArizona State University, Tempe, AZ 85287-5406, USA,fchitta,lctuang@asu.edu2 Department of Computer Science, University of Texas at El PasoEl Paso, TX 79968, USA, frtrejo,vladikg@cs.utep.eduAbstract. Planning is a very important AI problem, and it is also avery time-consuming AI problem. To get an idea of how complex dif-ferent planning problems are, it is useful to describe the computationalcomplexity of di�erent general planning problems. This complexity hasbeen described for problems in which planning is based on the (completeor partial) information about the current state of the system. In real-lifeplanning problems, we can often complement the incompleteness of ourexplicit knowledge about the current state by using the implicit knowl-edge about this state which is contained in the description of the system'spast behavior. For example, the information about the system's past fail-ures is very important in planning diagnostic and repair. To describeplanning which can use the information about the past, a special lan-guage L was developed in 1997 by C. Baral, M. Gelfond and A. Provetti.In this paper, we expand the known results about computational com-plexity of planning (including our own previous results) to this moregeneral class of planning problems.1 Introduction1.1 Planning problems: towards a more realistic formulationPlanning problems: traditional approach, with complete informationabout the initial state. Planning is one of the most important AI problems.Traditional AI formulations of this problem mainly cover situations in which wehave a (complete or partial) information about the current state of the system,and we must �nd an appropriate plan (sequence of actions) which would enableus to achieve a certain goal.Such situations are described, e.g., by the language A which was proposedin [8].In this language, we start with a �nite set of properties ( uents) F =ff1; : : : ; fng which describe possible properties of a state.

2 A state is then de�ned as a �nite set of uents, e.g., fg or ff1; f3g. We areassuming that we have a complete knowledge about the initial state: e.g., ff1; f3gmeans that in the initial state, properties f1 and f3 are true, while all the otherproperties f2; f4; : : : are false. The properties of the initial state are described byformulas of the type \initially F ," where F is a uent literal, i.e., either a uentfi or its negation :fi.There is also a �nite set A of possible actions. At each moment of time, anagent can execute an action. The results of di�erent actions a 2 A are describedby rules of the type \a causes F if F1; : : : ; Fm", where F; F1; : : : ; Fm are uentliterals. A reasonably straightforward semantics describes how the state changesafter an action:{ If before the action a, the literals F1; : : : ; Fm were true, and the domaindescription contains a rule according to which a causes F if F1; : : : ; Fm,then this rule is activated, and after the execution of action a, F becomestrue. Thus, for some uents fi, we will conclude fi and for some other, that:fi holds in the resulting state.{ If for some uent fi, no activated rule enables us to conclude that fi is trueor false, this means that the execution of action a does not change the truthof this uent. Therefore, fi is true in the resulting state if and only if it istrue in the old state. (This case represents inertia.)Formally, a domain description D is a �nite set of value propositions of the type\initially f" (which describe the initial state), and a �nite set of e�ect propositionsof the type \a causes f if f1; : : : ; fm" (which describe results of actions). A state sis a �nite set of uents. The initial state s0 consists of all the uents fi for whichthe corresponding value proposition \initially fi" is contained in the domaindescription. (Here we are assuming that we have complete information aboutthe initial situation.) We say that a uent fi holds in s if fi 2 s; otherwise, wesay that :fi holds in s.The transition function res(a; s) which describes the e�ect of an action a ona state s is de�ned as follows:{ we say that an e�ect proposition \a causes F if F1; : : : ; Fm" is activated in astate s if all m uent literals F1; : : : ; Fn hold in s;{ we de�ne V +D (a; s) as the set of all uents fi for which a rule \a causes fi ifF1; : : : ; Fm" is activated in s;{ similarly, we de�ne V �D (A;S) as the set of all uents fi for which a rule \acauses :fi if F1; : : : ; Fm" is activated in s;{ if V +D (a; s)\V �D (a; s) 6= ;, we say that the result of the action a is unde�ned;{ if the result of the action a is not unde�ned in a state s (i.e., if V +D (a; s) \V �D (a; s) = ;), we de�ne res(a; s) = (s [ V +D (a; s)) n V �D (a; s).A plan � is a sequence of of actions � = [a1; : : : ; an]; the resultres(an; res(an�1; : : : ; res(a1; s) : : :)) of applying these actions to the state s isdenoted by res(�; s).

3To complete the description of deterministic planning, we must formulatepossible objectives. In general, as an objective, we can take a complex combi-nation of elementary properties ( uents) which characterize the �nal state; forexample, a typical objective of an assembling manufacture robot is to reachthe state of the world in which all manufactured items are fully assembled. Tosimplify the description of the problem, we can always add this combinationas a new uent; thus, without losing generality, it is su�cient to consider onlyobjectives of the type f 2 F .In these terms, the planning problem can be formulated as follows: given aset of uents F , a goal f 2 F , a set of actions A and a set of rules D describinghow these actions a�ect the state of the world, to �nd a sequence of actions� = [a1; : : : ; ak] that, when executed from the initial state of the world s0, makesf true. The problem of plan checking is, given F , A, a goal, and a sequence ofactions �, to check whether the goal becomes true after execution of � in theinitial state.Next step: planning in case of incomplete information about the initialstate. The language A describes allows planning in the situations with completeinformation, when we know exactly which uents hold in the initial state andwhich don't. In real life, we often have only partial information about the initialstate: about some uents, we know that they are true in the initial state, aboutsome other uents, we know that they are false in the initial state; and it is alsopossible that about some uents, we do not know whether they are initially trueor false.For example, when we want a mobile robot to reach a certain point, weoften do not have a complete information about the state of the world; this isespecially true in space applications, when the goal of the robot is to explorenew environments whose state is initially unknown. When we plan a diagnosticand repair of a complex object, be it a computer, a car, etc., we do not knowwhich parts are functioning correctly and which parts are not { this is exactlywhat we are trying to �nd out. In terms of uents, this means that we do notknow the initial values of the uents which describe the correct functionality ofthe system's parts.Such situations can also be easily described by a simple modi�cation of theabove language A. Namely, if for some uent f , neither the statement \initiallyf", not the statement \initially :f" are given, we assume that two di�erentinitial situations are possible: when f if initially true, and when :f is false inthe initial state. As a result, instead of a single initial state s0, we may haveseveral di�erent initial states which are consistent with our knowledge about thesystem.In this case, the notion of a successful plan becomes slightly more complex:namely, we say that a plan is successful if for every initial state s which isconsistent with our knowledge, after we apply the plan �, the desired uent gholds in the resulting state res(�; s).Adding sensing actions. In real-life planning problems like the above-mentioned problems of robotic motion or system diagnostic, a reasonable plan

4involves using sensors to �nd the missing information. Even in simple real-lifeplanning situations, it is often necessary to determine the missing information.For example, if we want the door closed, the required action depends on whetherthe door was initially open (then we close it), or it was already closed (then wedo nothing). Therefore, if we do not know whether the door was initially closedor not, we better somehow �nd it out, and then, depending on the result of thisinvestigation, perform the corresponding action.To describe such activities, we must include sensing actions { e.g., an actioncheck i which checks whether the uent fi holds in a given state { to our list ofactions, and allow conditional plans, i.e., plans in which the next action dependson the result of the previous sensing action.To describe such actions, the language A was enriched by rules of the type \adetermines f", meaning that after the action a is performed, we know whetherf is true or not. At any given moment of time, we have the actual state s of thesystem (which may be not completely known to the agent), plus a set � of allpossible states which are consistent with the agent's knowledge; the pair hs;�iis called a k-state. A sensing action does not change the actual state s, but itdoes decrease the set �.Since we will now be dealing with incompleteness of information about thereal world, we will need to reason with the agent's knowledge about the world.A k-state is de�ned as pair hs;�i, where s is the actual state, and � is the setof all possible states where the agent thinks it may be in. Initially, the set �0consists of all the states s for which:{ a uent fi is true (fi 2 s) if the domain description D contains the proposi-tion \initially fi";{ a uent fi is false (fi 62 s) if the domain description D contains the propo-sition \initially :fi".If neither the proposition \initially fi", nor the proposition \initially :fi" are inthe domain description, then �0 contains some states with fi true and otherswith fi false. The actual initial state s0 can be any state from the set �0. Thetransition function due to action execution is de�ned as follows:{ for proper (non-sensing) actions, hs;�i is mapped intohres(a; s); res(a;�)i, where:� res(a; s) is de�ned as in the case of complete information, and� res(a;�) = fres(a; s0) j s0 2 �g.{ for a sensing action a which senses uents f1; : : : ; fk { i.e., for which sensingpropositions \a determines fi" belong to the domain D { the actual states remains unchanged while � is down to only those states which have thesame values of fi as s: hs;�i ! hs;�0i, where�0 = fs0 2 � j 8i (1 � i � k ! (fi 2 s0 $ fi 2 s))gIn the presence of sensing, an action plan may no longer be a pre-determinedsequence of actions: if one of these actions is sensing, then the next action may

5depend on the result of that sensing. In general, the choice of a next action maydepend on the results of all previous sensing actions. Such an action plan iscalled a conditional plan.Possibility of knowledge about the past. In the situations when we onlyhave a partial information about the current (present) state, the additional in-formation can be deduced from knowing the history of the system's behavior.This additional information about the past is extremely important in diagnosticproblems: if we know what types of faulty behavior the system exhibited in thepast, it helps in diagnostics (sometimes this information about the past is evensu�cient for a successful repair, and no additional sensing is necessary). Sim-ilarly, when a medical doctor plans a cure, information about past diseases isas important (and sometimes even more important) than the results of di�erenttests (\sensing actions").Since this additional information is very important in many practical plan-ning problems, it is desirable to include this information into the correspondingAI formalisms.To describe the use of knowledge about the past in planning problems, in [1,2], the language A was extended to a new language L. In this new language, todescribe the history of the system, �rst of all, the current state sN is separatedfrom the initial state s0, so we may have statements about what is true at s0 (\Fat s0") and statements about what is true at sN (\F at sN"). In addition, wemay have information about other states in the past; to describe this information,language L allows to use several constants si to describe past moments of time,and allows:{ statements of the type \s1 precedes s2" which order past moments of time;{ statements of the type \F at si" which describe the properties of the systemat the past moments of time, and{ statements which describe past actions:� \� between s1; s2" means that a sequence of actions � was performed atsome point between the moments s1 and s2, and� \� occurs at s" means that the sequence of actions � was implementedat s.The semantics of this history description is as follows:{ a history is de�ned as a triple consisting of an initial state s0, a sequence ofactions � = [a1; : : : ; am], and a mapping t which maps each constant si fromthe history description into an integer t(si) � m (meaning the moment oftime when this constant actually happened, so t(s0) = 0 and t(sN ) = m); forthis history, we have, at moments of time 0; 1; : : : ;m, states s(0) = s0, s(1) =res(a1; s(0)), s(2) = res(a2; s(1)), etc., and si is identi�ed with s(t(si));{ we say that the history is consistent with the given knowledge if all thestatements from this knowledge become true under this interpretation;{ we say that the history is possible if it is consistent and minimal in the sensethat no history with a proper subsequence of � is consistent.

6In this more realistic situation, we can also ask about the existence of a plan, i.e.,a sequence (or tree) of actions with a feasible execution time which guaranteesthat for all possible current states, after this plan, the objective g 2 F will besatis�ed.Let us give an example of such a situation. If a lamp is not broken, then,when we switch it on, the light bulb should be switched on. If in the past, weapplied the action turn on but the lamp did not go on, this means that thelamp was broken at that time, and, if we know of no repair actions performed inthe past, we can therefore conclude that the lamp is still broken. This narrativecan be described by the following rules: \switch on causes lamp on if :broken",\switch on occurs at s1", \s1 precedes s2", \:lamp on at s2". From these rules,we can conclude that the lamp is currently broken.1.2 Computational complexity of planning problem: why it isimportant, what is known, and what we are planning to doIt is important to analyze computational complexity of planning prob-lems. Planning is one of the most important AI problems, but it is also knownto be one of the most di�cult ones. While often in practical applications, weneed the planning problems to be solved within a reasonable time, the actualapplication of planning algorithms may take an extremely long time. It is there-fore desirable to estimate the potential computation time which is necessaryto solve di�erent planning problems, i.e., to estimate the computational com-plexity of di�erent classes of planning problems. Even \negative" results, whichshow that the problem belongs to one of the high-level complexity classes (e.g.,that it is PSPACE-hard) are potentially useful: �rst, they prevent researchersfrom wasting their time on trying to design a general e�cient algorithm; second,they enable the researchers to concentrate on either �nding a feasible sub-classof the original class of planning problems, or on �nding (and/or justifying) anapproximate planning algorithm.Known computational complexity results: in brief. There have been sev-eral results on computational complexity of planning problems. These resultsmainly cover the situations in which we have a (complete or partial) informationabout the current state of the system, and we must �nd an appropriate plan(sequence of actions) which would enable us to achieve a certain goal. As wehave mentioned earlier, such situations are described, e.g., by the language Awhich was proposed in [8]. The complexity of planning in A was analyzed in ourearlier paper [3].Ideally, we want to �nd cases in which the planning problem can be solved bya feasible algorithm, i.e., by an algorithm U whose computational time tU(w) oneach input w is bounded by a polynomial p(jwj) of the length jwj of the input w:tU (x) � p(jwj) (this length can be measured bit-wise or symbol-wise). Since, inpractice, we are operating in a time-bounded environment, we should worry notonly about the time for computing the plan, but we should also worry about thetime that it takes to actually implement the plan. If an action plan consists of a

7sequence of 22n actions, then this plan is not feasible. It is therefore reasonableto restrict ourselves to feasible plans, i.e., by plans u whose length m (= numberof actions in it) is bounded by a given polynomial p(jwj) of the length jwj of theinput w. For each such polynomial p, we can formulate the following planningproblem: given a domain description D (i.e., the description of the initial stateand of possible consequences of di�erent actions) and a goal g (i.e., a uentwhich we want to be true), determine whether it is possible to feasibly achievethis goal, i.e., whether there exists a feasible plan � (with m � p(jDj)) whichachieves this goal.By solving this problem, we do not yet get the desired plan, we only checkwhether a plan exists. However, intuitively, the complexity of this problem alsorepresents the complexity of actually �nding a plan, in the following sense: ifwe have an algorithm which solves the above planning problem in reasonabletime, then we can also �nd this plan. Indeed, suppose that we are looking fora plan of length m � P0, and an algorithm has told us that such a plan exists.Then, to �nd the �rst action of the desired plan, we check (by applying thesame algorithm), for each action a 2 A, whether from the corresponding stateres(a; s) the desired goal g can be achieved in � P0 � 1 steps. Since a plan oflength � P0 does exist, there is such an action, and we can take this action asa1. After this, we repeat the same procedure to �nd a2, etc. As a result, we willbe able to �nd a plan of length � P0 by applying the algorithm which checks theexistence of the plan � P0 = p(jDj) times; so, if the existence-checking algorithmis feasible, the resulting plan-construction algorithm is feasible as well.General results on computational complexity of planning are given, e.g., in [5,7, 11]. For the language A, computational complexity of planning was �rst stud-ied in [10]; the results about the computational complexity of di�erent planningproblems in A are overviewed in [3, 15].When sensing is allowed, a plan is not a sequence, but rather a tree: everysensing action means that we branch into two possible branches (depending onwhether the sensed uent is true or false), and we execute di�erent actions ondi�erent branches. Similarly to the case of the linear plan, we are only interestedin plans whose execution time is (guaranteed to be) bounded by a given poly-nomial p(jDj) of the length of the input. (In other words, we require that forevery possible branch, the total number of actions on this branch is bounded byp(jDj).)For such planning situations, the computational complexity was also surveyedin [3].What we are planning to do. We have mentioned that a more realistic de-scription of a planning problem involves the use of history (information about thepast) in planning. In this paper, we answer the following natural question: Howdoes the addition of history change the computational complexity of di�erentplanning problems?Comment. In addition to the possibility of describing history, the language Acan also be extended by adding static causal laws, which can make the resultsof an action non-deterministic. This non-determinism may further increase the

8complexity of the corresponding planning problem; we are planning to analyzethis increase in our future work.Useful complexity notions. Most papers on computational complexity ofplanning problems classify these problems to di�erent levels of the polynomial hi-erarchy. For precise de�nitions of the polynomial hierarchy, see, e.g., [12]. Crudelyspeaking, a decision problem is a problem of deciding whether a given input wsatis�es a certain property P (i.e., in set-theoretic terms, whether it belongs tothe corresponding set S = fw jP (w)g).A decision problem belongs to the class P if there is a feasible (polynomial-time) algorithm for solving this problem.A problem belongs to the class NP if the checked formula w 2 S (equiv-alently, P (w)) can be represented as 9uP (u;w), where P (u;w) is a feasibleproperty, and the quanti�er runs over words of feasible length (i.e., of lengthlimited by some given polynomial of the length of the input). The class NP isalso denoted by �1P to indicate that formulas from this class can be de�ned byadding 1 existential quanti�er (hence � and 1) to a polynomial predicate (P).A problem belongs to the class coNP if the checked formula w 2 S (equiva-lently, P (w)) can be represented as 8uP (u;w), where P (u;w) is a feasible prop-erty, and the quanti�er runs over words of feasible length (i.e., of length limitedby some given polynomial of the length of the input). The class coNP is also de-noted by �1P to indicate that formulas from this class can be de�ned by adding1 universal quanti�er (hence � and 1) to a polynomial predicate (hence P).For every positive integer k, a problem belongs to the class �kP ifthe checked formula w 2 S (equivalently, P (w)) can be represented as9u18u2 : : : P (u1; u2; : : : ; uk; w), where P (u1; : : : ; uk; w) is a feasible property, andall k quanti�ers run over words of feasible length (i.e., of length limited by somegiven polynomial of the length of the input).Similarly, for every positive integer k, a problem belongs to the class �kPif the checked formula w 2 S (equivalently, P (w)) can be represented as8u19u2 : : : P (u1; u2; : : : ; uk; w), where P (u1; : : : ; uk; w) is a feasible property, andall k quanti�ers run over words of feasible length (i.e., of length limited by somegiven polynomial of the length of the input).All these classes �kP and �kP are subclasses of a larger class PSPACEformed by problems which can be solved by a polynomial-space algorithm. It isknown (see, e.g., [12]) that this class can be equivalently reformulated as a classof problems for which the checked formula w 2 S (equivalently, P (w)) can berepresented as 8u19u2 : : : P (u1; u2; : : : ; uk; w), where the number of quanti�ersk is bounded by a polynomial of the length of the input, P (u1; : : : ; uk; w) is afeasible property, and all k quanti�ers run over words of feasible length (i.e., oflength limited by some given polynomial of the length of the input).A problem is called complete in a certain class if, crudely speaking, this isthe toughest problem in this class (so that any other general problem from thisclass can be reduced to it by a feasible-time reduction).It is still not known (2000) whether we can solve any problem from the classNP in polynomial time (i.e., in precise terms, whether NP=P). However, it is

9widely believed that we cannot, i.e., thatNP6=P. It is also believed that to solvea NP-complete or a coNP-complete problem, we need exponential time � 2n,and that solving a complete problem from one of the second-level classes �2P or�2P requires more computation time than solving NP-complete problems (andsolving complete problems from the class PSPACE takes even longer).2 ResultsIn accordance with the above text and with [3], we will consider the followingfour main groups of planning situations:{ complete information about the initial state, no sensing actions allowed;{ possibly incomplete information about the initial state, no sensing actionsallowed;{ possibly incomplete information about the initial state, sensing actions al-lowed;{ possibly incomplete information about the initial state, full sensing (i.e.,every uent can be sensed).For comparison, we will also mention the results corresponding to the languageA, when neither history nor static causal laws are allowed.2.1 Complexity of plan checkingBefore we describe the computational complexity of checking the existence of aplan, let us consider a simpler problem: if, through some heuristic method, wehave a plan, how can we check that this plan works?This plan checking problem makes perfect sense only for the case of no sens-ing: indeed, if sensing actions are possible, then we can have a branching at everystep; as a result, the size of the tree can grow exponentially with the plan's ex-ecution time, and even if we can check this tree plan in time polynomial in itssize, it will still take un-realistically long.For the language A, the complexity of this problem depends on whether wehave complete information of the initial state or not:Theorem 1. (language A, no sensing){ For situations with complete information, the plan checking problem is fea-sible.{ For situations with incomplete information, the plan checking problem iscoNP-complete.Comment. For readers' convenience, all the proofs are placed in the special (last)section.

10Theorem 2. (language L, no sensing){ For situations with complete information about the initial state, the planchecking problem is �2P-complete.{ For situations with incomplete information about the initial state, the planchecking problem is �2P-complete.Comment. The problem remains �2P-complete even if we only consider situa-tions with two possible actions. If we only have one action, then for completeinformation, plan checking is feasible; for incomplete information, it is coNP-hard.2.2 Complexity of planningNow, we are ready to describe complexity of planning. In the framework of thelanguage A (i.e., without history), most planning problems turn out to be com-plete in one of the classes of the polynomial hierarchy; see, e.g., [3]. However, itturns out that when we allow history, i.e., when we move from language A to thelanguage L, we get a planning problem that does not seem to be complete withinany of the classes from the polynomial hierarchy. To describe the complexity ofthis program, we therefore had to search for appropriate intermediate classes.In this search, we were guided by the example of intermediate classes whichhave been already analyzed in complexity theory: namely, the classes belong-ing to the so-called Boolean hierarchy (see, e.g., [6, 12]). This hierarchy startedwith the discovery of the �rst such class { the class DP [13, 14]. The originaldescription of these classes uses a language which is slightly di�erent from thelanguage that we used to describe the polynomial hierarchy: namely, we de-scribed these classes in terms of the corresponding logical formulas, while thestandard description of Boolean hierarchy uses oracles or sets. Therefore, beforewe explain the new intermediate complexity class which turned out just right forplanning, let us �rst reformulate the notion of the Boolean hierarchy in terms ofthe corresponding logical formulas.After NP=�1P and coNP=�1P, the next classes in the polynomial hier-archy are �2P and �2P. In particular, �2P is a class of problems for whichthe checked formula P (w) can be represented as 9u18u2P (u1; u2; w) for somefeasible property P (u1; u2; w). For each given w, to check whether w satis�es thedesired property, we must therefore check whether the following formula holds:9u18u2Q(u1; u2); where by Q(u1; u2), we denoted P (u1; u2; w). In the generalde�nition of this class, for each w, Q(u1; u2) can be an arbitrary (feasible) bi-nary predicate. Therefore, in order to �nd a subclass of this general class �2Pfor which decision problem is easier than in the general case, we must look forpredicates which are simpler than the general binary predicates.Which predicates are simpler than binary? A natural answer is: unary pred-icates. It is therefore natural to consider the formulas in which Q(u1; u2) isactually a unary predicate, i.e., formulas in which Q(u1; u2) depends only onone of its variables. In other words, we have either Q(u1; u2) � Q2(u1) (here,

11the subscript 2 in Q2 means that the predicate does not depend on u2), orQ(u1; u2) � Q1(u2). Both these classes of \simpler" binary predicates do leadto simpler complexity classes, but these classes are still within the polynomialhierarchy. Indeed:{ the formula 9u18u2Q2(u1) is equivalent to 9u1Q2(u1) and therefore, thecorresponding complexity class is exactly �1P (= NP);{ the formula 9u18u2Q1(u2) is equivalent to 8u2Q1(u2) and therefore, thecorresponding complexity class is exactly �1P (= coNP).We get non-trivial intermediate classes if we slightly modify the above idea:namely, if instead of restricting ourselves to binary predicatesQ(u1; u2) which areactually unary, we consider binary predicates which are Boolean combinationsof unary predicates.For example, we can consider the case when Q(u1; u2) is a con-junction of two unary predicates, i.e., when Q(u1; u2) is equivalent toQ1(u2)&Q2(u1). In this case, the formula 9u18u2(Q1(u2)&Q2(u1)) is equivalentto 9u1Q2(u1)&8u2Q1(u2). If we explicitly mention the variable w, we concludethat w 2 S is equivalent to 9u1P2(u1; w)&8u2P1(u2; w), i.e., that the set S isequal to the intersection of a set S1 = fw j 9u1P2(u1; w)g from the classNP anda set S2 = fw j 8u2P1(u2; w)g from the class coNP, i.e., equivalently, to the dif-ference S1� (�S2) between two sets S1 and �S2 (a complement to S2) from theclass NP. Such sets represent the di�erence class DP, the �rst complexity classfrom the Boolean hierarchy. If we allow more complex Boolean combinations ofunary predicates, we get other complexity classes from this hierarchy.For planning, we need a simpler subclass within the class �3P of all formulasP (w) of the type 9u18u29u3P (u1; u2; u3; w). Similarly to the above descriptionof the Boolean hierarchy, it is natural to consider the cases when, for every w, thecorresponding ternary predicate P (u1; u2; u3; w) (for �xed w) can be representedas a Boolean combination of binary predicates P1(u2; u3; w), P2(u1; u3; w), andP3(u1; u2; w). Let us give a formal de�nition of such classes.De�nition. Let k � 1 be an integer. By a k-marked propositional variable, wemean an expression of the type vj , where v is a variable and j is an integerfrom 1 to k. By a k-Boolean expression B, we mean a propositional formulaB(vj11 ; : : : ; vjmm ) in which all variables are k-marked.{ For every k-Boolean expression B, by a class �k(B)P, we mean the classof all problems for which the checked formula P (w) can be represented as9u18u2 : : : P (u1; u2; : : : ; uk; w), where P (u1; : : : ; uk; w) is equal to the resultB(P1; : : : ; Pm) of substituting, into the Boolean expression B(vj11 ; : : : ; vjmm ),instead of each variable vjii , a feasible predicate Pi which does not dependon the variable uji .{ For every k-Boolean expression B, by a class �k(B)P, we mean the classof all problems for which the checked formula P (w) can be represented as8u19u2 : : : P (u1; u2; : : : ; uk; w), where P (u1; : : : ; uk; w) = B(P1; : : : ; Pm) andfor each i, the corresponding predicate Pi is feasible and does not depend onthe variable uji .

12For example, the above class DP can be represented as �2(v1&v2)P.Theorem 3. (language L, no sensing) For situations with complete informa-tion about the initial state and with no sensing, the computational complexity ofplanning is �3(v1 _ v3)P-complete.Comments.{ In other words, the corresponding planning problem is complete for theclass of all problems in which P (w) is equivalent to 9u18u29u3(P1(u2; u3) _P3(u1; u2)).{ The fact that the planning problem is complete for an intermediate com-plexity class is not surprising: e.g., in [9], it is shown that several planningproblems are indeed complete in some classes intermediate between standardclasses of polynomial hierarchy.{ The problem remains �3(v1 _ v3)P-complete even if we only consider situa-tions with two possible actions. If we only have one action, then for completeinformation, planning is feasible; for incomplete information, it is coNP-hard.{ For A, the corresponding planning problem is NP-complete.Theorem 4. (language L, no sensing) For situations with incomplete informa-tion about the initial state and with no sensing, the computational complexity ofplanning is �3(v1 _ v3)P-complete.For A, this problem is �2P-complete.Theorem 5. (language L, with sensing) For situations with incomplete infor-mation about the initial state and with sensing, the computational complexity ofplanning is PSPACE-complete.For A, this problem is also PSPACE-complete.Theorem 6. (language L, full sensing) For situations with incomplete informa-tion about the initial state and with full sensing, the computational complexityof planning is �2P-complete.For A, this problem is also �2P-complete.What do these complexity results mean in practical terms? At �rst glance,they may sound gloomy: even NP-complete problems are extremely di�cult tosolve, and the most realistic formulations of the planning problem (with sens-ing) lead to PSPACE-complete problems, i.e., problems at the high end of thepolynomial hierarchy. However, they do not sound so gloomy if we take intoconsideration that these results are about the worst-case complexity, and thehigh worst-case complexity of the problem does not mean that we cannot havegood algorithm for many (or even for most) practical instances of this problem.In plain words, no matter how good a feasible planning algorithm may be,there will always be cases when this algorithm will fail. Our goal is therefore,to design feasible algorithms which will succeed on as many practical planningproblems as possible.

13Even the traditional planning problem, with no sensing and complete infor-mation about the initial state, is known to be NP-hard; this complexity resultdoes not prevent us from having successful planners which help in solving manypractical planning problems. For situations with incomplete information aboutthe initial state, several ideas of approximate planning were proposed in [4];the corresponding simpli�ed algorithms are much faster than the algorithms forsolving the original planning problem (and the complexity of the correspondingapproximate planning problem is indeed smaller; see, e.g., [3]) { the downsidebeing, of course, that sometimes, these approximate algorithms fail to �nd aplan.It is desirable to extend these (and other) heuristic planning algorithms tosituations when some information about the current state comes in the form ofthe knowledge about the system's past behavior.3 ProofsProof of Theorem 1. Theorem 1 is, in e�ect, proven in [3].Proof of Theorem 2: main idea. Let us �rst show that the plan check-ing problem belongs to the class �2P. Indeed, a given plan w is successful ifit succeeds for every possible history u1. For every given history u1, checkingwhether a given plan w succeeds is feasible; we will denote the correspondingpredicate by S(u1; w). The condition that the history u1 is possible means thatit is consistent and that none of its sub-histories u2 is consistent. Checking con-sistency is feasible (we will denote the corresponding predicate by C(u)), andchecking whether u2 is a consistent sub-history of the history u1 is also feasi-ble; we will denote this other predicate by H(u1; u2). So, the possibility of ahistory u1 can be expressed as C(u1)&:9u2H(u1; u2), which is equivalent to8u2(C(u1)&:H(u1; u2)). Hence, the success of the plan w can be expressed as8u1(8u2(C(u1)&:H(u1; u2)) ! S(u1; w)); i.e., as a formula 8u19u2(:C(u1) _H(u1; u2)_S(u1; w)) from the class �2P. So, the plan checking problem indeedbelongs to the class �2P.To complete the proof, we must prove that the plan checking problem is�2P-complete. To show it, we prove that the known �2P-complete problem {namely, the problem of checking, for a given propositional formula F , whethera formula 8x1 : : :8xm9xm+1 : : :9xn F (x1; : : : ; xn) is true { can be reduced toplan checking. It is su�cient to do this reduction for the case when we havea complete information about the initial state; then, it will automatically fol-low that a more general problem { corresponding to a case when we may onlyhave partial information about the initial state { is also �2P-complete. Thisreduction is done similarly to the proofs from [3] (a detailed proof is posted athttp://www.cs.utep.edu/vladik/2000/tr00-13.ps.gz).Proof of Theorems 3 and 4. Let us �rst show that the corresponding planningproblem indeed belongs to the desired class. The existence of a plan means thatthere exists a plan u1 such that for every possible history u2, either the historyu2 is consistent with our knowledge and the plan u1 succeeds on the current

14state corresponding to u2 (we will denote this by S(u1; u2)); or the history u2is not minimal, i.e., there exists a di�erent history u3 for which the sequence ofactions is a subsequence of the sequence of actions corresponding to u2, and u3 isalso consistent with our knowledge (we will denote this property by M(u2; u3)).Both binary predicates S(u1; u2) and M(u2; u3) are feasible to check. There-fore, the existence of a plan is equivalent to a formula 9u18u2(S(u1; u3) _9u3M(u2; u3)) with feasible predicates S and M , i.e., to the formula9u18u29u3(S(u1; u3) _M(u2; u3)) of the desired type.The fact that the planning problem is complete in this class can be shownby a reduction to a propositional formula, a reduction which is similar to theone from the proofs from [3] and the proof of Theorem 2; the only di�erenceis that in addition to the above reduction { which, crudely speaking, simulates,during the period between the initial and the current state, the computation ofthe propositional expression corresponding to M(u2; u3) { we must also, afterthe current state, simulate the computation of the expression corresponding tothe formula S(u1; u3).Proof of Theorem 5. Let us �rst show that the corresponding planning prob-lem belongs to the class PSPACE. Indeed, the existence of a plan means thatthere exists an action u1 such that for every possible sensing result (if any) u2 ofthis action, there exists a second action u2, etc., such that for every history h1which is consistent with our initial knowledge and with the follow-up measure-ments, either we get success, or there exists a \sub"-history h2. Both success and\sub-history"-ness are feasible to check; thus, the existence of a plan is equivalentto a formula of the type 9u18u2 : : :, i.e., to a formula from the class PSPACE.As we have shown in [3], this problem is PSPACE-complete even for A,i.e., when no history is allowed. Thus, a more general problem from this classPSPACE should also be PSPACE-hard.Proof of Theorem 6. Let us �rst show that the corresponding planning prob-lem belongs to the class �2P. Since we have unlimited sensing abilities, we donot change our planning abilities if, before we start any planning actions, we�rst sense the values of all the uents. We may waste some time on unnecessarysensing, but the total execution time of a plan remains feasible if it was originallyfeasible; therefore, the existence of a feasible plan is equivalent to the existence ofa feasible plan which starts with full sensing. The existence of such a plan meansthat for every consistent history u1, either there is a plan u2 which succeedsfor the current state corresponding to u1, or there exists a sub-history u3 whichis also consistent (which makes u1 impossible). Checking whether a given plansucceeds for a given history is feasible, and checking whether u3 is a consistentsub-history is also feasible, so the existence of a plan is equivalent to the for-mula 8u1(9u2P1(u1; u2)_9u3P2(u1; u3)) for some feasible predicates P1 and P2.This formula can be reformulated as 8u19u2P (u1; u2) with P (u1; u2) denotingP1(u1; u2) _ P2(u1; u2). Therefore, the problem belongs to the class �2P.As we have shown in [3], this problem is �2P-complete even for A, i.e., whenno history is allowed. Thus, a more general problem from this class �2P shouldalso be �2P-hard.

15Acknowledgments. This work was supported in part by NASA under coopera-tive agreement NCC5-209, by NSF grants No. DUE-9750858 and CDA-9522207,by United Space Alliance, grant No. NAS 9-20000 (PWO C0C67713A6), by theFuture Aerospace Science and Technology Program (FAST) Center for Struc-tural Integrity of Aerospace Systems, e�ort sponsored by the Air Force O�ceof Scienti�c Research, Air Force Materiel Command, USAF, under grant num-ber F49620-95-1-0518, and by the National Security Agency under Grant No.MDA904-98-1-0561.We are thankful to Luc Longpr�e, to Tran Cao Son, and to the anonymousreferees for valuable discussions.References1. Baral, C., Gabaldon, A., Provetti, A.: Formalizing Narratives Using Nested Cir-cumscription, AI Journal 104 (1998) 107{164.2. Baral, C., Gelfond, M., Provetti, A.: Representing Actions: Laws, Observationsand Hypotheses, J. of Logic Programming 31 (1997) 201{243.3. Baral, C., Kreinovich, V., Trejo, R.: Computational Complexity of Planning andApproximate Planning in Presence of Incompleteness, Proc. IJCAI'99 2 948{953(full paper to appear in AI Journal).4. Baral, C., Son, T.: Approximate reasoning about actions in presence of sensingand incomplete information, Proc. ILPS'97 387{401.5. Bylander, T.: The Computational Complexity of Propositional STRIPS Planning,AI Journal 69 (1994) 161{204.6. Cai, J.-Y. et al.: The Boolean Hierarchy I: Structural Properties, SIAM J. onComputing 17 (1988) 1232{1252; Part II: Applications, in 18 (1989) 95{111.7. Erol, K., Nau, D., Subrahmanian, V. S.: Complexity, Decidability and Undecid-ability Results for Domain-Independent Planning, AI Journal 76 (1995) 75{88.8. Gelfond, M., Lifschitz, V.: Representing Actions and Change by Logic Programs,J. of Logic Programming 17 (1993) 301{323.9. Gottlob, G., Scarcello, F., Sideri, M.: Fixed-Parameter Complexity in AI and Non-monotonic Reasoning, Proc. LPNMR'99, Springer-Verlag LNAI 1730 (1999) 1{18.10. Liberatore, P.: The Complexity of the Language A, Electronic Transactions onArti�cial Intelligence 1 (1997) 13{28.11. Littman, M.: Probabilistic Propositional Planning: Representations and Complex-ity, Proc. AAAI'97 (1997) 748{754.12. Papadimitriou, C.: Computational Complexity, Addison-Wesley, Reading, MA,1994.13. Papadimitriou, C., Wolfe, D.: The complexity of facets resolved, Proc. FOCS'85(1985) 74{78; also, J. Computer and Systems Sciences 37 (1987) 2{13.14. Papadimitriou, C., Yannakakis, M.: The complexity of facets (and some facetsof complexity), Proc. STOC'82 (1982) 229{234; also, J. Computer and SystemsSciences 34 (1984) 244{259.15. Rintanen, J.: Constructing Conditional Plans by a Theorem Prover, Journal of AIResearch 10 (1999) 323{352.