1 / 14

Planning as Logic: Why logic?

Planning as Logic: Why logic?. Flexible language Range of expressive power/tractability Clear semantics and syntax Good solution processes Mature (older than computer science!) General purpose Fast!. Translate/Solve/Decode Architecture. Planning problem. Compiler. Logic problem. Solver.

fadey
Download Presentation

Planning as Logic: Why logic?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Planning as Logic: Why logic? • Flexible language • Range of expressive power/tractability • Clear semantics and syntax • Good solution processes • Mature (older than computer science!) • General purpose • Fast!

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

  3. Filling in the Blanks • What kind of logic? • How do we encode/decode as logical formulae? • What kind of solver?

  4. Planning as Boolean Satisfiability • What kind of logic? • Propositional logic • Boolean satisfiability • How do we encode/decode as logical formulae? • Instantiate actions • Compile fixed length plan • What kind of solver? • Systematic: depth-first search/complete • Stochastic: randomized/incomplete

  5. Translating to Propositional Logic • Predicate • Single positive literal for each instantiation of parameters at each time step • Initial state • Conjunction of all true literals + CWA at step 0 • Goal state • Conjunction of all goal literals at step n*2 • Actions • Instantiation of each action at each step with all possible combinations of parameters • Enforce preconditions/effects

  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. Dinner Date: Logical Form • Initial conditions: (:and (cleanHands0) (quiet0) (:not (noGarbage0)) (:not (dinner0)) (:not (present0))) • Goal state: (:and (noGarbagen*2) (dinnern*2) (presentn*2)) • Actions (for every odd i): (:implies (cooki) (:and ;; preconditions (cleanHandsi-1) ;; effects (dinneri+1))) Is this enough?

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

  9. Dinner Date: Logical Form Continued • For every odd time step i: (:implies (:and (:not noGarbagei-1) (noGarbagei+1)) (:or (carryi) (dollyi))) • For every odd time step i: (:or (:not carryi) (:not cooki))

  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. Satisfiability Solvers • Systematic • Complete • Depth first search: never repeat states • Global • Systems: RelSAT, Tableau, LPSAT, … • Stochastic • Incomplete • Simulated annealing to choose next state • Local • Systems: WalkSat, GSat, ...

  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. 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. F q F T F unit var pure literal unit var t s T r DPLL Example {r, s, t} {p, q} {q, p} {s, t} {s, p} {t, p} {p, q} {q, p} {s, t} {s, p} {t, p} T pure literal p T {q} {s, t} {s} {t} {q} {s, t} s {q} {t} {t} {s, t} T unit var {q} {} 

More Related