Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence and Lisp #8 State-space Characterization of Actions Algorithmic Planning.

Similar presentations


Presentation on theme: "Artificial Intelligence and Lisp #8 State-space Characterization of Actions Algorithmic Planning."— Presentation transcript:

1 Artificial Intelligence and Lisp #8 State-space Characterization of Actions Algorithmic Planning

2 State-space Ontology of Actions The structures in lab2 implement this ontology Purpose: unified treatment for several ways of representing the preconditions and effects of actions It is also the basis for planning algorithms Start from a set F of features and an assignment of a range for each feature Consider the space of all feature states R; each of them is a mapping from features to values, and there may be restrictions on what combinations of values are possible A complete feature state assigns a value to all members of F, a partial feature state does not. Complete is the default. A development D is a mapping from integers from 0 and up, to feature states. (Similar to episodes in Leonardo)

3 State-space Ontology, continued Basic case: An action is a pair where pre and post are partial states over the same set of features The application of an action on a complete state R is defined iff pre  R, and is then defined as the state (R – pre) + post A plan is a sequence of actions > The execution of such a plan from a state R is a development where R = R.0 and R.i is the application of on R.i-1. The plan is applicable to R iff all the applications are defined. More complex cases: An action as a set of pairs or as a probability distribution involving those

4 The Classical Planning Problem Given: The base case of the state-space ontology for actions A space of feature states A set of actions in this space, often called Σ A specific member of the state space, called the starting state A specific partial state, called the goal state Desired: A finite sequence of actions whose execution from the starting state ends in a state having the goal state as a subset

5 An example for classical planning In the zoo world, Groucho the gorilla has fallen from a tree and broken his leg The operation on the leg must be done under anaesthezia A sequence of steps must be taken in order to get Groucho out of his cage, taken to the animal hospital, anaesthesized, etc. This also requires him not to eat or drink during a certain period before the operation

6 An example that is not suited for classical planning In the zoo world, the gorillas Groucho and Bronx have been in a fight over the beautiful Gredelina Groucho was bitten and the wound is infected and must be treated If Groucho is removed to the hospital then Bronx will be alone with Gredelina, which means the wardens have taken sides; this would be unwise Therefore, Gredelina must first be taken to another cage, then Groucho is to be removed, and the treatment can start

7 An example that is not suited for classical planning In the zoo world, the gorillas Groucho and Bronx have been in a fight over the beautiful Gredelina Groucho was bitten and the wound is infected and must be treated If Groucho is removed to the hospital then Bronx will be alone with Gredelina, which means the wardens have taken sides; this would be unwise Therefore, Gredelina must first be taken to another cage, then Groucho is to be removed, and the treatment can start In this example, the first plan contained an undesirable side-effect, and the plan had to be modified in order to avoid that side-effect

8 Uses of Action Planning in Agents Intelligent command execution: the “goal” was stated as a command by the user Maintain good state: the “goal” characterizes the desired state of the agent; agent planning is used to correct deviations from this state Grasping opportunities: the agent has a capability for recognizing situations that can maybe be transformed to a rewarding situation using some of the available actions Resolution of precondition failure during the agent's operation. ( Notice the possibility of organizing the overall operation of a software system in terms of actions ) Some steps in some of the agent's programs are only defined in terms of goal state, e.g. concerning the needs for particular information in order to be able to proceed.

9 Limited expressivity of the basic case of the ontology for actions Or: Generalizations of the basic case that one must introduce in some applications Conditional effects of actions: several containing different pre Nondeterministic actions: several containing the same pre Probabilistic actions: several and a probability distribution over those having the same pre The definitions of action application and of a development has to be generalized accordingly But: the study of the base case is the necessary start before proceeding to the above

10 Technical simplifications for defining planning algorithms Assume that features can only have the values true or false Assume atomic features, i.e. written as a single symbol and not a composite expression A feature state {[: a true][: b false][: c false]} is abbreviated as {a, -b, -c} None of these is an essential restriction

11 Formal definition of the classical planning problem Let F be the set of features in the planning problem Let R(0) be the starting state and G the goal state Let Σ be the set of actions and, for each a in Σ, S(a) = = where p (precond) and e (effect) are partial states over the same subset of F For a plan (composite action), let R(k) = (R(k-1) - p(a)) + e(a) if p(a)  R(k-1) A plan is a solution to the planning problem iff all R(i) are well defined and G  R(k) Variants of the problem will be addressed later on.

12 Planning as state-space search Most obvious approach: search the tree of possible action applications. (Progressive planning) Alternative: search ’backwards’ from the (complete) goal state. (Regressive planning) Related idea: middle-out planning (try to identify natural intermediate steps) Other related idea: hierarchical planning (use actions on several levels) All of these approaches are based on search in the state space

13 Many other aspects of the planning problem Integrating planning and prediction (requires progressive planning; leads to an agenda architecture) More sophisticated action descriptions, e.g. probabilistic ones, allowing side-effects, or allowing concurrency Plan revision Combine with path planning (continuous movement) Combine with scheduling Planning of conversation and other social interactions Algorithms that exploit particular characteristics of the planning problem as stated above Complexity analysis of planning algorithms with particular restrictions on action descriptions Adding further information that has the effect of constraining the search Color: requires extended ontology, will be addressed here

14 Partial-Order Planning (POP) Basic idea: Make a search in the space of partial plans. Start with the empty partial plan Transform to successively larger partial plans until a satisfactory one has been found Maintain annotation of the partial plan during this process, in order to make it efficient.

15 The annotated partial plan A set N of actions, taken from the set Σ of all available actions A set of ordering constraints on members of N, written as in A < B A set of causal links written as in A [u]-> B where u is an assignment of a value to a feature A set of open preconditions of the actions in N, each of which is an assignment of a value to a feature Restriction: each open precondition element must appear in the precond of some action to which there is no causal link One more restriction…

16 Start and Finish Two artificial actions are added to the set Σ of actions: Start = Finish = where 0 is the empty set The ordering constraints must contain Start < A A < Finish for all members of N except themselves.

17 Initial partial plan {Start, Finish} { Start < Finish } Empty set of causal links Goal state

18 Causal links and conflicts A [u]-> B means that ”A achieves u for B”, i.e. u is one of the postconditions of A, it is a precondition of B, and there is no action between A and B that changes the value of u. The causal link A [u]-> B conflicts with an action C iff C overrides u and neither C<A nor B<C is in the ordering The conflict can be resolved by adding C<A or B<C to the ordering constraints, provided that this does not create a circularity for the < relation

19 Consistency and solution A partial plan is consistent iff (1) there are no cycles in its ordering <, (2) its causal links do not have any conflicts A consistent partial plan is a solution to the POP planning problem iff its set of open preconditions is empty.

20 An example of POP (classical planning problem) R.0 = {u,v,w,x} G = {-u, -w} A = B = C = The following two actions are added: Start = Finish = Choose N = {Start, Finish} Initial partial plan:

21 Solution partial plan Set of actions: {Start, A, B, Finish} Ordering: Start < A < Finish, Start < B < Finish Causal links: Start [u]-> A, Start [v]-> A, Start [x]-> B, Start [w]-> B, A [-u]-> Finish, B [-w]-> Finish Final state after executing the plan: {-u,v,-w,-x}

22 Algorithm of Partial-Order Planning Given R.0, Σ and G as above, select N = {Start, Finish}, Σ' = Σ u N, and initial partial plan as In each cycle until termination: Pick one of the nodes, i.e. available partial plans, call it PP In that node, pick an open precondition u in the fourth element of PP. Let B be the action where u is a precond. Pick an action A that has u as an effect If A is not yet in N then add A to N and Start < A to ordering Always add A < B to the ordering Add A [u]-> B to the causal links [continued]

23 Continued If necessary, add ordering constraints to < so that the resulting PP is consistent i.e. it does not contain any conflicts Revise the fourth element of PP so that it is the set of all preconditions that are not supported by a causal link If a consistent PP can be constructed in this way then add it to the search graph (unless it is already there) Termination conditions: If the new node is a solution, the terminate with success If no new node can be added then terminate with failure Special consideration: If selected action is already in N then create duplicate

24 Simple extensions of planning problem and of state-space ontology Allow each action to be mapped to a set of precondition- postcondition pairs. Consequently: If an action is mapped to several pairs containing different preconditions then it is deterministic with conditional effects If an action is mapped to several pairs containing the same precondition then it is nondeterministic Allow the starting state to be partial

25 Effects of these generalizations If all the actions are deterministic, and the starting state is complete, then the problem can be reduced to (i.e. transformed to) the original action planning problem A partial starting state means that plans must be written so that they can accommodate to the situation at hand, e.g. using information- acquiring actions Nondeterministic actions suggest a need for conditional actions

26 Ways of characterizing action laws Directly in terms of the state-space ontology, as has been the case in this lecture Using precondition/ effect rules, as has been done in lab 2b Define each action as a causal net of the kinds used in lab 3 Define each action as a script whereby it is reduced to assignment statements Define as a script also allowing other types of statements, e.g. occlusion statements

27 Elimination of arguments of actions [Do.t [pour.fr.to]] = [if [and [H-.t (substance-in:.to) empty] (not [H-.t (substance-in:.fr) empty ])] [coact [H!.t (substance-in:.to) (cv (substance-in:.fr)) ] [H!.t (substance-in:.fr) empty ]] ] Precondition: {[: (substance-in: glass1) milk] [: (substance-in: glass2) empty]} Postcondition: {[: (substance-in: glass1) empty] [: (substance-in: glass2) milk]} This must be repeated for all choices of glasses and contents!

28 Elimination of arguments of actions One action law expressed as a script may correspond to many precond/postcond pairs in the state-transition ontology Computationally, there are algorithms that are able to process very large sets of such elementary action descriptions, but... Expressivity remains an issue On the theoretical side, the state transition ontology serves as a semantics for other representations, in particular for those using logic formulas or scripts

29 Strengths and weaknesses of state-space-based action planning Strength: systematic algorithms exist Strength: complexity results exist for some restricted cases, and some of them are computationally tractable Strength: progressive planning integrates well with prediction, which is needed in many cognitive-robotics applications Strength and weakness: actions with arguments must (and often, can) be converted to variable-free form, large size Weakness: expressivity is insufficient for many practical situations Weakness: computational properties are not always good enough in practice for large problems Use of logic-based methods is a way of obtaining higher expressivity Use of constraint-based methods often obtains better results for very large planning problems These approaches will be addressed in the next three lectures


Download ppt "Artificial Intelligence and Lisp #8 State-space Characterization of Actions Algorithmic Planning."

Similar presentations


Ads by Google