next up previous
Next: IMPLEMENTING POLICIES AND BINDINGS Up: MODELING THE TOAST WORLD Previous: MULTIPLE GOALS: METABOLISM

MULTIPLE GOALS: INTERLEAVED EXECUTION

Metabolism involves performing the same transformation uniformly to instances of the same type of object: cooking all the eggs, or cleaning/dirtying all the forks. Often times, however, an agent will work toward different kinds of goals at once. This can often be done by interleaving the actions from solutions to the individual goals. We will say that an interleaving I is a function that returns one or the other of its first two arguments, depending on a third state argument:

displaymath2224

When the last two arguments of I are policies, the result is itself a policy, so we will define the notation:

displaymath2225

If we wanted to simultaneously make toast and cook an egg, then a good interleaving of a toast-making policy and an egg-cooking policy would be one that chose the egg-making policy whenever the egg had finished its current cooking step (and so was ready to be flipped or removed from the pan) and chose the toast-making policy when the egg was busy cooking. A bad interleaving would be one that always chose the toast-making policy.

An interleaving I is fair for tex2html_wrap_inline2242 and tex2html_wrap_inline2244 if starting from any state, tex2html_wrap_inline2246 will after some finite number of steps have executed both tex2html_wrap_inline2242 and tex2html_wrap_inline2244 at least once. Finally, we will say that two bindings are independent if they map disjoint sets of components to their images. Binding independence is a special case of subgoal independence: two policies can't possibly interfere if they alter distinct state components. Fairness and binding independence are sufficient conditions for an interleaving to solve a conjunctive goal:

  lemma607

Proof: Since I is a fair interleaving, each of the two policies will be executed in finite time, regardless of starting state. By induction, for any n, there is a number of steps after which I is guaranteed to have executed at least n steps of each policy.

The policy tex2html_wrap_inline2242 is the composition of a policy tex2html_wrap_inline2284 for a state space tex2html_wrap_inline2286 with a binding. If tex2html_wrap_inline2242 solves tex2html_wrap_inline2290 and halts, then it must do so by having tex2html_wrap_inline2284 solve tex2html_wrap_inline2294 and halt in some finite number of steps n. During execution, the environment goes through a series of states

displaymath2226

which project under tex2html_wrap_inline2298 to a series of states

displaymath2227

we claim that any execution of the interleaving tex2html_wrap_inline2246 must bring the environment through a sequence of states that project under tex2html_wrap_inline2298 to

displaymath2228

that is, a string of states in which tex2html_wrap_inline2188 appears at least once, then tex2html_wrap_inline2192 , appears at least once, and so on. The only state transitions that appear are from some tex2html_wrap_inline2308 to itself or to tex2html_wrap_inline2310 . Suppose it were otherwise. Then there must be a point at which this series is broken:

displaymath2229

where s is neither tex2html_wrap_inline2308 nor tex2html_wrap_inline2310 . We have two cases. Case 1: tex2html_wrap_inline2242 executed the transition. Then we have that tex2html_wrap_inline2320 , a contradiction. Case 2: tex2html_wrap_inline2244 executed the transition. Then tex2html_wrap_inline2244 has changed one of the state components mapped by tex2html_wrap_inline2298 and so tex2html_wrap_inline2328 and tex2html_wrap_inline2298 are not independent, a contradiction. Thus the interleaving solves tex2html_wrap_inline2290 . By the same reasoning, it must halt in tex2html_wrap_inline2290 , since tex2html_wrap_inline2242 halts in tex2html_wrap_inline2290 . Also by the same reasoning, it must solve tex2html_wrap_inline2340 and halt, and hence, must solve the intersection and halt. tex2html_wrap_inline1904

A useful corollary to this is that when the same policy is applied under two independent bindings, the bindings can be safely interleaved, that is, interleaving commutes with binding:

  corollary619


next up previous
Next: IMPLEMENTING POLICIES AND BINDINGS Up: MODELING THE TOAST WORLD Previous: MULTIPLE GOALS: METABOLISM

Ian Horswill
Wed Apr 2 15:17:20 CST 1997