A7. Invariants, Mutexes and Task Reformulation
Malte Helmert and Thomas Keller
Universit¨at Basel
September 30, 2019
Invariants Mutexes Reformulation Summary
Content of this Course
Planning
Classical
Foundations Logic Heuristics Constraints
Probabilistic
Explicit MDPs Factored MDPs
Invariants
Invariants Mutexes Reformulation Summary
Invariants
When we as humans reason about planning tasks,
we implicitly make use of “obvious” properties of these tasks.
Example: we are never in two places at the same time We can represent such properties as formulasϕ that are true in all reachable states.
Example: ϕ=¬(at-uni∧at-home)
Such formulas are called invariants of the task.
Invariants: Definition
Definition (Invariant)
Aninvariant of a planning task Π with state variables V
is a formulaϕ overV with s |=ϕfor all reachable statess of Π.
Invariants Mutexes Reformulation Summary
Computing Invariants
How does anautomated planner come up with invariants?
Theoretically, testing if a formula ϕis an invariant is as hard as planning itself.
proof idea: a planning task is unsolvable iff the negation of its goal is an invariant
Still, many practical invariant synthesis algorithms exist.
To remain efficient (= polynomial-time), these algorithms only compute a subsetof all useful invariants.
sound, but notcomplete
Empirically, they tend to at least find the “obvious”
invariants of a planning task.
Invariant Synthesis Algorithms
Most algorithms for generating invariants are based on thegenerate-test-repairapproach:
Generate: Suggest some invariant candidates, e.g., by enumerating all possible formulas ϕof a certain size.
Test: Try to prove that ϕis indeed an invariant.
Usually done inductively:
1 Test thatinitial statesatisfiesϕ.
2 Test that ifϕis true in the current state, it remains true after applying a single operator.
Repair: If invariant test fails, replace candidateϕ
by a weakerformula, ideally exploitingwhy the proof failed.
Invariants Mutexes Reformulation Summary
Invariant Synthesis: References
We will not cover invariant synthesis algorithms in this course.
Literature on invariant synthesis:
DISCOPLAN (Gerevini & Schubert, 1998) TIM (Fox & Long, 1998)
Edelkamp & Helmert’s algorithm (1999) Bonet & Geffner’s algorithm (2001) Rintanen’s algorithm (2008)
Exploiting Invariants
Invariants have many uses in planning:
Regression search:
Prune subgoals that violate (are inconsistent with) invariants.
Planning as satisfiability:
Add invariantsto a SAT encoding of a planning task to get tighter constraints.
Proving unsolvability:
Ifϕis an invariant such that ϕ∧γ is unsatisfiable, the planning task with goalγ is unsolvable.
Finite-Domain Reformulation:
Derive amore compact FDR representation (equivalent, but with fewer states) from a given propositional planning task.
We now discuss the last point because it connects
to our discussion of propositional vs. FDR planning tasks.
Invariants Mutexes Reformulation Summary
Mutexes
Reminder: Blocks World (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
29 = 512 states
Invariants Mutexes Reformulation Summary
Reminder: Blocks World (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
Task Reformulation
Common modeling languages (like PDDL) often give us propositional tasks.
More compact FDR tasks are often desirable.
Can we do an automatic reformulation?
Invariants Mutexes Reformulation Summary
Mutexes
Invariants that take the form ofbinary clauses are called mutexes because they express that certain variable assignments
cannot be simultaneously true (aremutually exclusive).
Example (Blocks World)
The invariant¬A-on-B∨ ¬A-on-Cstates that A-on-Band A-on-Care mutex.
We say that aset of literalsis a mutex group if every subset of two literals is a mutex.
Example (Blocks World)
{A-on-B,A-on-C,A-on-table} is a mutex group.
Encoding Mutex Groups as Finite-Domain Variables
LetG ={`1, . . . , `n} be a mutex group over n different propositional state variablesVG ={v1, . . . ,vn}.
Then a singlefinite-domainstate variablevG with
dom(vG) ={`1, . . . , `n,none} can replace then variables VG: s(vG) =`i represents situations where (exactly)`i is true s(vG) = none represents situations where all `i are false Note: We can omit the “none” value if `1∨ · · · ∨`nis an invariant.
Invariants Mutexes Reformulation Summary
Mutex Covers
Definition (Mutex Cover)
Amutex coverfor a propositional planning task Π
is a set of mutex groups{G1, . . . ,Gn} where each variable of Π occurs in exactly one groupGi.
A mutex cover ispositive if all literals in all groups are positive.
Note: always exists (use trivial group{v} ifv otherwise uncovered)
Positive Mutex Covers
In the following, we stick topositive mutex covers for simplicity.
If we have¬v in G for some group G in the cover, we can reformulate the task to use an “opposite” variable ˆv instead, as in the conversion to positive normal form(Chapter A6).
Invariants Mutexes Reformulation Summary
Reformulation
Mutex-Based Reformulation of Propositional Tasks
Given aconflict-free propositional planning task Π with positive mutex cover{G1, . . . ,Gn}:
In all conditionswhere variable v ∈Gi occurs, replacev with vGi =v.
In all effects e where variablev ∈Gi occurs, Replace allatomic add effects v withvGi :=v Replace allatomic delete effects ¬v with (vGi =v∧ ¬W
v0∈Gi\{v}effcond(v0,e))BvGi := none This results in an FDR planning task Π0 that is equivalent to Π (without proof).
Note: the conditional effects can often be simplified away to an unconditional or empty effect.
Invariants Mutexes Reformulation Summary
And Back?
It can also be useful to reformulate an FDR task into a propositional task.
For example, we might want positive normal form, which requires a propositional task.
Key idea: each variable/value combinationv =d becomes a separate propositional state variable hv,di
Converting FDR Tasks into Propositional Tasks
Definition (Induced Propositional Planning Task)
Let Π =hV,I,O, γibe a conflict-free FDR planning task.
Theinduced propositional planning taskΠ0
is the propositional planning task Π0 =hV0,I0,O0, γ0i, where V0 ={hv,di |v ∈V,d ∈dom(v)}
I0(hv,di) =Tiff I(v) =d
O0 andγ0 are obtained from O andγ by
replacing each atomic formulav =d by the propositionhv,di replacing each atomic effectv :=d by the effect
hv,di ∧V
d0∈dom(v)\{d}¬hv,d0i.
Notes:
Again, simplifications are often possible to avoid introducing so many delete effects.
SAS+ tasks induce STRIPS tasks
Invariants Mutexes Reformulation Summary
Summary
Summary
Invariants are common properties of all reachable states, expressed as formulas.
Mutexes are invariants that express that certain literals are mutually exclusive.
Mutex coversprovide a way to express the information in a set of propositional state variables in a (potentially much smaller) set of finite-domain state variables.
Using mutex covers, we can reformulate propositional tasks as more compact FDR tasks.
Conversely, we can reformulate FDR tasksas propositional tasks by introducing propositions for each variable/value pair.