• Keine Ergebnisse gefunden

Planning and Optimization A4. Propositional Planning Tasks Gabriele R¨oger and Thomas Keller

N/A
N/A
Protected

Academic year: 2022

Aktie "Planning and Optimization A4. Propositional Planning Tasks Gabriele R¨oger and Thomas Keller"

Copied!
29
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

A4. Propositional Planning Tasks

Gabriele R¨oger and Thomas Keller

Universit¨at Basel

October 1, 2018

(2)

Content of this Course

Planning

Classical

Tasks Progression/

Regression Complexity Heuristics

Probabilistic

MDPs Uninformed Search

Heuristic Search Monte-Carlo

Methods

(3)

Introduction

(4)

State Variables

How to specify huge transition systems without enumerating the states?

represent different aspects of the world in terms of different Boolean state variables treat state variables as atomic propositions

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

exponentially more compactthan “flat” representations Example: O(n2) variables suffice for blocks world withn blocks

(5)

Blocks World State with Boolean State 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

(6)

Boolean State Variables

Problem:

How to succinctlyrepresent transitionsandgoal states?

Idea: Use logical formulas to describe sets of states state variables: atomic propositions

states: all valuations of the state variables goal states: defined by a logical formula

transitions: defined byoperators (see following section)

(7)

Operators

(8)

Syntax of Operators

Definition (Operator)

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

a preconditionpre(o), a logical 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.

(9)

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.

(10)

Syntax of Effects

Definition (Effect)

Effectsover state variablesV are inductively defined as follows:

Ifv ∈V is a state variable, thenv and ¬v are effects (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 logical formula and e is an effect, then (χBe)is an effect (conditional effect).

Parentheses can be omitted when this does not cause ambiguity.

(11)

Effects: Intuition

Intuition for effects:

Atomic effectsv and¬v can be understood as assignments

“v :=T” and “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.

(12)

Semantics of Effects

Definition (Effect Condition for an Effect) Let`=v or `=¬v be an atomic effect.

Theeffect condition effcond(`,e) under which`triggers given the effecte is a propositional formula defined as follows:

effcond(`, `) =>

effcond(`, `0) =⊥for atomic effects `0 6=`

effcond(`,(e1∧ · · · ∧en)) =effcond(`,e1)∨ · · · ∨effcond(`,en) effcond(`,(χBe)) =χ∧effcond(`,e)

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

(13)

Semantics of Operators

Definition (Applicable, Resulting State) LetV be a set of 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).

(14)

Semantics of Operators

Definition (Applicable, Resulting State) LetV be a set of 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).

(15)

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, and other definitions are sometimes used.

We will later also consider conflict semantics where “contradictory” effects are forbidden.

(16)

Introduction Operators Propositional 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}.

(17)

Introduction Operators Propositional 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}.

(18)

Introduction Operators Propositional 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(a,¬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}.

(19)

Introduction Operators Propositional 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}.

(20)

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}.

(21)

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 . . .

(22)

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))

(23)

Propositional Planning Tasks

(24)

Propositional Planning Tasks

Definition (Propositional Planning Task)

Apropositional planning taskis a 4-tuple Π =hV,I,O, γi where V is a finite set of propositions called 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.

Notes:

Next week, we will introduce other kinds of planning tasks (with non-propositional state variables).

We say planning task(without “propositional”) when we do not care about the specific kind of task.

(25)

Mapping Prop. Planning Tasks to Transition Systems

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

the transition systemT(Π)=hS,L,c,T,s0,S?i, where S is the set of all valuations of 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 |=γ}.

(26)

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 Π.

(27)

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

(28)

Summary

(29)

Summary

Propositional planning taskscompactly represent transition systems and are suitable as inputs for planning algorithms.

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

States of propositional planning tasks are propositional valuations.

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

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

For this purpose, we will use propositional logic, which allows expressing information about 2 n states as logical formulas over n state variables... Reminder:

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

Planning tasks in positive normal form without delete effects are called relaxed planning tasks. Plans for relaxed planning tasks are called

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.

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)..