1) How many levels will GraphPlan need to expand in order to solve the "Sussman Anomaly" shown in Figure 11.16? Explain your answer. For the set of actions, consider actions that correspond to the blocks-world STRIPS schemas given in the book. SOLUTIION: It is easy to show that there is a three step plan (just give an action sequence). This means that the planning graph will contain a solution by at least three levels. It remains to show that there is no shorter solution. This is clear by expanding the graph and showing that until the third level there are mutexed goal facts. 2) 11.9 (only the first part/bullet) (here "final level of the graph" refers to the level after which no more changes occur) SOLUTION: We want to show that if a proposition does not appear in the final level of the graph then it is not achievable. More specifically, we want to show that if a proposition does not appear in the final level of the graph then there is no plan starting from the initial state that achieves the proposition. This is another one of those "obvious" statements, that nonetheless deserves a careful argument. It is straightforward after picking a good inductive hypothesis to prove. PROOF: We will consider the contrapositive. If there is a plan that achieves a proposition then the proposition is in the final level of the graph. For this we will extend our definition of state-action sequence give above to layered plans. So we will have state-actionSet sequences and a state-actionSet sequence S0,A1,...,An,Sn is legal when Ai can be executed in Si-1 and Si results from executing Ai in state Si-1. We show the following statement by induction, If S0,A1,S1,...,An,Sn is a legal state-actionSet sequence, then we have that all elements of An and Sn are non-mutex at level n of the planning graph. Base Case: (n=0) trivial Inductive Case: Assume that S0,A1,...,An+1,Sn+1 is a legal sequence. Then we know that, 1) S0,A1,...,An,Sn is a legal sequence, and 2) Actions in An+1 are non-interfering and have there preconditions satisfied in Sn 3) Executing An+1 in Sn gives Sn+1 which implies that, 1) The elements of An and Sn are non-mutex in level n of the graph. (inductive hypothesis) 2) The actions An+1 will be non-mutex in level n+1 of the graph. This is because they are non-interfering and there preconditions are satisfied by facts in Sn and no facts in Sn are mutex at level n of the graph. 3) The propositions in Sn+1 will be non-mutex at level n+1. We know this because the state Sn+1 was obtained by Sn + ADD(An+1) - DEL(An+1). We know that all the facts in Sn are non-mutex at level n and will also be non-mutex at level n+1 by the monotonicity of the graph. Furthermore we know that all the facts in ADD(An+1) will be non-mutex at level n+1 since they can be added by the non-mutex action set An+1. It is also clear that at level n+1 no facts in ADD(An+1) will be mutex with facts in Sn since the facts in Sn can be included in level n+1 by persistence actions. That finishes the inductive proof. Now we can use the statement to finish the main proof. Assume that there is a layered plan S0,A1,...,An,Sn that achieves a proposition at state Sn. Then we know that all the facts including the proposition in question will appear at level n of the graph, as desired. Notice that the inductive statement that we proved was stronger than we actually needed. That is, in the end we did not end up using the fact that the proposition in Sn are non-mutex at level n of the graph. However, the extra mutex condition was important to make the inductive proof go through. 3) 11.17 (Keep answers concise.) For part b you can interpret "spurious" as a solution that either does not achieve the goal or one that achieves the goal but then moves away from the goal. SOLUTION: a) Yes. The approach will find a plan whenever the normal SATPLAN finds one with length no more than Tmax. b) The notion of "spurious solution" was ambiguous. If I took points of on this problem you can get them back. The bottom line is that every plan returned by the algorithm will correspond to a legal plan but it might be possible for that plan to reach a goal state and then take actions that move away from the goal. That type of behavior might be interpreted as spurious(?). c) There is no simple and clear way to induce WALKSAT to find short solutions, because it has no notion of the length of a plan---the fact that the problem is a planning problem is part of the encoding, not part of WALKSAT. But if we are willing to do some rather brutal surgery on WALKSAT, we can achieve shorter solutions by identifying the variables that represent actions and (1) tending to randomly initialize the action variables (particularly the later ones) to false, and (2) preferring to randomly flip an earlier action variable rather than a later one. 4) A standard propositional STRIPS planning problem (as described in class) specifies: 1) a goal condition, 2) an initial state, and 3) a set of propositional STRIPS actions with positive preconditions. We will refer to the set of all standard STRIPS problems as STANDARD. Consider the class of planning problems POS-ONLY, which contains any STRIPS planning problem that contains only positive preconditions and positive effects (i.e. there are no delete lists). Give an efficient algorithm (polynomial time in the problem size) for deciding PlanSat for this class of problems (i.e. determining whether a problem has a solution). Prove your answer for full credit. HINT: It may help to think about Graphplan. SOLUTION: We will use the following algorithm to decide PlanSat for problems in POS-ONLY. Given: A planning problem P= 1) Construct a planning graph starting at S0 to produce a sequence, S0,A1,S1,A2,...,An,Sn where Si and Ai are the actions and propositions at level i of the graph, and n is the level at which the graph levels off. 2) If G is a subset of Sn then return SATISFIABLE, otherwise return UNSATISFIABLE. We prove that for any problem P in POS-ONLY, P is satisfiable iff the above algorithm returns SATISFIABLE. PROOF: For the forward direction consider the contrapositive which says that if the algorithm returns UNSATISFIABLE then P is not satisfiable. This is the same as saying that if some goal proposition is not in the "leveled-off" graph then P is not solvable. We prove this statement later in the homework in Exercises 11.19. We prove the backward direction by first showing the following statement: For any problem in POS-ONLY, let S0,A1,...,Ak,Sk be any prefix of the planning graph (i.e. the first k layers of the graph), then executing the layered plan A1;A2;...;Ak starting at state S0 will result in state Sk. Use induction on k. Base Case: (k=0) trivial Inductive Case: (assume true for prefixes of length k or less) Assume S0,A1,...,Ak+1,Sk+1 is graph prefix for P, this implies the following 1) A1;...;Ak reaches state Sk from S0 (inductive hyp.) 2) for each a in Ak+1, PRE(a) is a subset of Sk (def. of graph) 3) Sk+1 = Sk + {ADD(a) | a in Ak+1} (def. of graph) which implies the following 1) same as (1) above 2) Ak+1 can be executed in state Sk (from (2) and fact that there are no neg. effects, so no mutexes) 3) Applying Ak in Sk yields state Sk+1 (from (3) and fact that there are no neg effects) which implies layered plan A1;A2;...;Ak+1 reaches state Sk+1 from S0 Using this fact assume that our algorithm returns SATISFIABLE. This means that S0,A1,...,An,Sn is the planning graph and the goal is contained in Sn. But this means that the layered plan A1;...;An reaches Sn, a goal state, from S0, which means that the problem is satisfiable. 5) Consider the CNF formula constructed in class for the simple 2 location robot world. Call this formula F. We showed that this formula was constructed from four distinct subformulas F1, F2, F3, F4 which respectively described the "initial state", "goal", "action effects/preconditions", and "explanatory frame axioms". This exercise is intended to convince you that each of the subformulas are necessary. For each of the subformulas, consider removing it from F and give a model of the resulting formula that does not correspond to a valid plan. That is, for each formula, F-F1, F-F2, F-F3, F-F4 give a model that does not correspond to a legal plan. (F-Fi is simply the formula F with the subformula Fi removed.) By legal plan we mean the following. Recall that a model assigns a truth value to each state and action fluent at each level. From a model we can extract a totally ordered or layered plan, given by the sequence of action fluents that are true in the model at each level. We can also extract a sequence of states, where the state corresponding to level i contains all facts that correspond to true fluents at level i. We say that a model corresponds to a legal plan iff it satisfies the following three conditions: 1) The first state of the extracted state sequence is equal to the initial state of the planning problem. 2) The final state of the extracted state sequence satisfies the goal of the planning problem. 3) The plan and state sequence are consistent in that actions at level i can be executed in the level i state and produce exactly the state at level i+1. SOLUTION: F-F1: (No Initial State Formulas) Without the initial state constraints we can simply set all of the world facts to be true in the initial state. This will cause any goal to be satisfied by the null plan where no actions are ever selected. So an incorrect model would be: at(l1,0) = true at(l2,0) = true at(l1,1) = true at(l2,1) = true move(l1,l2,0) = false move(l2,l1,0) = false Clearly this model does not correspond to a solution plan since the agent must take an action to satisfy the goal. F-F2: (No Goal Formulas) Without the goal formula a model need not satisfy the goal facts in the final level. This means that a model where no actions are taken will suffice. at(l1,0) = true at(l2,0) = false at(l1,1) = true at(l2,1) = false move(l1,l2,0) = false move(l2,l1,0) = false Notice that we needed at(l2,0) to be false since that is required by the initial state formulas. In tern at(l2,1) was forced to be false since without taking any actions the frame axioms do not allow its truth value to change. F-F3: (No Action Effects/Preconditions Formulas) Without the formulas that describe preconditions and effects the models do not need to adhere to the constraints of the action add or delete effects. For example, if an action is taken, the model need not reflect that the delete effects were made false in the next time step. In our example, we can get the model, at(l1,0) = true at(l2,0) = false at(l1,1) = true at(l2,1) = true move(l1,l2,0) = true move(l2,l1,0) = false The first two truth values are forced by the initial state formulas. The fourth truth value is forced by the goal formula. The fifth truth value is forced by the frame axioms (since at(l2) changed truth value from 0 to 1). Also since move(l1,l2,0) is forced, we know that move(l2,l1,0) is forced to be false (by action exclusion formula). Notice however that we were able to have at(l1,1)=true, since the delete effects of move(l1,l2,0) were not part of the formula. This model is clearly incorrect since it says that the robot is in two locations at time 1. F-F3: (No Frame Actions) Without the explanatory frame axioms, the truth values of fluents can change without needed to be explained by the application of an action. In other words, we can simply set all actions to false in the model and we are free to change values of fluents arbitrarily. at(l1,0) = true at(l2,0) = false at(l1,1) = true at(l2,1) = true move(l1,l2,0) = false move(l2,l1,0) = false