Title: Planning as Logic: Why logic?
1Planning 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!
2Translate/Solve/Decode Architecture
Planning problem
Compiler
Logic problem
Solver
Logical model
Decoder
Solution plan
3Filling in the Blanks
- What kind of logic?
- How do we encode/decode as logical formulae?
- What kind of solver?
4Planning 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
5Translating 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 n2
- Actions
- Instantiation of each action at each step with
all possible combinations of parameters - Enforce preconditions/effects
6Dinner 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))
7Dinner Date Logical Form
- Initial conditions
- (and (cleanHands0) (quiet0) (not (noGarbage0))
- (not (dinner0)) (not (present0)))
- Goal state
- (and (noGarbagen2) (dinnern2) (presentn2))
- Actions (for every odd i)
- (implies (cooki)
- (and
- preconditions
- (cleanHandsi-1)
- effects
- (dinneri1)))
Is this enough?
8Frame Axioms and Exclusions
- What about GraphPlans no-ops?
- Frame axioms
- An action only changes a predicate if it
explicitly includes that predicate in its effect
list or - If a variables 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
9Dinner Date Logical Form Continued
- For every odd time step i
- (implies
- (and (not noGarbagei-1) (noGarbagei1))
- (or (carryi) (dollyi)))
- For every odd time step i
- (or
- (not carryi)
- (not cooki))
10Dinner Date in CNF
- !STEP1NOGARBAGE STEP0ACTION-CARRY
STEP0ACTION-DOLLY - STEP1NOGARBAGE STEP1ACTION-CARRY
STEP1ACTION-DOLLY - !STEP1DINNER STEP0ACTION-COOK
- STEP1DINNER STEP1ACTION-COOK
- STEP0ACTION-CARRY STEP1CLEAN-HANDS
- STEP1CLEAN-HANDS !STEP2CLEAN-HANDS
- STEP1ACTION-CARRY !STEP1CLEAN-HANDS
STEP2CLEAN-HANDS - !STEP1PRESENT STEP0ACTION-WRAP
- STEP1PRESENT STEP1ACTION-WRAP
- STEP0ACTION-DOLLY STEP1QUIET
- STEP1QUIET !STEP2QUIET
- STEP1ACTION-DOLLY !STEP1QUIET STEP2QUIET
- STEP1NOGARBAGE !STEP0ACTION-CARRY
- !STEP0ACTION-CARRY !STEP1CLEAN-HANDS
- STEP1NOGARBAGE !STEP0ACTION-DOLLY
- !STEP0ACTION-DOLLY !STEP1QUIET
- STEP1DINNER !STEP0ACTION-COOK
- STEP1PRESENT !STEP0ACTION-WRAP
- !STEP1ACTION-CARRY !STEP2CLEAN-HANDS
After initial unit propagation 26 Clauses 23
Variables
11Satisfiability 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, ...
12DPLL 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
13Systematic SolverDPPL Algorithm
Procedure DPLL(f CNF problem) If f is satisfied,
return YES Else if f is inconsistent, return
NO Else if there is a unit clause ? or pure
literal ? in f, return DPLL(f?) Else choose a
variable ? in f. If DPLL(f?), return YES Else,
return DPLL(f??)
14DPLL Example
r
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
?