Phase Transitions of Contingent Planning Problem

This paper explores the phase transitions of the contingent planning problems. We present CONTINGENT PLAN-EXISTENCE algorithmandCONTINGENTPLAN-NONEXISTENCEalgorithm for quickly proving that the contingent planning instances have solutions and have no solutions, respectively. By analyzing the two algorithms, the phase transition area of the contingent planning problems is obtained. If the number of the actions is not greater than θub, the CONTINGENT PLAN-NONEXISTENCE algorithm can prove that nearly all the contingent planning instances have no solution. If the number of the actions is not lower than θlb, the CONTINGENT PLAN-EXISTENCE algorithm can prove that nearly all the contingent planning instances have solutions. The results of the experiments show that there exist phase transitions from a region where almost all the contingent planning instances have no solution to a region where almost all the contingent planning instances have solutions.


Introduction
There are many artificial intelligence (AI) problems that have been shown to be inherently intractable.For example, the propositional satisfiability problem, or -SAT problem for short, is a prototypical NP-complete problem [1], which means that -SAT problem cannot be solved in polynomial time if  ̸ = NP.It is significant to investigate the phase transitions of the intractable problems.That is because by working on it the researchers cannot only analyze the structure of intractable problems, but also understand the average-case performance of the solvers that solve these AI problems.
In recent years, much attention has been given to the phase transitions of the random -SAT problems [2][3][4][5][6][7][8].The researchers found that the phase transitions of the random -SAT problems did exist, where instances changed from being almost all satisfiable to being almost all unsatisfiable, and the hard instances only occurred in the phase transition area.The same phenomena were also observed for some other NPcomplete problems, such as the traveling salesman problems [9], the constraint satisfaction problems [10], and the Max-SAT problems [11].Some other researchers made tremendous progress towards the phase transitions of the artificial planning problems, for instance, STRIPS planning problems [12], conformant planning problems [13], and plan modification of the conformant planning problems [14].In consequence, one interesting question was put forward whether there were phase transitions in other artificial planning problems.
The aim of this paper is to explore the phase transitions of the contingent planning problems.In order to investigate the phenomena, CONTINGENT PLAN-EXISTENCE algorithm and CONTINGENT PLAN-NONEXISTENCE algorithm are presented.The phase transition point of the contingent planning problems is obtained by providing probabilistic analyses of the CONTINGENT PLAN-EXISTENCE algorithm and the CONTINGENT PLAN-NONEXISTENCE algorithm.The results of the experiments show that the empirical results match the phase transitions from the theoretic analyses.

Background
2.1.Definitions and Notations.This section describes some notations about contingent planning problem relevant to our work.Further details, such as the exclusive actions and the consistent actions, can be found in [15][16][17][18][19].
Definition 1 (contingent planning problem).A contingent planning problem is a 5-tuple  = ⟨, , , , ⟩ with the following components: (i)  is a finite set of states and the subset of  is called belief state; Mathematical Problems in Engineering (ii)  is a finite set of actions.An action is a pair ⟨pre, eff⟩, respectively, called preconditions and effects.Effects are a triple ⟨cond, del, add⟩, where cond is the effect conditions, del is the deleting effects and add is the adding effects; (iii)  is a finite set of observations; (iv)  ⊆  is a set of states over , which is called the initial belief state; (v)  ̸ = ⊘ is the goal, which is actually a partial state composed of the goal conditions.More specifically, contingent planning problem is the task of generating a conditional plan given uncertainty about the initial state and action effects, but with the ability to observe some aspects of the current state [20].In this paper we only focus on the contingent planning problem with uncertainty about the initial state and determinacy about the actions effects, but with the ability to sense the current state.
Definition 2 (action applicability).Let Bs be a belief state.The action  is applicable in Bs if ∀ ∈ Bs: pre() ⊆ .
If the preconditions of an action are satisfied by all states of the belief state, then the action can be applicable.On the contrary, if the preconditions of an action are not satisfied, the action cannot be carried out, which means that the belief state is changeless.The resulting belief state by executing an action is determined by the adding effects and the deleting effects.
Definition 3 (observation function).Let  be a finite set of observations and Bs an arbitrary belief state.The observation function over Bs and  is a function  : Bs → 2  \ 0 such that ∀ ∈ Bs : () ⊆ .
In the following, we will use  − () to denote the set of states that are compatible with the observation ;  − ( − ) to denote the set of states that are compatible with other observations rather than .Definition 4 (conditional plan).The set of conditional plans Π is the minimal set such that (i) 0 ∈ Π; (ii) for an action , if  ∈  and  ∈ Π, then  ∘  ∈ Π; Definition 5 (contingent plan).Given a contingent planning problem  = ⟨, , , , ⟩, a contingent plan or solution is a conditional plan  to the problem  if and only if (i)  is applicable in the initial belief state ; (ii) every run of  from the initial belief state  ends in .
A random contingent planning model, called variable model, is used to carry out an investigation on the phase transitions, which we will address in the following.
Definition 6 (variable model).A variable model  V is a 5tuple ⟨, , , , ⟩, where (i)  is a finite set of states and every state is made up of some propositions; (ii)  is a finite set of actions.For ∀ 1 ,  2 ∈ , Num(pre( 1 )) = Num(pre( 2 )) and Num(eff( 1 )) = Num(eff( 2 )), where Num(pre( 1 )) and Num(pre( 2 )) are the numbers of preconditions of  1 and  2 respectively, Num(eff( 1 )) and Num(eff( 2 )) are the numbers of postconditions of  1 and  2 , respectively; (iii)  is a finite set of observations; (iv)  ⊆  is a set of initial states over , which is also called the initial belief state; (v)  ̸ = ⊘ is the goal, which is actually a partial state composed of the goal conditions.

The Fundamental Analysis of the Variable Model.
In this section, we present the distributions of instances under the variable model.Before addressing the analysis of the variable model, two assumptions of the random contingent planning instances generated in this paper are provided.The first one is that each precondition of an action is selected independently of other precondition and postcondition.Similar rule is hold for the postconditions.The second one is that each action has a fixed number of preconditions.And the number of postconditions also agrees with the rule.
Because of the assumptions that each precondition (or postcondition) of an action is selected independently of other preconditions and postconditions, and the precondition or the postcondition is either a proposition or its negation, the random contingent planning instances under the variable model are distributed as follows.
Given  propositions,  actions,  preconditions,  postconditions, and  goal conditions, for a random proposition  and an action ,  is a precondition of the action with the probability /(2); alternatively ¬ is a precondition with the probability /(2).And /(2) is the probability for postconditions.
Because the initial state of the contingent planning problem is partially known, there exists a set of initial states, where the number of the initial states is  in this paper.Every initial state is made up of conditions, each of which is selected at random from the 2 conditions since there are  propositions.For the goal conditions, the  goal conditions are also selected at random from the 2 conditions.
Furthermore, in the rest of paper, three inequalities are also used to analyze the phase transitions.The detailed proofs can be found in [21]  Actually, the following analyses for the phase transitions of the contingent planning problems are based on the fundamental analysis of the variable model.Because it is very simple to solve the sort of contingent planning problems that the goal conditions are satisfied when there is not any actions, in this paper we only deal with the sort of contingent planning problems that the goal conditions are not satisfied by the initial belief state.

Contingent Plan Nonexistence Algorithm
In this section, we present the CONTINGENT PLAN-NONEXISTENCE algorithm for quickly proving that a contingent planning instance has no solutions.By analyzing the algorithm, the phase transition area is obtained.The framework of the CONTINGENT PLAN-NONEXISTENCE algorithm is presented in Algorithm 1.
The CONTINGENT PLAN-NONEXISTENCE algorithm firstly considers whether the preconditions of all actions are not in any state  in the initial belief state.If a state in the initial belief state does not satisfy the preconditions of all actions, then the instance has no solutions.Then the algorithm checks out whether a goal condition is not a postcondition of any action.If the postconditions of the actions do not cover all the goal conditions, then the instance has no solutions.The algorithm finally applies an observation to split the initial belief state into two belief states and checks out whether the preconditions of all actions are in any state in the two belief states, respectively.If there is a state in one of the belief states that satisfies the preconditions of all actions, then we cannot decide whether the instance has solutions or not.In addition, if there is not a state in all the split belief states that satisfies the preconditions of all actions, the instance has no solutions.For a contingent planning instance with  initial states,  actions,  observations, and  goal conditions, the time complexity of the algorithm is (( +  + 2)).Therefore, the CONTINGENT PLAN-NONEXISTENCE algorithm can decide that the instance has no solutions efficiently.

Theorem 7. The contingent planning instance has no solution if CONTINGENT PLAN-NONEXISTENCE algorithm returns failure; the contingent planning instance cannot be determined whether it has solutions if CONTINGENT PLAN-NONEXISTENCE algorithm returns do not know.
Proof.Let us first list the cases that the CONTINGENT PLAN-NONEXISTENCE algorithm returns failure.(1) The initial belief state involves a state that does not contain the preconditions of all the actions.As we know, if the preconditions of all the actions are not in the state, any action cannot be executed.Because in this paper we only deal with the sort of contingent planning problems that no goal conditions are satisfied by the initial belief state, a sequence of empty actions cannot be the solution of the instances.Therefore, the contingent planning instances do not have solutions.(2) There is a goal condition that is not an effect of any action, which means that the goal condition cannot be obtained by executing any action.Therefore, the contingent planning instances do not have solutions.(3) There is not a state in all the split belief states that satisfies the preconditions of all actions, which means that any action cannot be executed.Therefore, the contingent planning instances have no solutions.Then let us discuss the case that the CONTINGENT PLAN-NONEXISTENCE algorithm returns do not know.There is a state in one of the belief states that satisfies the preconditions of all actions, which means that at least an action can be executed from the belief state.However, we cannot guarantee that all the goal conditions are satisfied by executing any conditional plan from each state in the initial belief state.Therefore, the contingent planning instance cannot be determined whether it has solutions.
By Theorem 7, we know that the CONTINGENT PLAN-NONEXISTENCE algorithm is correct, but it cannot guarantee the completeness.In other words, if a contingent planning instance has solutions, the CONTINGENT PLAN-NONEXISTENCE algorithm could not determine that the instance has solutions.However, we can prove in Theorem 8 that nearly all contingent planning instances have no solutions when  is small enough ( is a constant and 0 <  < 1).

Theorem 8. For random contingent planning instances under the variable model, if the number of actions satisfies
where  is the number of propositions;  is the number of actions;  and , respectively, are the expected numbers of preconditions and postconditions within an action;  is the number of goal conditions;  is the number of initial states;  (0 <  < 1) is a constant, then the CONTINGENT PLAN-NONEXISTENCE algorithm proves that no solution exists for at least 1 −  of the instances.
Proof.If we are to prove that the algorithm determines that no solution exists for at least 1 −  of the instances, we only need to prove that the probability that every initial state satisfies the preconditions of any action, the probability that a goal condition is not a postcondition of any action, and the probability that every initial state in the belief state Bs  (or Bs  ) satisfies the preconditions of any action are not more than .Suppose (4) is true, we have Because the initial state of the contingent planning problem is partially known, there exists a set of initial states, where the number of the initial states is  in this paper.Every initial state is made up of conditions, each of which is selected at random from the 2 conditions since there are  propositions.At first, the probability that every initial state satisfies the preconditions of any action is given as follows: (1 − /2)  : probability that a state satisfies the preconditions of an action; 1 − (1 − /2)  : probability that a state does not satisfy the preconditions of an action; (1 − (1 − /2)  )  : probability that a state does not satisfy the preconditions of any action; 1 − (1 − (1 − /2)  )  : probability that a state satisfies the preconditions of any action; (1 − (1 − (1 − /2)  )  )  : probability that every initial state satisfies the preconditions of any action.
Then, the probability that every initial state in the belief state Bs  satisfies the preconditions of any action is given as follows, where the number of the states in Bs  (or Bs  ) is  (1 ≤  ≤ ), (1 − /2)  : probability that a state satisfies the preconditions of an action; 1 − (1 − /2)  : probability that a state does not satisfy the preconditions of an action; (1 − (1 − /2)  )  : probability that a state does not satisfy the preconditions of any action; 1 − (1 − (1 − /2)  )  : probability that a state satisfies the preconditions of any action; (1 − (1 − (1 − /2)  )  )  : probability that every initial state in the belief state Bs  (or Bs  ) satisfies the preconditions of any action.
For the goal conditions, the  goal conditions are also selected at random from the 2 conditions.Then, the probability that a goal condition is not a postcondition of any action is as follows: /2: probability that the goal condition is a postconditions of the action; 1 − /2: probability that the goal condition is not a postconditions of the action; (1 − /2)  : probability that the goal condition is not a postconditions of any action; 1 − (1 − /2)  : probability that the goal condition is a postconditions of some action; (1−(1−/2)  )  : probability that every goal condition is a postconditions of some action.
In the following, we will prove that the probability that every initial state satisfies the preconditions of any action and the probability that every initial state in the belief state Bs  (or Bs  ) satisfies the preconditions of any action both are not more than .Because the probability that every initial state satisfies the preconditions of any action is less than the probability that every initial state in the belief state Bs  (or Bs  ) satisfies the preconditions of any action, we only prove that the probability that every initial state in the belief state Bs  (or Bs  ) satisfies the preconditions of any action is not more than .
By (5), we get This is equivalent to Let  = (1 − /2)  .By (1), we have From ( 8) and ( 9), we have This is equivalent to From ( 11) and ( 12), we have Simplify ( 13), and we get In addition, for therefore, we obtain Thus, if the inequality of the theorem is satisfied, then the probability that every initial state in the belief state Bs  (or Bs  ) does not satisfy the preconditions of any action and the probability that every initial state satisfies the preconditions of any action are at least 1 − .
Finally, we prove that the probability that a goal condition is not a postcondition of any action is not more than .
From (5), we get This is equivalent to By (1), we get From ( 18) and ( 19), we have This is equivalent to By ( 2), we get From ( 21) and ( 22), we have Simplify ( 23), and we get Thus, if the inequality of the theorem is satisfied, then the probability that some goal condition is not a postcondition of any action is at least 1 − .Therefore, if the inequality of the theorem is satisfied, then the algorithm will determine that no solution exists for at least 1 −  of the instances.Theorem 8 presents an upper bound of the phase transition.If we can obtain a lower bound, the phase transition area of the contingent planning problems will be acquired.Therefore, in the next section, we will present the CONTIN-GENT PLAN-EXISTENCE algorithm and discuss the lower bound of the contingent planning problems by analyzing the algorithm.

Contingent Plan Existence Algorithm
In this section, we present the CONTINGENT PLAN-EXISTENCE algorithm for powerfully determining that a contingent planning instance has solutions.By analyzing the algorithm, the lower bound of the phase transition is obtained.The framework of the CONTINGENT PLAN-EXISTENCE algorithm is presented in Algorithm 2.
In the algorithm,  denotes the set of unsatisfied goal conditions,  denotes the set of satisfied goal conditions, Bs denotes the considered belief state; add() denotes the adding effects of the action , del() denotes the deleting effects of the action , and applicable (Bs, ) denotes the action  applicable in the belief state Bs.The algorithm firstly initializes , , and Bs, that is,  = ,  = NULL, and Bs = .Then it checks whether all states in the considered belief states satisfy (1 − (1 − /2)  )  : the least probability that every state in an arbitrary belief state does not satisfy the preconditions of an action; 1 − (1 − (1 − /2)  )  : probability that every state in the arbitrary belief state satisfies the preconditions of an action; 1 − (1 − (1 − /2)  )  : the most probability that every state in the arbitrary belief state satisfies the preconditions of an action.Because in this paper we research on the contingent planning problem whose actions have deterministic effects, the belief state during the execution has most  states; (1 − /2) − : probability that the postconditions of an action are consistent with the  −  goal conditions already achieved; 1 − (1 − /2)  : probability that the postconditions of an action achieve at least one of  remaining goal conditions.
Thus, the probability  that a particular action can be applied will not exclude any satisfied goals and will achieve at least one more goal condition which is 1− is the probability that the action is missing one or more of these properties, and (1−)  is the probability that  actions are unsatisfactory.
By (1), we get By (3), we get Then, finally, Thus, if the inequality is satisfied by the number of the actions, the CONTINGENT PLAN-EXISTENCE algorithm applying some action will increase the number of satisfied goal conditions for at least 1 −  of the instances.

Theorem 11. Consider random planning instances under the variable model if
where  is the number of propositions;  is the number of actions;  and , respectively, are the expected numbers of preconditions and postconditions within an action;  is the number of goal conditions;  is the number of initial states;  (0 <  < 1) is a constant, the CONTINGENT PLAN-EXISTENCE algorithm will find solutions for at least 1 −  of the instances.
Proof.For a contingent planning instance with  goal conditions, the number of satisfied goal conditions will be increased at most  times.If each increase occurs with probability at least (1 − )/,  increase (the most possible) will occur with probability at least 1 − .Thus, Lemma 10 can be applied using / instead of .Maximizing over the  goal conditions leads to Therefore, if the inequality is satisfied by the number of the actions, the algorithm will find solutions for at least 1 −  of the instances.
Theorem 11 shows that when the number of actions is not lower than  lb , the CONTINGENT PLAN-EXISTENCE algorithm can prove that nearly all the contingent planning instances have solutions.

Experimental Results
In this section, we take experiments on the contingent planning instances under the variable model in order to investigate the relationship between the densities (ratio of the number of actions to the number of propositions) and the effectiveness of the contingent planning instances.In the experiment, we generate a large collection of instances with three preconditions and two postconditions within an action, 2  ( is a constant) initial states, one observation, and two goal conditions.In addition, the propositions are 6, 8, 10, 12, 14, 16, and 18, respectively.All experiments are run on a cluster of 2.4 GHz Intel Xeon machines with 2 GB memory running Linux CentOS 5.4. Figure 1 illustrates the relationship between the densities and the effectiveness of the contingent planning instances.From the results we can see that the effectiveness grows when the density increases and the numbers of propositions and goal conditions are constant.Furthermore, the experiments show that there is a transition from insoluble to soluble instances as the density grows and the transition points drop with the propositions growing.

Conclusions
In this paper, we present analyses for the phase transitions of the contingent planning problems.By analyzing the CON-TINGENT PLAN-NONEXISTENCE algorithm and the CONTINGENT PLAN-EXISTENCE algorithm, quantitative results are obtained.If the number of actions is not greater than  ub , the CONTINGENT PLAN-NONEXISTENCE algorithm can prove that almost all the contingent planning instances have no solution; if the number of actions is not lower than  lb , the CONTINGENT PLAN-EXISTENCE algorithm can prove that almost all the contingent planning instances have solutions.The results of the experiments also show that there exist the phase transition phenomena.

Figure 1 :
Figure 1: The Relationship between densities and effectiveness of contingent planning problems.