• No results found

4.2 Plan Synthesis

5.1.1 Action Rewriting

We now devise a technique to remodel actions in order to remove the need of the operators checkOk and checkNo.

We note that this is essentially a technical discussion, and no correctness theorems are stated.

The technique builds upon the work presented in [Sta-wowy, 2015], and, informally speaking, embeds the satis-fiability check provided by QTunsat inside the rules’ precon-dition; it does so by analysing all possible inconsistencies that could arise by performing the action related to the rule, tailoring QTunsat to consider only those specific cases, and add the resulting control query Qcheck to the condi-tion of the rule.

Before proceeding, though, we have to notice that the aforementioned additional control query could be asked to “judge” the contribution of any of the parameters used in the effects; this could raise an invalid query in the condition-action rule, as the parameters ⃗x available in the rule are (possibly) a subset of the action’s parameters ⃗p, leaving out the external input parameters. In order to be able to address them in the condition-action rule, we have to translate the given reKAB K into an equivalent one KDom where we modify the semantic of the actions in the following way:

1. we introduce the special concept Domain in the KB, and add to it all the individuals of the domain (if it is finite, otherwise if is infinite but state-bounded, we calculate the equivalent finite domain), thus giving

a representation of the domain directly inside the ABox. Such concept is immutable, thus cannot be used in the definition of the effects;

2. we modify each condition-action rule γα to incor-porate the external input parameters assignment of the related action α. For each external input pext in ⃗p, we add to the condition of the rule the CQ Domain(pext).

With this modifications, we effectively move the assign-ment of the external input parameters into the condition-action rule, and link them, as in the original reKABK, to a random value in the domain through its “image” Domain in the ABox. We can thus conclude that the reKABs K and KDom are equivalent (they generate the same TS), and resume the building of Qcheck.

By definition, QTunsat checks for all possible inconsis-tencies by means of queries. When we perform an instan-tiated action αϑ in state A and get the successor state Anext, we can be sure that the only source of inconsis-tencies comes from the set of instantiated positive effects F+ϑ of the action α; this is easily proved by the fact that, if we assume the state A to be consistent, then removing statements from it (as the set of negative effects Fdoes), does not alter its consistency. We thus concentrate on the set F+, without any substitution ϑ, as the technique must be applicable in every situation and for every substitution.

We consider the rule γ related to the action α, and extend its condition’s ECQ by adding the query Qcheck, which is created as follows (we add a step-by-step example

5.1. Translation to STRIPS

along). We consider QTunsat to be saturated with respect to the positive axioms of the TBox (we can achieve this by applying the query reformulation to QTunsat). For every atomic effect (fi+, ⃗xf +)∈ F+ (e.g., A(y)):

1. check if the term fi+appears in any CQ qu in QTunsat (we denote with ⃗xqthe vector of existential variables that appear in qu, as every CQ in QTunsat is boolean).

E.g., we have qu =∃x.A(x) ∧ B(x);

2. given qu, we proceed to unify fi+ with one atom in qu with the same term as fi+ (it could be case of functional axioms, where the related CQ qu contains two atoms using the same term). E.g., qu[x/y] = A(y)∧ B(y);

3. we substitute fi+ in qu with the vale true, as it is the added effect and thus forcibly evaluates always to true. E.g., qu[x/y] = true∧ B(y);

4. we evaluate the contribution of the negative effects F. For every atomic effect (fi, ⃗xf) ∈ F, we check if the term fappears in any atom δ(⃗xq)[⃗xq/⃗xf +] of qu (every CQ in QTunsat contains at most two atoms, plus an inequality in case of a functionality assertion). In such case, we want to express the fact that, when δ(⃗xq)[⃗xq/⃗xf +] = (fi, ⃗xf), the negative effect effectively remove the possibility of an incon-sistency. We thus add the inequalities∧

xq,i̸= xf−,j

for xq,i ∈ ⃗xq, xf +,j ∈ ⃗xf +. E.g., if (fi, ⃗xf) = B(z), then qu[x/y] = true∧ B(y) ∧ y ̸= z;

5. we evaluate the contribution of the remaining posi-tive effects in F+. For every atomic effect (fir, ⃗xf r)

F+, we check if the term fr appears in any atom δ(⃗xq)[⃗xq/⃗xf +] of qu (every CQ in QTunsat contains at most two atoms, plus inequalities in case of a functionality assertion and negative effects). In such

case, we want to express the fact that, when δ(⃗xq)[⃗xq/⃗xf +] = (fir, ⃗xf r), the addition of both effects generates an

in-consistency. We thus add the equality∧

xq,i= xf r,j for xq,i ∈ ⃗xq, xf r,j ∈ ⃗xf r. E.g., if (fir, ⃗xf r) = B(u), then qu[x/y] = true∧ B(y) ∧ y ̸= z ∧ y = u;

6. qu now effectively contains all the elements to block possible inconsistencies related to the atomic effect (fi+, ⃗xf +). Since it is derived from QTunsat, if it

evalu-ates to true, than it means that (fi+, ⃗xf +) generates an inconsistency. We thus add¬qu to Qcheck.

Definition 5.1.1 Given an action α ∈ Λ and its corre-sponding rule γ ∈ Γ (γ : Q 7→ α), we call extended rule γext the rule defined as:

γext: Qext7→ α

with Qext= Qrew∧ Qcheck, and Qcheck the ECQ obtained by tailoring QTunsat w.r.t. the positive effects F+.

The extended rules effectively catch possible inconsis-tencies beforehand, and thus eliminating the need of the check consistency modality (and its related predicates) in the translation to STRIPS. The union of all extended rules defines the set Γext.

Related documents