Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Planning as Logic: Why logic? zFlexible language yRange of expressive power/tractability yClear semantics and syntax zGood solution processes yMature.

Similar presentations


Presentation on theme: "1 Planning as Logic: Why logic? zFlexible language yRange of expressive power/tractability yClear semantics and syntax zGood solution processes yMature."— Presentation transcript:

1 1 Planning as Logic: Why logic? zFlexible language yRange of expressive power/tractability yClear semantics and syntax zGood solution processes yMature (older than computer science!) yGeneral purpose yFast!

2 2 Translate/Solve/Decode Architecture Compiler Solver Decoder Planning problem Logic problem Logical model Solution plan

3 3 Filling in the Blanks zWhat kind of logic? zHow do we encode/decode as logical formulae? zWhat kind of solver?

4 4 Planning as Boolean Satisfiability zWhat kind of logic? yPropositional logic yBoolean satisfiability zHow do we encode/decode as logical formulae? yInstantiate actions yCompile fixed length plan zWhat kind of solver? ySystematic: depth-first search/complete yStochastic: randomized/incomplete

5 5 Translating to Propositional Logic zPredicate ySingle positive literal for each instantiation of parameters at each time step zInitial state yConjunction of all true literals + CWA at step 0 zGoal state yConjunction of all goal literals at step n*2 zActions yInstantiation of each action at each step with all possible combinations of parameters yEnforce preconditions/effects

6 6 Dinner Date Initial Conditions: (:and (cleanHands) (quiet)) Goal: (:and (noGarbage) (dinner) (present)) Actions: (:operator carry :precondition :effect (:and (noGarbage) (:not (cleanHands))) (:operator dolly :precondition :effect (:and (noGarbage) (:not (quiet))) (:operator cook :precondition (cleanHands) :effect (dinner)) (:operator wrap :precondition (quiet) :effect (present))

7 7 Dinner Date: Logical Form zInitial conditions: (:and(cleanHands 0 ) (quiet 0 ) (:not (noGarbage 0 )) (:not (dinner 0 )) (:not (present 0 ))) zGoal state: (:and(noGarbage n*2 ) (dinner n*2 ) (present n*2 )) zActions (for every odd i): (:implies(cook i ) (:and ;; preconditions (cleanHands i-1 ) ;; effects (dinner i+1 )))

8 8 Frame Axioms and Exclusions zWhat about GraphPlan’s no-ops? yFrame axioms xAn action only changes a predicate if it explicitly includes that predicate in its effect list or xIf a variable’s truth value changes, some action must have caused that change zWhat about mutual exclusivity? ySerial exclusions: at most one action per time-step yParallel exclusions: if actions are exclusive, insert a clause which keeps them from occurring in parallel

9 9 Dinner Date: Logical Form Continued zFor every odd time step i: (:implies (:and (:not noGarbage i-1 ) (noGarbage i+1 )) (:or (carry i ) (dolly i ))) zFor every odd time step i: (:or (:not carry i ) (:not cook i ))

10 10 Dinner Date in CNF !STEP1~NOGARBAGE STEP0~ACTION-CARRY STEP0~ACTION-DOLLY STEP1~NOGARBAGE STEP1~ACTION-CARRY STEP1~ACTION-DOLLY !STEP1~DINNER STEP0~ACTION-COOK STEP1~DINNER STEP1~ACTION-COOK STEP0~ACTION-CARRY STEP1~CLEAN-HANDS STEP1~CLEAN-HANDS !STEP2~CLEAN-HANDS STEP1~ACTION-CARRY !STEP1~CLEAN-HANDS STEP2~CLEAN-HANDS !STEP1~PRESENT STEP0~ACTION-WRAP STEP1~PRESENT STEP1~ACTION-WRAP STEP0~ACTION-DOLLY STEP1~QUIET STEP1~QUIET !STEP2~QUIET STEP1~ACTION-DOLLY !STEP1~QUIET STEP2~QUIET STEP1~NOGARBAGE !STEP0~ACTION-CARRY !STEP0~ACTION-CARRY !STEP1~CLEAN-HANDS STEP1~NOGARBAGE !STEP0~ACTION-DOLLY !STEP0~ACTION-DOLLY !STEP1~QUIET STEP1~DINNER !STEP0~ACTION-COOK STEP1~PRESENT !STEP0~ACTION-WRAP !STEP1~ACTION-CARRY !STEP2~CLEAN-HANDS !STEP1~ACTION-DOLLY !STEP2~QUIET !STEP1~ACTION-COOK STEP1~CLEAN-HANDS !STEP1~ACTION-WRAP STEP1~QUIET !STEP0~ACTION-CARRY !STEP0~ACTION-COOK !STEP1~ACTION-CARRY !STEP1~ACTION-COOK !STEP0~ACTION-DOLLY !STEP0~ACTION-WRAP !STEP1~ACTION-DOLLY !STEP1~ACTION-WRAP After initial unit propagation 26 Clauses 23 Variables

11 11 Satisfiability Solvers zSystematic yComplete yDepth first search: never repeat states yGlobal ySystems: RelSAT, Tableau, LPSAT, … zStochastic yIncomplete ySimulated annealing to choose next state yLocal ySystems: WalkSat, GSat,...

12 12 DPLL Algorithm: Definitions satisfied = CNF statement is empty inconsistent = any clause in the CNF statement is empty unit clause = any clause with exactly one literal pure literal = any literal whose negation never appears in the CNF statement

13 13 Systematic Solver: DPPL Algorithm Procedure DPLL(φ: CNF problem) If φ is satisfied, return YES Else if φ is inconsistent, return NO Else if there is a unit clause {  } or pure literal  in φ, return DPLL(φ|  ) Else choose a variable in φ. If DPLL(φ| ), return YES Else, return DPLL(φ|  )

14 14 DPLL Example r p pure literal T {r,  s,  t} {p,  q} {q,  p} {s, t} {  s,  p} {  t,  p} {p,  q} {q,  p} {s, t} {  s,  p} {  t,  p} s T q F {q} {s, t} {  s} {  t} unit var F t T {q} {t} {  t}  {q} {} {  q} {s, t} unit var F s pure literal T T {s, t}


Download ppt "1 Planning as Logic: Why logic? zFlexible language yRange of expressive power/tractability yClear semantics and syntax zGood solution processes yMature."

Similar presentations


Ads by Google