• Aucun résultat trouvé

Chapter 5. HTN Planning in PDL 100 As π0 ∈red(Dhtn, π), by Proposition 5.5 we haveFml(Dhtn)|=π0vπ. Therefore by Proposition5.1 we have

Fml(Dhtn)|=Init→ h(a1;. . .;an)uπi>.

The converse of Theorem5.6 and its corollary do not hold because every plan has to be able to be generated by reductions. To see this consider Example5.2, where Fml(DhtnAB) |= AtA → hrideABugoABi> but rideAB ∈/ sol(DABhtn,AtA,goAB). That is, the planrideABof just taking the taxi without paying also achieves the primary effect of goAB, but it cannot be obtained by refinements.

The following proposition bridges PDL and the plan-existence problem for HTN planning.

Proposition 5.7. Let Phtn =hDhtn,Init, πi be an HTN planning problem. If Phtn has a solution then

Fml(Dhtn)|=Init→ h G

Act0

uπi>.

Proof. By the valid formula ha1;. . .;aniϕ→ h(F Act0

iϕ.

Chapter 5. HTN Planning in PDL 101 actions literature [Herzig et al., 2006, Herzig and Varzinczak, 2007, Varzinczak, 2010]. One of these principles says that precontains all information about action executability. (This hypothesis of complete information is also made by Reiter w.r.t. his Poss predicate specifying action preconditions [Reiter, 2001]). Our Ex-plicit Executability Constraint (EE) states this principle as follows:

If Fml(Dhtn)|=hαi> ↔ϕthen Fml(pre)|=hαi> ↔ϕ. (EE)

Let us use the following example to illustrate this constraint.

Example 5.3. Consider the following HTN planning domain Dhtn:

Fml(pre) ={hαi> ↔ϕα, i> ↔ϕβ} Fml(post) ={[α]p, [β]¬p}

Fml(ref) ={hαi> →βvα, hβi> →πβvβ}

Suppose M be a model of Fml(Dhtn). Suppose M contains a possible world w such that M, w ϕα. Then Rα(w) is non-empty due to formula hαi> ↔ ϕα in Fml(pre). Due to formula hαi> → βvα in Fml(ref) we moreover have M, w βvα, and therefore Rα(w) ⊆ Rβ(w). However, it entails that for every w0 ∈ Rα(w), M, w0 p∧ ¬p. Thus, such a world w cannot exist. It follows that for every model M such that M Fml(Dhtn) we have M ¬ϕα, that is, Fml(Dhtn)|= hαi> ↔ ⊥. So Dhtn violates Constraint (EE) as we have Fml(Dhtn)|=hαi> ↔ ⊥ but we don’t have Fml(pre)|=hαi> ↔ ⊥.

A second principle that should hold is that information about refinement should not be relevant for the status of primitive formulas that do not include high-level actions. Primitive Modularity Constraint (PM) states this principle as follows:

for every primitive formula ϕ0,

if Fml(Dhtn)|=ϕ0 then Fml(pre)∪Fml(post)|=ϕ0. (PM)

The following example shows that Constraint (PM) is not always satisfied.

Chapter 5. HTN Planning in PDL 102 Example 5.4. LetAct0 ={a}and let Act=Act0∪{α, β}. Let Dhtn be a planning domain as captured by the following formulas:

Fml(pre) = {hαi> ↔ >, i> ↔ >, hai> ↔ >}

Fml(post) = {[a]>, [α]q, [β]¬q} ∪ {p[a]p|pP} ∪ {¬p[a]¬p|pP} Fml(ref) = {hαi> →avα, hβi> →avβ}

We have Fml(Dhtn) |= avα ∧avβ due to Fml(pre) and Fml(ref). By Proposi-tion 5.1 we then have Fml(Dhtn) |= [a]q∧[a]¬q due to Fml(post), and therefore Fml(Dhtn) |= ⊥ due to Fml(pre). However, it is not the case that Fml(pre)∪ Fml(post)|=⊥ and consequently Constraint (PM) is violated.

5.5.2 Coherence Condition of HTN Domains

Another important postulate of HTN planning domains concerns coherence. The dynamic logic actually provides HTN planning with a logical semantics to evaluate the soundness of HTN domains.

Definition 5.1. An HTN planning domain Dhtn is coherent if Fml(Dhtn) is satis-fiable.

Intuitively, the soundness of HTN planning domains captures that once an action is performed, its postcondition will hold and that once an action is refined, its refinement will satisfy its postcondition.

Let us revisit the abstract example:

Example 5.5. The planning domain of Example 5.1 is captured by

Fml(pre) ={hαi> ↔ϕα, hβi> ↔ϕβ, hγi> ↔ >}

Fml(post) ={[α]p, ]>, [γ]¬p,}

Fml(ref) ={hαi> →βvα, hβi> →γvβ}

Suppose the above HTN domain is coherent and M is one of its model. When ϕα∧ϕβ is satisfiable then there exists a pointed model (M, w) such that M, w

Chapter 5. HTN Planning in PDL 103 ϕα∧ϕβ. Then we have M, w βvα∧γvβ, and in consequence M, w γvα.

By [α]p∧[γ]¬p, for every w0 ∈ Rα(w), M, w0 p∧ ¬p. Thus, such a world w cannot exist and there is some logical inconsistency between the precondition of the actions.

When ϕα∧ϕβ is unsatisfiable then the HTN domain is coherent, but action α can never be refined into a plan.

5.5.3 Soundness Postulate of Actions

We now formulate a soundness postulate for high-level actions. It requires that when a high-level action αis executable then every possible refinement of α guar-antees the postcondition of α. This is conditional on the precondition of α: if they are false then there is no point in refining α and π may have arbitrary con-sequences.

Definition 5.2. Given a model M and world w in M of HTN planning domain Dhtn, we say that the high-level action α ∈Act is soundly refinable at (M, w) on Dhtn if and only if either M, w 6 pre(α) or for every π ∈ ref(α) and v ∈Rπ(w), M, v post(α).

If the actionαis soundly refinable at every pointed model (M, w) in HTN planning domainDhtn, we say α is soundly refinable in Dhtn.

Indeed a coherent HTN planning domain guarantees the soundly refinability of actions, as the theorem shows:

Theorem 5.8. If the HTN planning domainDhtnis coherent, then every high-level action in Act is soundly refinable in Dhtn.

Proof. Suppose the HTN planning domainDhtn is sound thenFml(Dhtn) is satisfi-able. Assume M is a model of Fml(Dhtn) and M contains a possible world w. If M, w 6pre(α) then α is soundly refinable at (M, w). Otherwise, by Fml(ref), for allπ ∈ref(α), we haveM, w πvα. AsFml(post),M, w[α]post(α). It entails

Chapter 5. HTN Planning in PDL 104 that for every v ∈Rπ(w), M, v post(α), and in consequence that α is soundly refinable at (M, w).

From the above theorem, we can conclude that for every high-level action, the following holds:

Fml(Dhtn)|=pre(α)→ G

ref(α)

post(α).

Actually, the consequent captures the soundly refinability of action α.

5.5.4 Completeness Postulate of Actions

Symmetrically to soundness postulate, one may formulate a postulate of com-pleteness: when the precondition of a high-level action is true then it should be refinable in some way.

Definition 5.3. Given a model M and world w in M of HTN planning domain Dhtn we say that high-level action α ∈ Act is completely refinable at (M, w) on Dhtn if and only if either M, w 6pre(α) or there is a π∈ref(α) such thatRπ(w) is not empty.

If the action α is completely refinable at every pointed model (M, w) in HTN planning domain Dhtn, we say α is completely refinable in Dhtn.

In other words, in every possible, as long as the precondition of α is true, then one of the programs refining α is executable. Next we show that the completely refinability can be captured in PDL.

Theorem 5.9. A high-level action α∈Act\Act0 is completely refinable in HTN planning domain Dhtn if and only if

Fml(Dhtn)|=pre(α)→ G

ref(α)

>.

Chapter 5. HTN Planning in PDL 105 Proof. “⇒:” Assume the high-level action α is completely refinable in the HTN domainDhtn. Suppose M is a model ofFml(Dhtn) and M, w pre(α). Then there is a π ∈ ref(α) such that Rπ(w) is not empty. So Fml(Dhtn) |=

π

>. By the existence of π, we have F

ref(α)

>.

“⇐:” Assume Fml(Dhtn) |= pre(α) → F

ref(α)

>. If M, w 6 pre(α) then α is completely refinable at (M, w). Else as F

ref(α)

>, we have oneπ ∈ref(α) such that M, w hπi>. It means Rπ(w) is not empty, entailing that α is completely refinable at (M, w).

The soundness of HTN planning domains can not guarantee the completely refin-ability of every high-level action. Let us take up the example of travelling fromA toB:

Example 5.6. Consider the theory Fml(DABhtn) in Example5.2, it is not difficult to checkFml(DhtnAB)is satisfiable, that is, the HTN planning domainDABhtnis sound. The high-level actiongoAB is completely refinable in DhtnAB, because goAB can be refined intowalkAB, it means that once the preconditionAtAof the actiongoABholds, one of its refinements walkAB can performed. But, the high-level action TaxiAB is not completely refinable in DABhtn, because its unique refinement (rideAB;pay) requires Money which the precondition AtA of the action TaxiAB can not entail.

We conclude this section by showing that complete refinability can be weakened, viz. by requiring that an executable high-levelα must be refinableunless there is no primitive plan achieving the primary effect of α. In formulas, we require

Fml(Dhtn)|= pre(α)∧ G

Act0

post(α)

→ G

ref(α)

>.

This is similar to what is called planner completeness in [Kambhampati et al., 1998], which, as we understand it, requires that every solution that can be obtained by a classical planner is also obtainable by the HTN planner. This requirement is different from what is called schema completeness in [Kambhampati et al., 1998], which is difficult to capture formally: it basically requires that ref lists all refinements that are intuitively desirable.

Chapter 5. HTN Planning in PDL 106 Example 5.7. For the weaken completeness postulate, the high-level actionTaxiAB in Example 5.2 is still not completely refinable in DhtnAB.