• Keine Ergebnisse gefunden

Planning and Optimization A4. Planning Tasks Malte Helmert and Thomas Keller

N/A
N/A
Protected

Academic year: 2022

Aktie "Planning and Optimization A4. Planning Tasks Malte Helmert and Thomas Keller"

Copied!
35
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

A4. Planning Tasks

Malte Helmert and Thomas Keller

Universit¨at Basel

September 23, 2019

(2)

Content of this Course

Planning

Classical

Foundations Logic Heuristics Constraints

Probabilistic

Explicit MDPs Factored MDPs

(3)

State Variables

(4)

State Variables

How to specify huge transition systems without enumerating the states?

represent different aspects of the world

in terms of different state variables(Boolean or finite domain) individual state variables induce atomic propositions

a state is avaluation of state variables n Boolean state variables induce 2n states

exponentially more compactthan “flat” representations Example: O(n2) Boolean variables or O(n) finite-domain variables with domain sizeO(n) suffice for blocks world with n blocks

(5)

Blocks World State with Propositional Variables

Example

s(A-on-B) =F s(A-on-C) =F s(A-on-table) =T s(B-on-A) =T s(B-on-C) =F s(B-on-table) =F s(C-on-A) =F s(C-on-B) =F s(C-on-table) =T

A B

C

Note: it may be useful to add auxiliary state variables like A-clear.

(6)

Blocks World State with Finite-Domain Variables

Example

Use three finite-domain state variables:

below-a: {b,c,table}

below-b: {a,c,table}

below-c: {a,b,table}

s(below-a) = table s(below-b) = a s(below-c) = table

33 = 27 states

A B

C

Note: it may be useful to add auxiliary state variables like above-a.

(7)

Propositional State Variables

Definition (Propositional State Variable) Apropositional state variable is a symbolX.

LetV be a finite set of propositional state variables.

Astate s overV is a valuation forV, i.e., a truth assignments :V → {T,F}.

AformulaoverV is a propositional logic formula usingV as the set of atomic propositions.

(8)

Propositional State Variables

Definition (Finite-Domain State Variable)

Afinite-domain state variableis a symbolvwith an associated domaindom(v), which is a finite non-empty set of values.

LetV be a finite set of finite-domain state variables.

Astate s overV is an assignments :V →S

v∈Vdom(v) such thats(v)∈dom(v) for all v ∈V.

AformulaoverV is a propositional logic formula whose atomic propositions are of the formv =d wherev ∈V andd ∈dom(v).

Slightly extending propositional logic, we treat statess over finite-domain variables aslogical valuations wheres |=v =d iffs(v) =d.

(9)

State Variables: Either/Or

State variablesare the basis of compact descriptions of transition systems.

For a given transition system, we will either usepropositional or finite-domainstate variables. We will not mix them.

However, finite-domain variables can haveany finite domain including the domain {T,F}, so are in some sense a proper generalization of propositional state variables.

(10)

From State Variables to Succinct Transition Systems

Problem:

How to succinctlyrepresent transitionsandgoal states?

Idea: Use formulasto describe sets of states states: all assignments to the state variables goal states: defined by a formula

transitions: defined byoperators (see following section)

(11)

Operators

(12)

Syntax of Operators

Definition (Operator)

Anoperator o over state variablesV is an object with three properties:

a preconditionpre(o), a formula over V

an effect eff(o) over V, defined on the following slides a costcost(o)∈R+0

Notes:

Operators are also calledactions.

Operators are often written as triples hpre(o),eff(o),cost(o)i.

This can be abbreviated to pairs hpre(o),eff(o)i when the cost of the operator is irrelevant.

(13)

Operators: Intuition

Intuition for operatorso:

The operator precondition describes the set of states in which a transition labeled with o can be taken.

The operator effect describes how taking such a transition changes the state.

The operator cost describes the cost of taking a transition labeled with o.

(14)

Syntax of Effects

Definition (Effect)

Effectsover state variablesV are inductively defined as follows:

Ifv ∈V is a propositional state variable, then v and¬v are effects (atomic effect).

Ifv ∈V is a finite-domain state variable andd ∈dom(v), then v :=d is an effect (atomic effect).

Ife1, . . . ,en are effects, then (e1∧ · · · ∧en) is an effect (conjunctive effect).

The special case withn = 0 is theempty effect >.

Ifχ is a formula overV ande is an effect, then (χBe)is an effect (conditional effect).

Parentheses can be omitted when this does not cause ambiguity.

(15)

Effects: Intuition

Intuition for effects:

Atomic effectscan be understood as assignments that update the value of a state variable.

For propositional state variables,v means “v:=T”

and¬v means “v:=F”.

A conjunctive effecte = (e1∧ · · · ∧en) means that all subeffects e1, . . . , en take place simultaneously.

A conditional effecte = (χBe0) means that subeffect e0 takes place iff χis true in the state where e takes place.

(16)

Semantics of Effects

Definition (Effect Condition for an Effect) Lete be an atomic effect.

Theeffect condition effcond(e,e0) under whiche triggers given the effecte0 is a propositional formula defined as follows:

effcond(e,e) =>

effcond(e,e0) =⊥for atomic effects e0 6=e

effcond(e,(e1∧ · · · ∧en)) =effcond(e,e1)∨ · · · ∨effcond(e,en) effcond(e,(χBe0)) =χ∧effcond(e,e0)

Intuition: effcond(e,e0) represents the condition that must be true in the current state for the effecte0 to lead to the atomic effecte

(17)

Semantics of Operators: Propositional Case

Definition (Applicable, Resulting State) LetV be a set of propositional state variables.

Lets be a state over V, and let o be an operator overV. Operatoro isapplicable in s ifs |=pre(o).

Ifo is applicable in s, theresulting stateof applying o in s, writtensJoK, is the state s0 defined as follows for allv ∈V:

s0(v) =





T ifs |=effcond(v,e)

F ifs |=effcond(¬v,e)∧ ¬effcond(v,e) s(v) ifs 6|=effcond(v,e)∨effcond(¬v,e) wheree =eff(o).

(18)

Semantics of Operators: Propositional Case

Definition (Applicable, Resulting State) LetV be a set of propositional state variables.

Lets be a state over V, and let o be an operator overV. Operatoro isapplicable in s ifs |=pre(o).

Ifo is applicable in s, theresulting stateof applying o in s, writtensJoK, is the state s0 defined as follows for allv ∈V:

s0(v) =





T ifs |=effcond(v,e)

F ifs |=effcond(¬v,e)∧ ¬effcond(v,e) s(v) ifs 6|=effcond(v,e)∨effcond(¬v,e) wheree =eff(o).

(19)

Add-after-Delete Semantics

Note:

The definition implies that if a variable is simultaneously

“added” (set toT) and “deleted” (set to F), the value Ttakes precedence.

This is calledadd-after-delete semantics.

This detail of semantics is somewhat arbitrary, but has proven useful in applications.

For finite-domain variables, there are no distinguished values like “true” and “false”, and a different semantics is used.

(20)

Conflicting Effects and Consistency Condition

What should an effect of the form v:= a∧v:= bmean?

For finite-domain representations, the accepted semantics is to make this illegal, i.e., to make an operatorinapplicable if it would lead to conflicting effects.

Definition (Consistency Condition)

Lete be an effect over finite-domain state variablesV. Theconsistency conditionfor e,consist(e) is defined as

^

v∈V

^

d,d0∈dom(v),d6=d0

¬(effcond(v :=d,e)∧effcond(v :=d0,e)).

(21)

Semantics of Operators: Finite-Domain Case

Definition (Applicable, Resulting State)

LetV be a set of finite-domain state variables.

Lets be a state over V, and let o be an operator overV. Operatoro isapplicable in s ifs |=pre(o)∧consist(eff(o)).

Ifo is applicable in s, theresulting stateof applying o in s, writtensJoK, is the state s0 defined as follows for allv ∈V: s0(v) =

(d if s |=effcond(v :=d,eff(o)) for somed ∈dom(v) s(v) otherwise

(22)

State Variables Operators Planning Tasks Summary

Applying Operators: Example

Example

Consider the operatoro =ha,¬a∧(¬c B¬b)i and the states ={a7→T,b7→T,c 7→T,d 7→T}.

The operatoro is applicable ins because s |=a.

Effect conditions ofeff(o):

effcond(a,eff(o)) =effcond(a,¬a∧(¬c B¬b))

=effcond(a,¬a)∨effcond(a,¬c B¬b)

=⊥ ∨(¬c∧effcond(a,¬b))

=⊥ ∨(¬c∧ ⊥)

≡ ⊥ false in states

{a7→F,b 7→T,c 7→T,d 7→T}.

(23)

State Variables Operators Planning Tasks Summary

Applying Operators: Example

Example

Consider the operatoro =ha,¬a∧(¬c B¬b)i and the states ={a7→T,b7→T,c 7→T,d 7→T}.

The operatoro is applicable ins because s |=a.

Effect conditions ofeff(o):

effcond(¬a,eff(o)) =effcond(¬a,¬a∧(¬c B¬b))

=effcond(¬a,¬a)∨effcond(¬a,¬c B¬b)

=> ∨effcond(¬a,¬c B¬b)

≡ > true in states

{a7→F,b 7→T,c 7→T,d 7→T}.

(24)

State Variables Operators Planning Tasks Summary

Applying Operators: Example

Example

Consider the operatoro =ha,¬a∧(¬c B¬b)i and the states ={a7→T,b7→T,c 7→T,d 7→T}.

The operatoro is applicable ins because s |=a.

Effect conditions ofeff(o):

effcond(b,eff(o)) =effcond(b,¬a∧(¬c B¬b))

=effcond(b,¬a)∨effcond(b,¬c B¬b)

=⊥ ∨(¬c ∧effcond(b,¬b))

=⊥ ∨(¬c ∧ ⊥)

≡ ⊥ false in states

{a7→F,b 7→T,c 7→T,d 7→T}.

(25)

State Variables Operators Planning Tasks Summary

Applying Operators: Example

Example

Consider the operatoro =ha,¬a∧(¬c B¬b)i and the states ={a7→T,b7→T,c 7→T,d 7→T}.

The operatoro is applicable ins because s |=a.

Effect conditions ofeff(o):

effcond(¬b,eff(o)) =effcond(¬b,¬a∧(¬c B¬b))

=effcond(¬b,¬a)∨effcond(¬b,¬c B¬b)

=⊥ ∨(¬c∧effcond(¬b,¬b))

=⊥ ∨(¬c∧ >)

≡ ¬c false in states

{a7→F,b 7→T,c 7→T,d 7→T}.

(26)

Applying Operators: Example

Example

Consider the operatoro =ha,¬a∧(¬c B¬b)i and the states ={a7→T,b7→T,c 7→T,d 7→T}.

The operatoro is applicable ins because s |=a.

Effect conditions ofeff(o):

effcond(c,eff(o))≡ ⊥ false in states effcond(¬c,eff(o))≡ ⊥ false in states effcond(d,eff(o))≡ ⊥ false in states effcond(¬d,eff(o))≡ ⊥ false in states

The resulting state of applyingo ins is the state {a7→F,b 7→T,c 7→T,d 7→T}.

(27)

Example Operators: Blocks World

Example (Blocks World Operators)

To model blocks world operators conveniently,

we use auxiliary state variablesA-clear,B-clear, andC-clear to express that there is nothing on top of a given block.

Then blocks world operators can be modeled as:

hA-clearA-on-tableB-clear, A-on-B∧ ¬A-on-table∧ ¬B-cleari hA-clearA-on-tableC-clear, A-on-C∧ ¬A-on-table∧ ¬C-cleari hA-clearA-on-B, A-on-table∧ ¬A-on-BB-cleari

hA-clearA-on-C, A-on-table∧ ¬A-on-CC-cleari

hA-clearA-on-BC-clear, A-on-C∧ ¬A-on-BB-clear∧ ¬C-cleari hA-clearA-on-CB-clear, A-on-B∧ ¬A-on-CC-clear∧ ¬B-cleari . . .

(28)

Example Operator: 4-Bit Counter

Example (Incrementing a 4-Bit Counter)

Operator to increment a 4-bit numberb3b2b1b0 represented by 4 state variablesb0, . . . , b3:

precondition:

¬b0∨ ¬b1∨ ¬b2∨ ¬b3 effect:

(¬b0Bb0)∧

((¬b1∧b0)B(b1∧ ¬b0))∧ ((¬b2∧b1∧b0)B(b2∧ ¬b1∧ ¬b0))∧ ((¬b3∧b2∧b1∧b0)B(b3∧ ¬b2∧ ¬b1∧ ¬b0))

(29)

Planning Tasks

(30)

Planning Tasks

Definition (Planning Task)

Aplanning task is a 4-tuple Π =hV,I,O, γi where V is a finite set of state variables,

I is a valuation over V called theinitial state, O is a finite set ofoperators overV, and γ is a formula overV called thegoal.

V must either consist only of propositional or only of finite-domain state variables.

In the first case, Π is called apropositional planning task, otherwise anFDR planning task (finite-domain representation).

Note: Whenever we just say planning task(without

“propositional” or “FDR”), both kinds of tasks are allowed.

(31)

Mapping Planning Tasks to Transition Systems

Definition (Transition System Induced by a Planning Task) The planning task Π =hV,I,O, γi induces

the transition systemT(Π)=hS,L,c,T,s0,S?i, where S is the set of all states over V,

L is the set of operatorsO,

c(o) =cost(o) for all operatorso ∈O,

T ={hs,o,s0i |s ∈S, o applicable ins, s0 =sJoK}, s0=I, and

S? ={s ∈S |s |=γ}.

(32)

Planning Tasks: Terminology

Terminology for transitions systems is also applied to the planning tasks Π that induce them.

For example, when we speak of the states of Π, we mean the states ofT(Π).

A sequence of operators that forms a solution of T(Π) is called aplanof Π.

(33)

Satisficing and Optimal Planning

Byplanning, we mean the following two algorithmic problems:

Definition (Satisficing Planning) Given: a planning task Π

Output: a plan for Π, or unsolvableif no plan for Π exists

Definition (Optimal Planning) Given: a planning task Π

Output: a plan for Π with minimal cost among all plans for Π, or unsolvable if no plan for Π exists

(34)

Summary

(35)

Summary

Planning tasks compactly represent transition systems and are suitable as inputs for planning algorithms.

They are based on concepts frompropositional logic, enhanced to model state change.

Planning tasks can be propositional orfinite-domain.

States of planning tasks are assignments to its state variables.

Operators of propositional planning tasks describe in which situations(precondition), how (effect) and at which costthe state of the world can be changed.

In satisficing planning, we must find a solution for a planning task (or show that no solution exists).

In optimal planning, we must additionally guarantee that generated solutions are of minimal cost.

Referenzen

ÄHNLICHE DOKUMENTE

FF (Hoffmann & Nebel, 2001) problem class: satisficing algorithm class: explicit search search direction: forward search. search algorithm: enforced hill-climbing heuristic:

forward search from initial state to goal based on progression backward search from goal to initial state based on regression bidirectional search.. In this chapter we look

states: graph vertices transitions: labeled arcs (here: colors instead of labels) initial state: incoming arrow goal states: marked (here: by the dashed ellipse) actions: the

Propositional planning tasks compactly represent transition systems and are suitable as inputs for planning algorithms. They are based on concepts from propositional logic, enhanced

The Conference on Security and Cooperation in Europe (CSCE) was an ideal setting for this evolution, enabling the Federal Republic to take the lead early on in Western

o in accordance with the assessment of the institution of the place of residence the treatment can be given within the limit which is medically

The state-nature relations in a developmental state: The South Korean water resource policy The East Asian ‘developmental state thesis’ hereafter, DST, which has been offered by

  Depending on the target quantity to be remotely measured, different measurement systems (geometry, frequency range, emission vs. absorption, platform) can be