• Keine Ergebnisse gefunden

Planning and Optimization B3. General Regression Gabriele R¨oger and Thomas Keller

N/A
N/A
Protected

Academic year: 2022

Aktie "Planning and Optimization B3. General Regression Gabriele R¨oger and Thomas Keller"

Copied!
42
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Gabriele R¨oger and Thomas Keller

Universit¨at Basel

October 10, 2018

(2)

Planning

Classical

Tasks Progression/

Regression Complexity Heuristics

Probabilistic

MDPs Uninformed Search

Heuristic Search Monte-Carlo

Methods

(3)

With disjunctions and conditional effects, things become more tricky. How to regressa∨(b∧c) with respect tohq,d Bbi?

In this chapter, we show how to regressgeneral sets of states through general operators.

We extensively use the idea of representing sets of states as formulas.

(4)

Regressing State Variables

(5)

Key question for general regression:

Assume we are applying an operator with effecte. What must be true in the predecessor state

for state variable v to be true in the successor state?

If we can answer this question, a general definition of regression is only a small additional step.

(6)

Assume we are in states and apply effecte to obtain successor states0.

State variablev is true ins0 if effect e makes it true, or

it remains true, i.e., it is true ins and not made false bye.

(7)

Definition (Regressing a State Variable Through an Effect) Lete be an effect of a propositional planning task,

and letv be a state variable.

Theregression ofv throughe, writtenregr(v,e), is defined as the following logical formula:

regr(v,e) =effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Question: Does this capture add-after-delete semantics correctly?

(8)

Example

Lete = (bBa)∧(c B¬a)∧b∧ ¬d. v regr(v,e) a b∨(a∧ ¬c) b > ∨(b∧ ¬⊥)≡ >

c ⊥ ∨(c∧ ¬⊥)≡c d ⊥ ∨(d ∧ ¬>)≡ ⊥

Reminder: regr(v,e) =effcond(v,e)∨(v∧ ¬effcond(¬v,e))

(9)

Lemma (Correctness ofregr(v,e))

In a propositional planning task, let s be a state, e be an effect and v be a state variable.

Then s|=regr(v,e) iff sJeK|=v .

(10)

Proof.

(⇒): We know s |=regr(v,e), and hence s |=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Do a case analysis on the two disjuncts.

Case 1: s |=effcond(v,e).

ThensJeK|=v by the first case in the definition ofsJeK. Case 2: s |= (v∧ ¬effcond(¬v,e)).

Thens |=v ands 6|=effcond(¬v,e).

We may additionally assumes 6|=effcond(v,e) because otherwise we can apply Case 1 of this proof.

ThensJeK|=v by the third case in the definition ofsJeK. . . .

(11)

Proof.

(⇒): We know s |=regr(v,e), and hence s |=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Do a case analysis on the two disjuncts.

Case 1: s |=effcond(v,e).

ThensJeK|=v by the first case in the definition ofsJeK. Case 2: s |= (v∧ ¬effcond(¬v,e)).

Thens |=v ands 6|=effcond(¬v,e).

We may additionally assumes 6|=effcond(v,e) because otherwise we can apply Case 1 of this proof.

ThensJeK|=v by the third case in the definition ofsJeK. . . .

(12)

Proof.

(⇒): We know s |=regr(v,e), and hence s |=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Do a case analysis on the two disjuncts.

Case 1: s |=effcond(v,e).

ThensJeK|=v by the first case in the definition ofsJeK. Case 2: s |= (v∧ ¬effcond(¬v,e)).

Thens |=v ands 6|=effcond(¬v,e).

We may additionally assumes 6|=effcond(v,e) because otherwise we can apply Case 1 of this proof.

ThensJeK|=v by the third case in the definition ofsJeK. . . .

(13)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(14)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(15)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(16)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(17)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(18)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(19)

Proof (continued).

(⇐): Proof by contraposition.

We show that ifregr(v,e) is falsein s, thenv is false insJeK. By prerequisite, s 6|=effcond(v,e)∨(v∧ ¬effcond(¬v,e)).

Hence s |=¬effcond(v,e)∧(¬v∨effcond(¬v,e)).

From the first conjunct, we get s |=¬effcond(v,e) and hence s 6|=effcond(v,e).

From the second conjunct, we gets |=¬v∨effcond(¬v,e).

Case 1: s |=¬v. Then v is false before applying e and remains false, so sJeK6|=v.

Case 2: s |=effcond(¬v,e). Then v is deleted by e and not simultaneously added, so sJeK6|=v.

(20)

Regressing Formulas Through Effects

(21)

We can now generalize regression from state variables to general formulas over state variables.

The basic idea is to replace every occurrenceof every state variable v byregr(v,e) as defined in the previous section.

The following definition makes this more formal.

(22)

Definition (Regressing a Formula Through an Effect) In a propositional planning task, lete be an effect, and letϕbe a formula over state variables.

Theregression ofϕthrough e, written regr(ϕ,e), is defined as the following logical formula:

regr(>,e) =>

regr(⊥,e) =⊥

regr(v,e) =effcond(v,e)∨(v∧ ¬effcond(¬v,e)) regr(¬ψ,e) =¬regr(ψ,e)

regr(ψ∨χ,e) =regr(ψ,e)∨regr(χ,e) regr(ψ∧χ,e) =regr(ψ,e)∧regr(χ,e).

(23)

Example

Lete = (bBa)∧(c B¬a)∧b∧ ¬d. Recall:

regr(a,e)≡b∨(a∧ ¬c) regr(b,e)≡ >

regr(c,e)≡c regr(d,e)≡ ⊥ We get:

regr((a∨d)∧(c∨d),e)≡((b∨(a∧ ¬c))∨ ⊥)∧(c∨ ⊥)

≡(b∨(a∧ ¬c))∧c

≡b∧c

(24)

Lemma (Correctness ofregr(ϕ,e))

Letϕbe a logical formula, e an effect and s a state.

Then s|=regr(ϕ,e) iff sJeK|=ϕ.

(25)

Proof.

The proof is by structural induction onϕ.

Induction hypothesis: s |=regr(ψ,e) iffsJeK|=ψ for all proper subformulasψ ofϕ.

Base caseϕ=>:

We haveregr(>,e) =>, ands |=>iff sJeK|=> is correct.

Base caseϕ=⊥:

We haveregr(⊥,e) =⊥, ands |=⊥iff sJeK|=⊥ is correct.

Base caseϕ=v:

We haves |=regr(v,e) iff sJeK|=v from the previous lemma. . . .

(26)

Proof.

The proof is by structural induction onϕ.

Induction hypothesis: s |=regr(ψ,e) iffsJeK|=ψ for all proper subformulasψ ofϕ.

Base caseϕ=>:

We haveregr(>,e) =>, ands |=>iff sJeK|=> is correct.

Base caseϕ=⊥:

We haveregr(⊥,e) =⊥, ands |=⊥iff sJeK|=⊥ is correct.

Base caseϕ=v:

We haves |=regr(v,e) iff sJeK|=v from the previous lemma. . . .

(27)

Proof.

The proof is by structural induction onϕ.

Induction hypothesis: s |=regr(ψ,e) iffsJeK|=ψ for all proper subformulasψ ofϕ.

Base caseϕ=>:

We haveregr(>,e) =>, ands |=>iff sJeK|=> is correct.

Base caseϕ=⊥:

We haveregr(⊥,e) =⊥, ands |=⊥iff sJeK|=⊥ is correct.

Base caseϕ=v:

We haves |=regr(v,e) iff sJeK|=v from the previous lemma. . . .

(28)

Proof.

The proof is by structural induction onϕ.

Induction hypothesis: s |=regr(ψ,e) iffsJeK|=ψ for all proper subformulasψ ofϕ.

Base caseϕ=>:

We haveregr(>,e) =>, ands |=>iff sJeK|=> is correct.

Base caseϕ=⊥:

We haveregr(⊥,e) =⊥, ands |=⊥iff sJeK|=⊥ is correct.

Base caseϕ=v:

We haves |=regr(v,e) iff sJeK|=v from the previous lemma. . . .

(29)

Proof.

The proof is by structural induction onϕ.

Induction hypothesis: s |=regr(ψ,e) iffsJeK|=ψ for all proper subformulasψ ofϕ.

Base caseϕ=>:

We haveregr(>,e) =>, ands |=>iff sJeK|=> is correct.

Base caseϕ=⊥:

We haveregr(⊥,e) =⊥, ands |=⊥iff sJeK|=⊥ is correct.

Base caseϕ=v:

We haves |=regr(v,e) iff sJeK|=v from the previous lemma. . . .

(30)

Proof (continued).

Inductive caseϕ=¬ψ:

s |=regr(¬ψ,e) iff s |=¬regr(ψ,e) iff s 6|=regr(ψ,e) iff sJeK6|=ψ iff sJeK|=¬ψ Inductive caseϕ=ψ∨χ:

s |=regr(ψ∨χ,e) iffs |=regr(ψ,e)∨regr(χ,e) iffs |=regr(ψ,e) ors |=regr(χ,e) iffsJeK|=ψ or sJeK|=χ

iffsJeK|=ψ∨χ Inductive caseϕ=ψ∧χ:

Like previous case, replacing “∨” by “∧”

and replacing “or” by “and”.

(31)

Proof (continued).

Inductive caseϕ=¬ψ:

s |=regr(¬ψ,e) iff s |=¬regr(ψ,e) iff s 6|=regr(ψ,e) iff sJeK6|=ψ iff sJeK|=¬ψ Inductive caseϕ=ψ∨χ:

s |=regr(ψ∨χ,e) iffs |=regr(ψ,e)∨regr(χ,e) iffs |=regr(ψ,e) ors |=regr(χ,e) iffsJeK|=ψ or sJeK|=χ

iffsJeK|=ψ∨χ Inductive caseϕ=ψ∧χ:

Like previous case, replacing “∨” by “∧”

and replacing “or” by “and”.

(32)

Proof (continued).

Inductive caseϕ=¬ψ:

s |=regr(¬ψ,e) iff s |=¬regr(ψ,e) iff s 6|=regr(ψ,e) iff sJeK6|=ψ iff sJeK|=¬ψ Inductive caseϕ=ψ∨χ:

s |=regr(ψ∨χ,e) iffs |=regr(ψ,e)∨regr(χ,e) iffs |=regr(ψ,e) ors |=regr(χ,e) iffsJeK|=ψ or sJeK|=χ

iffsJeK|=ψ∨χ Inductive caseϕ=ψ∧χ:

Like previous case, replacing “∨” by “∧”

and replacing “or” by “and”.

(33)

Regressing Formulas Through

Operators

(34)

We can now regress arbitrary formulas through arbitrary effects.

The last missing piece is a definition of regression through operators, describing exactly in which statess applying a given operator o leads to a state satisfying a given formula ϕ.

There are two requirements:

The operatoro must beapplicablein the states.

Theresulting state sJoKmustsatisfyϕ.

(35)

Definition (Regressing a Formula Through an Operator) In a propositional planning task, leto be an operator, and letϕbe a formula over state variables.

Theregression ofϕthrough o, written regr(ϕ,o), is defined as the following logical formula:

regr(ϕ,o) =pre(o)∧regr(ϕ,eff(o)).

(36)

Theorem (Correctness ofregr(ϕ,o))

Letϕbe a logical formula, o an operator and s a state.

Then s|=regr(ϕ,o) iff o is applicable in s and sJoK|=ϕ.

(37)

Reminder: regr(ϕ,o) =pre(o)∧regr(ϕ,eff(o))

Proof.

Case 1: s |=pre(o).

Theno is applicable ins and the statement we must prove simplifies to: s |=regr(ϕ,eff(o)) iffsJeK|=ϕ.

This was proved in the previous lemma.

Case 2: s 6|=pre(o).

Thens 6|=regr(ϕ,o) ando is not applicable in s.

Hence both statements are false and therefore equivalent.

(38)

Reminder: regr(ϕ,o) =pre(o)∧regr(ϕ,eff(o))

Proof.

Case 1: s |=pre(o).

Theno is applicable ins and the statement we must prove simplifies to: s |=regr(ϕ,eff(o)) iffsJeK|=ϕ.

This was proved in the previous lemma.

Case 2: s 6|=pre(o).

Thens 6|=regr(ϕ,o) ando is not applicable in s.

Hence both statements are false and therefore equivalent.

(39)

Examples: compute regression and simplify to DNF regr(b,ha,bi)

≡a∧(> ∨(b∧ ¬⊥))

≡a

regr(b∧c ∧d,ha,bi)

≡a∧(> ∨(b∧ ¬⊥))∧(⊥ ∨(c∧ ¬⊥))∧(⊥ ∨(d∧ ¬⊥))

≡a∧c∧d

regr(b∧ ¬c,ha,b∧ci)

≡a∧(> ∨(b∧ ¬⊥))∧ ¬(> ∨(c∧ ¬⊥))

≡a∧ > ∧ ⊥

≡ ⊥

(40)

Examples: compute regression and simplify to DNF regr(b,ha,c Bbi)

≡a∧(c∨(b∧ ¬⊥))

≡a∧(c∨b)

≡(a∧c)∨(a∧b)

regr(b,ha,(c Bb)∧((d ∧ ¬c)B¬b)i)

≡a∧(c∨(b∧ ¬(d∧ ¬c)))

≡a∧(c∨(b∧(¬d∨c)))

≡a∧(c∨(b∧ ¬d)∨(b∧c))

≡a∧(c∨(b∧ ¬d))

≡(a∧c)∨(a∧b∧ ¬d)

(41)

Summary

(42)

Regressing a state variablethrough an (arbitrary) operator must consider two cases:

state variablesmade true (by add effects)

state variablesremaining true(by absence of delete effects) Regression of state variables can be generalized

to arbitrary formulas ϕby replacing each occurrence of a state variable in ϕby its regression.

Regressing a formula ϕthrough an operatorinvolves

regressingϕthrough the effect and enforcing the precondition.

Referenzen

ÄHNLICHE DOKUMENTE

PDDL: Planning Domain Definition Language PDDL is the standard language used in practice to describe planning tasks. descriptions in (restricted) predicate logic instead

intuition: the closer h is to true cost to goal, the more efficient the search using h.. Heuristics A ∗ Search

When applying regression in practice, we need to consider emptiness testing to prune dead-end search states subsumption testing to prune dominated search states logical

I Coming up with good abstractions automatically is the main research challenge when applying abstraction heuristics

Coming up with good abstractions automatically is the main research challenge when applying abstraction heuristics

Formally, pattern database heuristics are abstraction heuristics induced by a particular class of abstractions called projections.

Each merge-and-shrink heuristic computed with a non-linear merging strategy can also be computed with a linear merging strategy.. However, linear merging can require a

The objective value of an integer program that minimizes this cost subject to the flow constraints is a lower bound on the plan cost (i.e., an admissible heuristic estimate)..