A5. Equivalent Operators and Normal Forms
Malte Helmert and Thomas Keller
Universit¨at Basel
September 25, 2019
Content of this Course
Planning
Classical
Foundations Logic Heuristics Constraints
Probabilistic
Explicit MDPs Factored MDPs
Reminder & Motivation
Reminder: 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).
Arbitrary nesting of conjunctive and conditional effects!
Can we make our life easier?
Reminder: Semantics of Effects
effcond(e,e0): condition that must be true in the current state for the effect e0 to trigger the atomic effecte add-after-delete semantics (propositional tasks):
if an operator with effect e is applied in state s
and we have boths |=effcond(v,e) ands |=effcond(¬v,e), then s0(v) =T in the resulting states0.
consistency semantics(finite-domain tasks):
applying an operator with effecte in a state s where both s |=effcond(v :=d,e) ands |=effcond(v :=d0,e) for values d 6=d0 is forbidden
tested via theconsistency condition consist(e) These are very subtle details!
Can we make our life easier?
Motivation
Similarly to normal forms in propositional logic (DNF, CNF, NNF), we can definenormal forms for effects, operators
and planning tasks.
Among other things, we consider normal forms that avoid complicated nesting and subtleties of conflicts.
This is useful because algorithms (and proofs) then only need to deal with effects, operators and tasks in normal form.
Notation: Applying Effects and Operator Sequences
Existing notation:
We already writesJoKfor the resulting state after applying operator o in states.
New extended notation:
If we want to consider an effect e without a precondition, we write sJeKforsJh>,eiK.
For a sequenceπ =ho1, . . . ,oni of operators that are consecutively applicable in s, we write sJπKfor sJo1KJo2K. . .JonK.
Equivalence Transformations
Equivalence of Operators and Effects: Definition
Definition (Equivalent Effects)
Two effectse ande0 over state variables V areequivalent, writtene ≡e0, ifsJeK=sJe0Kfor all states s.
For consistency semantics, this includes the requirement thatsJeKis defined iffsJe0Kis.
Definition (Equivalent Operators)
Two operatorso ando0 over state variablesV are equivalent, writteno ≡o0, ifcost(o) =cost(o0) and for all statess,s0 overV, o induces the transitions −→o s0 iff o0 induces the transition s o
0
−→s0.
Equivalence of Operators and Effects: Theorem
Theorem
Let o and o0 be operators with pre(o)≡pre(o0), eff(o)≡eff(o0) and cost(o) =cost(o0). Then o≡o0.
Note: The converse is not true. (Why not?)
Equivalence Transformations for Effects
e1∧e2 ≡ e2∧e1 (1)
(e1∧ · · · ∧en)∧(e10 ∧ · · · ∧em0) ≡ e1∧ · · · ∧en∧e10 ∧ · · · ∧em0 (2)
> ∧e ≡ e (3)
χBe ≡ χ0 Be ifχ≡χ0 (4)
>Be ≡ e (5)
⊥Be ≡ > (6)
χ1B(χ2Be) ≡ (χ1∧χ2)Be (7) χB(e1∧ · · · ∧en) ≡ (χBe1)∧ · · · ∧(χBen) (8) (χ1Be)∧(χ2Be) ≡ (χ1∨χ2)Be (9)
Conflict-Free Operators
Conflict-Freeness: Motivation
The add-after-delete semantics makes effects like (aBc)∧(bB¬c) somewhat unintuitive to interpret.
What happens in states where a∧b is true?
Similarly, it may be unintuitive that an effect like (u= aBw:= a)∧(v= bBw:= b)
introduces an applicability condition “through the back door”
It would be nicer if
effcond(e,e0) always were the condition
under which the atomic effecteactually materializes (because of add-after-delete, it is not)
pre(o) always fully described the applicability ofo (because of the consistency condition, is does not)
introduce normal form where “complicated cases” never arise
Reminder & Motivation Equivalence Transformations Conflict-Free Operators Flat Effects Summary
Conflict-Free Effects and Operators
Definition (Conflict-Free)
Aneffect e overpropositional state variablesV is calledconflict-free ifeffcond(v,e)∧effcond(¬v,e) is unsatisfiable for allv ∈V.
Aneffect e overfinite-domainstate variablesV
is calledconflict-free ifeffcond(v :=d,e)∧effcond(v :=d0,e) is unsatisfiable for allv ∈V andd,d0 ∈dom(v) with d 6=d0. Anoperator o is calledconflict-free if eff(o) is conflict-free.
Note: This fixes both of our issues.
In particular, observe thatconsist(o)≡ > for conflict-freeo.
Making Operators Conflict-Free
In general, testing whether an operator is conflict-free is a coNP-complete problem. (Why?)
However, we do not necessarily need such a test.
Instead, we can producean equivalent conflict-free operator in polynomial time.
Algorithm: given operatoro,
replace all atomic effects¬v by (¬effcond(v,eff(o))B¬v) replace all atomic effectsv:=d by (consist(o)Bv:=d) replacepre(o) withpre(o)∧consist(o) in the FDR case The resulting operatoro0 is conflict-free and o ≡o0. (Why?)
Flat Effects
Flat Effects: Motivation
CNF and DNF limit the nesting of connectives in propositional logic.
For example, a CNF formula is
a conjunction of 0 or more subformulas,
each of which is a disjunction of 0 or more subformulas, each of which is a literal.
Similarly, we can define a normal form that limits the nesting of effects.
This is useful because we then do not have to consider arbitrarily structured effects, e.g., when representing them in a planning algorithm.
Flat Effect
Definition (Flat Effect) An effecte is flatif it is:
a conjunctive effect
whose conjuncts are conditional effects whose subeffects are atomic effects, and no atomic effect occurs ine multiple times.
An operatoro isflatif eff(o) is flat.
Note: non-conjunctive effects can be considered as conjunctive effects with 1 conjunct
Flat Effect: Example
Example
Consider the effect
c∧(aB(¬b∧(c B(b∧ ¬d∧ ¬a))))∧(¬bB¬a) An equivalent flat (and conflict-free) effect is
(>Bc)∧ ((a∧ ¬c)B¬b)∧
((a∧c)Bb)∧ ((a∧c)B¬d)∧ ((¬b∨(a∧c))B¬a)
Note: for simplicity, we often write(>Be)as e, i.e., omit trivial effect conditions. We still consider such effects to be flat.
Producing Flat Operators
Theorem
For every operator, an equivalent flat operator and an equivalent flat, conflict-free operator can be computed in polynomial time.
Producing Flat Operators: Proof
Proof Sketch.
LetE be the set of atomic effects over variables V. Every effecte0 over variables V is equivalent to V
e∈E(effcond(e,e0)Be), which is a flat effect.
(Conjuncts of the form (χBe) where χ≡ ⊥ can be omitted to simplify the effect.)
To compute a flat operator equivalent to operatoro, replaceeff(o) by an equivalent flat effect.
To compute an equivalent conflict-free and flat operator, first compute a conflict-free operatoro0 equivalent too, then replaceeff(o0) by an equivalent flat effect.
(Why not do these in the opposite order?)
Summary
Summary
Equivalences can be used to simplify operators and effects.
In conflict-free operators, the “complicated case”
of operator semantics does not arise.
For flatoperators, the only permitted nesting is atomic effects within conditional effects within
conjunctive effects, and all atomic effects must be distinct.
For flat, conflict-free operators, it is easy to determine thecondition under which a givenliteral is made true by applying the operator in a given state.
Every operator can be transformedinto an equivalent flat and conflict-freeone inpolynomial time.