planning as satisfiability
play

Planning as Satisfiability Enrico Giunchiglia Laboratory of Systems - PowerPoint PPT Presentation

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Planning as Satisfiability Enrico Giunchiglia Laboratory of Systems and Technologies for Automated Reasoning (STAR-Lab) DIBRIS


  1. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Single-state problem formulation A problem is defined by four items: initial state e.g., “at Arad” successor function S ( x ) = set of action–state pairs, e.g. S ( Arad ) = {� Arad → Zerind , Zerind � , . . . } goal test, can be explicit , e.g., x = “at Bucharest” implicit , e.g., NoDirt ( x ) path cost (additive) e.g., sum of distances, number of actions executed, etc. c ( x , a , y ) is the step cost, assumed to be ≥ 0 A solution is a “combination” of actions leading from the initial state to a goal state E. Giunchiglia Planning as Satisfiability

  2. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Selecting a state space Real world is too complex ⇒ state space must be abstracted for problem solving (Abstract) state = set of real states (Abstract) action = complex combination of real actions e.g., “Arad → Zerind” represents a complex set of possible routes, detours, rest stops, etc. For guaranteed realizability, any real state “in Arad” must get to some real state “in Zerind” (Abstract) solution = set of real paths that are solutions in the real world Each abstract action should be “easier” than the original problem! E. Giunchiglia Planning as Satisfiability

  3. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  4. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: vacuum world state space graph R L R L S S R R L R L R L L S S S S R L R L S S states? dirt and robot locations (ignore dirt amounts etc.) actions? Left , Right , Suck goal test? no dirt path cost? 1 per action E. Giunchiglia Planning as Satisfiability

  5. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: vacuum world state space graph R L R L S S R R L R L R L L S S S S R L R L S S states? dirt and robot locations (ignore dirt amounts etc.) actions? Left , Right , Suck goal test? no dirt path cost? 1 per action E. Giunchiglia Planning as Satisfiability

  6. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: vacuum world state space graph R L R L S S R R L R L R L L S S S S R L R L S S states? dirt and robot locations (ignore dirt amounts etc.) actions? Left , Right , Suck goal test? no dirt path cost? 1 per action E. Giunchiglia Planning as Satisfiability

  7. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: vacuum world state space graph R L R L S S R R L R L R L L S S S S R L R L S S states? dirt and robot locations (ignore dirt amounts etc.) actions? Left , Right , Suck goal test? no dirt path cost? 1 per action E. Giunchiglia Planning as Satisfiability

  8. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: vacuum world state space graph R L R L S S R R L R L R L L S S S S R L R L S S states? dirt and robot locations (ignore dirt amounts etc.) actions? Left , Right , Suck goal test? no dirt path cost? 1 per action E. Giunchiglia Planning as Satisfiability

  9. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: The 8-puzzle 5 7 2 4 1 2 3 5 6 4 5 6 8 3 1 7 8 Start State Goal State states? integer locations of tiles (ignore intermediate positions) actions? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move [Note: optimal solution of n -Puzzle family is NP-hard] E. Giunchiglia Planning as Satisfiability

  10. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: The 8-puzzle 5 7 2 4 1 2 3 5 6 4 5 6 8 3 1 7 8 Start State Goal State states? integer locations of tiles (ignore intermediate positions) actions? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move [Note: optimal solution of n -Puzzle family is NP-hard] E. Giunchiglia Planning as Satisfiability

  11. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: The 8-puzzle 5 7 2 4 1 2 3 5 6 4 5 6 8 3 1 7 8 Start State Goal State states? integer locations of tiles (ignore intermediate positions) actions? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move [Note: optimal solution of n -Puzzle family is NP-hard] E. Giunchiglia Planning as Satisfiability

  12. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: The 8-puzzle 5 7 2 4 1 2 3 5 6 4 5 6 8 3 1 7 8 Start State Goal State states? integer locations of tiles (ignore intermediate positions) actions? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move [Note: optimal solution of n -Puzzle family is NP-hard] E. Giunchiglia Planning as Satisfiability

  13. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: The 8-puzzle 5 7 2 4 1 2 3 5 6 4 5 6 8 3 1 7 8 Start State Goal State states? integer locations of tiles (ignore intermediate positions) actions? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move [Note: optimal solution of n -Puzzle family is NP-hard] E. Giunchiglia Planning as Satisfiability

  14. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: robotic assembly P R R R R R states? real-valued coordinates of robot joint angles and of the parts of the object to be assembled actions? continuous motions of robot joints goal test? complete assembly path cost? time to execute E. Giunchiglia Planning as Satisfiability

  15. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: robotic assembly P R R R R R states? real-valued coordinates of robot joint angles and of the parts of the object to be assembled actions? continuous motions of robot joints goal test? complete assembly path cost? time to execute E. Giunchiglia Planning as Satisfiability

  16. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: robotic assembly P R R R R R states? real-valued coordinates of robot joint angles and of the parts of the object to be assembled actions? continuous motions of robot joints goal test? complete assembly path cost? time to execute E. Giunchiglia Planning as Satisfiability

  17. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: robotic assembly P R R R R R states? real-valued coordinates of robot joint angles and of the parts of the object to be assembled actions? continuous motions of robot joints goal test? complete assembly path cost? time to execute E. Giunchiglia Planning as Satisfiability

  18. Planning Classical Planning Problem types and problem formulation Satisfiability of Boolean formulas (SAT) and Planning Example Problems QBFs satisfiability and Planning Example: robotic assembly P R R R R R states? real-valued coordinates of robot joint angles and of the parts of the object to be assembled actions? continuous motions of robot joints goal test? complete assembly path cost? time to execute E. Giunchiglia Planning as Satisfiability

  19. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  20. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Classical Planning A planning problem consists of: a description of an initial state , a description of a set of actions , and a description of a set of goal states . A solution to a planning problem is a sequence of actions that, when executed in the initial state, will lead to a goal state. E. Giunchiglia Planning as Satisfiability

  21. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Assumptions We make the following simplifying assumptions: Atomic Time: execution of an action is uninterruptible. Executing an action takes a time step. Deterministic Effects: the effect of executing any action is a function of the action and the state of the world when the action is executed. The result of executing an action in a state is a uniquely determined state. Omniscience: complete knowledge of the initial states as well as of the behaviour of the actions. There is only one initial state and we know how to compute the state resulting from the execution of an action. Sole Cause of Change: the actions are the sole cause of change. No exogenous events and no exogenous fluents. E. Giunchiglia Planning as Satisfiability

  22. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Assumptions We make the following simplifying assumptions: Atomic Time: execution of an action is uninterruptible. Executing an action takes a time step. Deterministic Effects: the effect of executing any action is a function of the action and the state of the world when the action is executed. The result of executing an action in a state is a uniquely determined state. Omniscience: complete knowledge of the initial states as well as of the behaviour of the actions. There is only one initial state and we know how to compute the state resulting from the execution of an action. Sole Cause of Change: the actions are the sole cause of change. No exogenous events and no exogenous fluents. E. Giunchiglia Planning as Satisfiability

  23. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Assumptions We make the following simplifying assumptions: Atomic Time: execution of an action is uninterruptible. Executing an action takes a time step. Deterministic Effects: the effect of executing any action is a function of the action and the state of the world when the action is executed. The result of executing an action in a state is a uniquely determined state. Omniscience: complete knowledge of the initial states as well as of the behaviour of the actions. There is only one initial state and we know how to compute the state resulting from the execution of an action. Sole Cause of Change: the actions are the sole cause of change. No exogenous events and no exogenous fluents. E. Giunchiglia Planning as Satisfiability

  24. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Assumptions We make the following simplifying assumptions: Atomic Time: execution of an action is uninterruptible. Executing an action takes a time step. Deterministic Effects: the effect of executing any action is a function of the action and the state of the world when the action is executed. The result of executing an action in a state is a uniquely determined state. Omniscience: complete knowledge of the initial states as well as of the behaviour of the actions. There is only one initial state and we know how to compute the state resulting from the execution of an action. Sole Cause of Change: the actions are the sole cause of change. No exogenous events and no exogenous fluents. E. Giunchiglia Planning as Satisfiability

  25. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Language I The S TRIPS language lends itself to efficient algorithms. States are represented by conjunctions (a set) of function-free ground positive atoms. At ( Home ) ∧ Have ( Milk ) ∧ Have ( Bananas ) ∧ Have ( Drill ) All atoms that are not mentioned in a state are assumed false ( closed-world assumption ). Goals are partially specified states, i.e. conjunctions (a set) of function-free ground positive atoms, e.g. At ( SM ) ∧ Sells ( SM , Milk ) We say that a state S satisfies a goal G iff S | = G ( G ⊆ S ). E. Giunchiglia Planning as Satisfiability

  26. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Language II Operators are actions descriptions Action: e.g. Buy ( p , x ) Precondition: conjunction of function-free positive literals saying what must be true for the operator to be applicable, e.g. At ( p ) , Sells ( p , x ) Effect: conjunction of function-free literals describing how the state changes when the operator is applied, e.g. Have ( x ) It is standard to divide the effects in two lists: the Add List , being the atoms which are the effects of the 1 action (the positive effects) the Delete List , being the atoms whose negation is an 2 effect of the action (the negative effects) E. Giunchiglia Planning as Satisfiability

  27. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Example I At(store), Sells(store,item) At(x) Buy(item,store) Go(x,y) At(y), not At(x) Have(item) E. Giunchiglia Planning as Satisfiability

  28. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Semantics of STRIPS Given a state S represented as a set of ground atoms, a ground action A with precondition P , add list (positive effects) E and delete list (negative effects) D , we say that action A is applicable in state S iff P ⊆ S , and if the action is applicable in S , the result of applying A in S is the state S \ D ∪ E . STRIPS defines a transition system whose states correspond to sets of state variables and there is a transition from S to S ′ labeled with action A according to STRIPS semantics. E. Giunchiglia Planning as Satisfiability

  29. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Semantics of STRIPS Given a state S represented as a set of ground atoms, a ground action A with precondition P , add list (positive effects) E and delete list (negative effects) D , we say that action A is applicable in state S iff P ⊆ S , and if the action is applicable in S , the result of applying A in S is the state S \ D ∪ E . STRIPS defines a transition system whose states correspond to sets of state variables and there is a transition from S to S ′ labeled with action A according to STRIPS semantics. E. Giunchiglia Planning as Satisfiability

  30. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Semantics - Example I At(store), Sells(store,item) At(x) Buy(item,store) Go(x,y) At(y), not At(x) Have(item) The result of Go ( Home , SM ) in the state { At ( Home ) } is the state { At ( SM ) } ; Go ( Home , SM ); Buy ( SM , Milk ) in the state { At ( Home ) , Sells ( SM , Milk ) } is the state { At ( SM ) , Sells ( SM , Milk ) , Have ( Milk ) } Go ( Home , SM ); Buy ( SM , Milk ) in the state { At ( Home ) } fails. E. Giunchiglia Planning as Satisfiability

  31. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Semantics - Example I At(store), Sells(store,item) At(x) Buy(item,store) Go(x,y) At(y), not At(x) Have(item) The sequence of actions Go ( Home , SM ); Buy ( SM , Milk ) is a plan for the goal { Have ( Milk ) } in the initial state { At ( Home ) , Sells ( SM , Milk ) } . E. Giunchiglia Planning as Satisfiability

  32. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Symbolic Encoding of Planning Problems Assume that for any set of variables X and integer i , X i is a copy of X obtained by substituting each x ∈ X with x i ∈ X i . For any pair of states S , S ′ and action A it is possible to encode a propositional formula tr i in the signature S i ∪ A i ∪ S ′ i + 1 such that S ′ is the result of executing A in S iff S i , A i , S ′ i + 1 | = tr i Encodings: We consider two encoding techniques: the first one based on the classical frame axioms the second one based on the explanatory frame axioms E. Giunchiglia Planning as Satisfiability

  33. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  34. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms I Universal Axioms: for each action α ∈ A s.t. op ( α, Pre , Add , Del ) ∈ Ops , α i → � { p i | p ∈ Pre } α i → � { p i + 1 | p ∈ Add } α i → � {¬ p i + 1 | p ∈ Del } Cardinality: O ( |A| r ) , where r is the maximal number of fluents mentioned in an operator (usually a small number). E. Giunchiglia Planning as Satisfiability

  35. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms II Classical Frame Axioms: for each action α ∈ A s.t. op ( α, Pre , Add , Del ) ∈ Ops , α i → � { p i + 1 ≡ p i | p �∈ Add ∪ Del } Cardinality: O ( |A||F| ) . At-least-one Axiom: � { α i | α ∈ A , op ( α, Pre , Add , Del ) ∈ Ops } Cardinality: O ( 1 ) . E. Giunchiglia Planning as Satisfiability

  36. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Example Drive(SL,GE): Pre: At(SL) Add: At(GE) Del: At(SL) Fly(GE,MI): Pre: At(GE) Add: At(MI) Del: At(GE) Drive(GE,MI): Pre: At(GE) Add: At(MI) Del: At(GE) E. Giunchiglia Planning as Satisfiability

  37. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding STRIPS For each action, If we drive from Sestri to Genova, we must be in Sestri at 1 the starting state, i.e., Drive i ( SL , GE ) ⊃ At i ( SL ) If we drive from Sestri to Genova, we end up in Genova 2 and we are no longer in Sestri, i.e., Drive i ( SL , GE ) ⊃ ¬ At i + 1 ( SL ) ∧ At i + 1 ( GE ) If we drive from Sestri to Genova, all the state variables not 3 in the effects do not change their value, i.e., Drive i ( SL , GE ) ⊃ ( At i + 1 ( MI ) ≡ At i ( MI )) In every state we have to execute one action: 4 ( Drive i ( SL , GE ) ∨ Drive i ( GE , MI ) ∨ Fly i ( GE , MI )) E. Giunchiglia Planning as Satisfiability

  38. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  39. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding based on the Explanatory Frame Axioms I Universal Axioms: for each action α ∈ A s.t. op ( α, Pre , Add , Del ) ∈ Ops , α i → � { p i | p ∈ Pre } α i → � { p i + 1 | p ∈ Add } α i → � {¬ p i + 1 | p ∈ Del } Cardinality: O ( |A| r ) , where r is the maximal number of fluents mentioned in an operator (usually a small number). E. Giunchiglia Planning as Satisfiability

  40. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding based on the Explanatory Frame Axioms II Explanatory Frame Axioms: for all fluents f ∈ F , ( f i ∧ ¬ f i + 1 ) → � { α i | α ∈ A , op ( α, Pre , Add , Del ) ∈ Ops , f ∈ Del } ( ¬ f i ∧ f i + 1 ) → � { α i | α ∈ A , op ( α, Pre , Add , Del ) ∈ Ops , f ∈ Add } Cardinality: O ( |F| ) . Note: These axioms allow for more than one action to be set to true in the starting state. This is ok as long as the actions can be linearized, e.g., are not interacting. For instance, it is possible for X and Y to fly from Genova to any other location provided X � = Y . E. Giunchiglia Planning as Satisfiability

  41. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding based on the Explanatory Frame Axioms III Conflict Exclusion Axioms (CEA) or mutex: ¬ ( α i ∧ α ′ i ) for all α, α ′ ∈ A s.t. α � = α ′ , op ( α, Pre , Add , Del ) ∈ Ops , op ( α ′ , Pre ′ , Add ′ , Del ′ ) ∈ Ops , and Pre ∩ Del ′ � = { } or Pre ′ ∩ Del � = { } . Cardinality: O ( |A| 2 ) E. Giunchiglia Planning as Satisfiability

  42. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning STRIPS Example Drive(SL,GE): Pre: At(SL) Add: At(GE) Del: At(SL) Fly(GE,MI): Pre: At(GE) Add: At(MI) Del: At(GE) Drive(GE,MI): Pre: At(GE) Add: At(MI) Del: At(GE) E. Giunchiglia Planning as Satisfiability

  43. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding STRIPS descriptions in SAT Let i be an integer. If an action is executed at time i , its preconditions are 1 satisfied, e.g., Drive i ( SL , GE ) ⊃ At i ( SL ) If an action is executed at time i , its effects hold at time 2 i + 1, e.g., Drive i ( SL , GE ) ⊃ ¬ At i + 1 ( SL ) ∧ At i + 1 ( GE ) Changes occur only because of action, e.g., 3 At i + 1 ( SL ) ∧ ¬ At i ( SL ) ⊃ Drive i ( GE , SL ) ∨ Drive i ( MI , SL ) It is not possible to execute two conflicting actions at the 4 same time, e.g., ¬ ( Fly i ( GE , MI ) ∧ Drive i ( GE , MI )) E. Giunchiglia Planning as Satisfiability

  44. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding Classical Planning descriptions in SAT Considering STRIPS descriptions various other encodings 1 have been proposed (Graphplan based, based on process semantics, with operator splitting, ... ) and various optimizations have been proposed to the explanatory based encoding: adding fluent mutexes, e.g., “it is not possible to be in Milan 1 and Genoa at the same time”, by inductive reasoning starting from the initial state, allowing for more actions to be executed at the same step: 2 an action is executable in a state S if either its preconditions are true in S or are “supported” by some other action which is executable in S , e.g., “it is possible to drive from Sestri to Genoa and from Genoa to Milan in the same step”. E. Giunchiglia Planning as Satisfiability

  45. Planning Classical Planning Encoding based on the Classical Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning Encoding based on the Explanatory Frame Axioms QBFs satisfiability and Planning Encoding Classical Planning descriptions in SAT There are far more expressive languages for modeling 1 planning domains and, as long as there are no metric resources, in most cases these languages come with an encoding into SAT. Such languages allow for, e.g., conditional effects, qualification and ramification constraints, parallel execution of actions, functional state variables, . . . These languages allow for easier modeling of problems in 2 various domains (e.g., security, formal verification) E. Giunchiglia Planning as Satisfiability

  46. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  47. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  48. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Mechanizing SAT (I) Conjunctive Normal Form Formulas having the form � m � h i j = 1 l ij where: i = 1 the formula is a conjunction (set of) clauses each clause is a disjunctions (set of) literals each literal l ij is a variable or the negation thereof Translation to CNF Every formula α : can be translated (in many ways) into a CNF α ′ , in time linear in the size of α , and preserving satisfiability, i.e., α is satisfiable iff α ′ is satisfiable E. Giunchiglia Planning as Satisfiability

  49. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Mechanizing SAT (II) { s ( s ∨ c ) ∧ { s , c } , � �� � ( ¬ s ∨ ¬ c ) ∧ s 1 = ( ( x 1 ⊕ x 3 ) ⊕ { s , c }∧ ( ¬ s ∨ x 1 ∨ x 3 ) ∧ ( x 2 ∧ x 4 ) ) { s , x 1 , x 3 } , � �� � ( ¬ s ∨ ¬ x 1 ∨ ¬ x 3 ) ∧ { s , x 1 , x 3 } , c ( s ∨ ¬ x 1 ∨ x 3 ) ∧ { s , x 1 , x 3 } , ( s ∨ x 1 ∨ ¬ x 3 ) ∧ { s , x 1 , x 3 } , ( c ∨ ¬ x 2 ∨ ¬ x 4 ) ∧ { c , x 2 , x 4 } , ( ¬ c ∨ x 2 ) ∧ { c , x 2 } , ( ¬ c ∨ x 4 ) { c , x 4 } } { l } is a unit clause E. Giunchiglia Planning as Satisfiability

  50. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning The Satisfiability Problem Problem SAT Given a set of clauses ϕ , is ϕ satisfiable? The complexity of SAT Prototypical NP-complete problem n variables imply 2 n possible interpretations from which a satisfying one has to be guessed A SAT solver is a program that tries to find satisfying interpretations automatically E. Giunchiglia Planning as Satisfiability

  51. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Search algorithm Key technologies in today’s implementations: DLL( ϕ , S ) 1 if all clauses are satisfied (Lazy) data structures for efficient 1 then return S unit clause detection 2 if a clause is violated then return FALSE Dynamic heuristics either based on 2 3 if { l } is a unit clause in ϕ learning or on unit-propagation then return DLL( ϕ l , S ∪ { l } ) 4 l := a literal in ϕ ; (UIP-based) Learning for 3 return DLL( ϕ l , S ∪ { l } ) or backjumping over irrelevant nodes DLL( ϕ l , S ∪ { l } ) and avoid repeating the same mistakes in different parts of the [Davis, Logemann, Loveland search tree 1962] minisat has less than 1Kloc E. Giunchiglia Planning as Satisfiability

  52. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Search algorithm Key technologies in today’s implementations: DLL( ϕ , S ) 1 if all clauses are satisfied (Lazy) data structures for efficient 1 then return S unit clause detection 2 if a clause is violated then return FALSE Dynamic heuristics either based on 2 3 if { l } is a unit clause in ϕ learning or on unit-propagation then return DLL( ϕ l , S ∪ { l } ) 4 l := a literal in ϕ ; (UIP-based) Learning for 3 return DLL( ϕ l , S ∪ { l } ) or backjumping over irrelevant nodes DLL( ϕ l , S ∪ { l } ) and avoid repeating the same mistakes in different parts of the [Davis, Logemann, Loveland search tree 1962] minisat has less than 1Kloc E. Giunchiglia Planning as Satisfiability

  53. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning (Some of) The reasons of a success Applications Planning Formal Property and Circuit Equivalence Verification Generation of sudoku puzzles, . . . Efficient procedures over the years Böhm, POSIT ( ≈ 1992) First solvers with focus on efficiency Tableau, SATZ ( ≈ 1993) First solvers used in applications Grasp, RelSAT, SATO ( ≈ 1996) Application-oriented solvers mChaff, zChaff ( ≈ 2001) Boosted the applicability of SAT minisat ( ≈ 2003) SAT solver implementation “made easy” glucose 2.0 ( ≈ 2011) Built on top of minisat 2.2 with ... E. Giunchiglia Planning as Satisfiability

  54. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning 2011 Competition results, real world category Results of the SAT competition/race winners on the SAT 2009 application benchmarks, 20mn timeout 1200 Limmat (2002) Zchaff (2002) Berkmin (2002) Forklift (2003) Siege (2003) 1000 Zchaff (2004) SatELite (2005) Minisat 2 (2006) Picosat (2007) Rsat (2007) Minisat 2.1 (2008) 800 Precosat (2009) Glucose (2009) CPU Time (in seconds) Clasp (2009) Cryptominisat (2010) Lingeling (2010) Minisat 2.2 (2010) 600 Glucose 2 (2011) Glueminisat (2011) Contrasat (2011) Lingeling 587f (2011) 400 200 0 0 20 40 60 80 100 120 140 160 180 200 Number of problems solved E. Giunchiglia Planning as Satisfiability

  55. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  56. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Planning as Satisfiability Assumptions � I , tr i , G � is a deterministic planning problem: 1 there is only one state satisfying I 1 for each state s and complex action a there is at most one 2 state s ′ satisfying tr Planning problem (of length n ) A planning problem (of length n ) is the Boolean formula I 0 ∧ ∧ n i = 1 tr i ∧ G n Plan (of length n ) Given a planning problem ϕ of length n , a plan (of length n ) is an assignment satisfying ϕ . E. Giunchiglia Planning as Satisfiability

  57. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Planning as Satisfiability Given, I 0 ∧ ∧ n i = 1 tr i ∧ G n its size is polynomial in n and tr i , 1 . . . but n can be exponential in | X | , 1 ⇒ is important to use “enhanced explanatory frame 2 axioms” The existence of a plan can be proved by trying different n 2 (usually using an incremental strategy) . . . but what if a plan does not exist? 1 E. Giunchiglia Planning as Satisfiability

  58. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Strategies for finding n sequential: Solve SAT problems sequentially one at a time 1 for horizon lengths 1, 2, 3, 4, ... until a plan is found. algorithm A: Start k solvers simultaneously, solving the 2 planning problem for horizon lengths 1,2,3,4,..., k . Call them SAT 1 , . . . , SAT k . If SAT m returns a plan we terminate. If SAT m returns UNSAT, kill the solvers SAT j with j < m and start m new solvers so that there are always k SAT instances being solved. algorithm B: Start k solvers SAT 1 , . . . , SAT k as for algo A. 3 SAT m gets an amount of CPU proportional to γ m , with 0 < γ < 1. algorithm C: Solve horizon lengths 1,2,4,8,16,... in parallel, 4 up to some finite length, with the same amount of CPU assigned to each horizon length. E. Giunchiglia Planning as Satisfiability

  59. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning ... but what is n ? ... or, what are we looking for? just a plan, or 1 an optimal parallel plan, 2 an optimal sequential plan, 3 ... 4 E. Giunchiglia Planning as Satisfiability

  60. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Experimental analysis (from Rintanen’s web page) E. Giunchiglia Planning as Satisfiability

  61. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Outline Planning 1 Problem types and problem formulation Example Problems Classical Planning 2 Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms Satisfiability of Boolean formulas (SAT) and Planning 3 Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints QBFs satisfiability and Planning 4 Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs E. Giunchiglia Planning as Satisfiability

  62. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Planning with hard Constraints Assumptions ϕ is a planning problem of length n 1 Example (State (Qualification) Constraints) It is not possible to be in two locations at the same time. Just add to ϕ : ∧ n i = 0 ¬ ( At i ( GE ) ∧ At i ( SL )) Example (Trajectory Constraints on Action Variables) I do want to drive after flying. Just add to ϕ : ∧ n − 1 i = 0 ¬ ( Fly i ( MI , GE ) ∧ Drive i + 1 ( GE , SL )) [Kautz, Selman 1996], [Biere, et al. 1999], [Latvala, et al. 2004] E. Giunchiglia Planning as Satisfiability

  63. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Planning with hard Constraints Assumptions ϕ is a planning problem of length n 1 Example (State (Qualification) Constraints) It is not possible to be in two locations at the same time. Just add to ϕ : ∧ n i = 0 ¬ ( At i ( GE ) ∧ At i ( SL )) Example (Trajectory Constraints on Action Variables) I do want to drive after flying. Just add to ϕ : ∧ n − 1 i = 0 ¬ ( Fly i ( MI , GE ) ∧ Drive i + 1 ( GE , SL )) [Kautz, Selman 1996], [Biere, et al. 1999], [Latvala, et al. 2004] E. Giunchiglia Planning as Satisfiability

  64. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Planning with hard Constraints Assumptions ϕ is a planning problem of length n 1 Example (State (Qualification) Constraints) It is not possible to be in two locations at the same time. Just add to ϕ : ∧ n i = 0 ¬ ( At i ( GE ) ∧ At i ( SL )) Example (Trajectory Constraints on Action Variables) I do want to drive after flying. Just add to ϕ : ∧ n − 1 i = 0 ¬ ( Fly i ( MI , GE ) ∧ Drive i + 1 ( GE , SL )) [Kautz, Selman 1996], [Biere, et al. 1999], [Latvala, et al. 2004] E. Giunchiglia Planning as Satisfiability

  65. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Preferences Assumptions π is a planning problem of length n 1 A simple preference is like a constraints, except that it expresses a condition that I would like to satisfy Simple preferences can be easily formulates as Boolean Formulas, as it has been for constraints Formally, a simple preference is Boolean formula over F 0 ∪ A 0 ∪ F 1 ∪ A 1 ∪ . . . ∪ F n . E. Giunchiglia Planning as Satisfiability

  66. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Simple preferences between plans Example Assuming I am considering a planning problem of length 2, the preference that I have to be in Genova at some point can be expressed: At 0 ( GE ) ∨ At 1 ( GE ) ∨ At 2 ( GE ) If π 1 and π 2 are two plans with the same length, π 1 is preferred to π 2 ( π 1 ≺ π 2 ) if π 1 satisfies more preferences than π 2 E. Giunchiglia Planning as Satisfiability

  67. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Interacting preferences Problem It may not be possible to satisfy all preferences together Example Considering the goal At 2 ( MI ) , I may have the preference to perform no action. However, I have to go from GE to MI either by car or by plain. Solutions Allow for specification that one preference is more important than another. Two approaches: Qualitative approaches 1 Quantitative approaches 2 E. Giunchiglia Planning as Satisfiability

  68. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Classical Planning with qualitative preferences (Complex) preference A (complex) preference is a set of preferences (formulas) together with a partial order. Example My preferences are {¬ Drive 1 ( GE , MI ) , ¬ Plain 1 ( GE , MI ) } with ¬ Plain 1 ( GE , MI ) ≺ ¬ Drive 1 ( GE , MI ) . E. Giunchiglia Planning as Satisfiability

  69. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Optimal plan with preferences Assumptions � P , ≺� is a preference for a given planning problem 1 A plan π 1 is preferred to a plan π 2 iff they satisfy different sets of preferences, and 1 for each preference p 2 satisfied by π 2 and not by π 1 there 2 is another preference p 1 satisfied by π 1 and not by π 2 with p 1 ≺ p 2 A plan (for the given problem) is optimal if it is a minimal element of the partial order Example Given the only preference ¬ Plain 1 ( GE , MI ) ≺ ¬ Drive 1 ( GE , MI ) , the plan with Drive 0 ( SL , GE ) , Drive 1 ( GE , MI ) is preferred to the plan Drive 0 ( SL , GE ) , Plain 1 ( GE , MI ) . E. Giunchiglia Planning as Satisfiability

  70. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Planning with soft Constraints: Optimal Planning Assumptions P is the set of plans (of any length) for a planning problem, 1 ≺ is a partial order over P : π 1 ≺ π 2 means π 1 is preferred 2 to π 2 . Optimal plans A plan p is optimal if it is a minimal element of the partial order, i.e., if � ∃ p ′ ∈ P : p ′ ≺ p . Example minimality in the number of time steps (makespan) minimality in the set of actions (irredundancy) minimality in the number of actions (sequential length) E. Giunchiglia Planning as Satisfiability

  71. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Generating optimal plans OPT-SATPLAN( ϕ , P , ≺ ) 1 return OPT-DLL( ϕ ∧ ψ , { } , P ′ , ≺ ′ ) ϕ is a planning problem OPT-DLL( ϕ , S , P ′ , ≺ ′ ) 1 2 if all clauses are satisfied P , ≺ is a preference 2 then return S 3 if a clause is violated ψ = ∧ p ∈ P v ( p ) ≡ p 3 then return FALSE P ′ is the set of the variables v ( p ) 4 if { l } is a unit clause in ϕ 4 then return OPT-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) v ( p 1 ) ≺ ′ v ( p 2 ) iff p 1 ≺ p 2 5 l := a minimal unassigned variable in P ′ , ≺ ′ if ∃ ; 5 and a literal in ϕ otherwise return OPT-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) or OP-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) Facts: [Giunchiglia & Maratea 2006] OPT-SATPLAN returns an optimal plan of length n 1 P , ≺ may cause an exponential CPU degradation 2 E. Giunchiglia Planning as Satisfiability

  72. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Generating optimal plans OPT-SATPLAN( ϕ , P , ≺ ) 1 return OPT-DLL( ϕ ∧ ψ , { } , P ′ , ≺ ′ ) ϕ is a planning problem OPT-DLL( ϕ , S , P ′ , ≺ ′ ) 1 2 if all clauses are satisfied P , ≺ is a preference 2 then return S 3 if a clause is violated ψ = ∧ p ∈ P v ( p ) ≡ p 3 then return FALSE P ′ is the set of the variables v ( p ) 4 if { l } is a unit clause in ϕ 4 then return OPT-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) v ( p 1 ) ≺ ′ v ( p 2 ) iff p 1 ≺ p 2 5 l := a minimal unassigned variable in P ′ , ≺ ′ if ∃ ; 5 and a literal in ϕ otherwise return OPT-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) or OP-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) Facts: [Giunchiglia & Maratea 2006] OPT-SATPLAN returns an optimal plan of length n 1 P , ≺ may cause an exponential CPU degradation 2 E. Giunchiglia Planning as Satisfiability

  73. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Example: Going to Milan from Sestri Assume ¬ Plain 1 ( GE , MI ) ≺ ¬ Drive 1 ( GE , MI ) . The branches explored by OPT-DLL are in the following order: ¬ Plain 1 ( GE , MI ) , ¬ Drive 1 ( GE , MI ) : if no plan is found 1 extending this branch, then OPT-DLL backtracks and (possibly) explores a branch with ¬ Plain 1 ( GE , MI ) , Drive 1 ( GE , MI ) : if no plan is found 2 extending this branch, then OPT-DLL backtracks and (possibly) explores a branch with Plain 1 ( GE , MI ) , ¬ Drive 1 ( GE , MI ) : if no plan is found 3 extending this branch, then OPT-DLL backtracks and (possibly) explores a branch with Plain 1 ( GE , MI ) , Drive 1 ( GE , MI ) : if no plan is found 4 extending this branch, then OPT-DLL returns FALSE. E. Giunchiglia Planning as Satisfiability

  74. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Issues Issue: What is the performance degradation that we get if we 1 have preferences? Is the degradation related to the number of preferences? 2 Done: We implemented OPT-DLL on top of minisat. SATPLAN04 1 uses siege. We considered problems with simple preferences among 2 goals and irredundant plans E. Giunchiglia Planning as Satisfiability

  75. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Example: Simple preferences among goals Assumptions � I , tr , G � is a planning problem 1 S is a set of soft goals. 2 Example: Simple preference among goals consider 1 I 0 ∧ ∧ n i = 1 tr i ∧ G n ∧ g ∈ S ( v n ( g ) ≡ g n ) together with the simple preference { v n ( g ) : g ∈ S } . E. Giunchiglia Planning as Satisfiability

  76. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Simple preferences among goals: # of unsatisfied goals E. Giunchiglia Planning as Satisfiability

  77. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Simple preference among goals: CPU times E. Giunchiglia Planning as Satisfiability

  78. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Example: irredundant plans Assumptions � I , tr , G � is a planning problem 1 Example: irredundant plans Consider 1 I 0 ∧ ∧ n i = 1 tr i ∧ G n together with the simple preference {¬ a i : a is an action } . E. Giunchiglia Planning as Satisfiability

  79. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Irredundant plans: #actions E. Giunchiglia Planning as Satisfiability

  80. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Irredundant plans: CPU times E. Giunchiglia Planning as Satisfiability

  81. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Example: Makespan optimality: SATPLAN Assumptions � I , tr , G � is a planning problem 1 Example: Makespan optimality: SATPLAN generate 1 I 0 ∧ ∧ n i = 1 tr i ∧ G n for n = 0, and increment n till the formula becomes satisfiable 2 CONS: for each n , computation of previous SAT checks is lost (nogoods) E. Giunchiglia Planning as Satisfiability

  82. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Example: Makespan optimality: Alternative Makespan optimality: Alternative generate 1 I 0 ∧ ∧ n i = 1 tr i ∧ ∧ n i = k ( p i ≡ G i ) for k = 0 and any arbitrarily fixed n together with p k ≺ p k + 1 ≺ . . . ≺ p n , and fix k = n and n to another bigger value till the formula 2 becomes satisfiable CONS: each SAT check is more expensive PROS: fewer SAT checks are considered PROS: inside each check, the computation that the goal is not reachable at step k ≤ j ≤ n is reused. E. Giunchiglia Planning as Satisfiability

  83. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Classical Planning with quantitative preferences (Complex) preference A (complex) preference is a set of preferences (formulas) together with a penalty associated to each preference. Example My preferences are ¬ Drive 1 ( GE , MI ) and ¬ Plain 1 ( GE , MI ) } with penalties 1 and 2 resp. E. Giunchiglia Planning as Satisfiability

  84. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Optimal plan with preferences Assumptions � P , f � is a preference for a given planning problem 1 A plan π 1 is preferred to a plan π 2 iff � � f ( p ) ≤ f ( p ) p ∈ P : π 1 �| = p p ∈ P : π 2 �| = p A plan (for the given problem) is optimal if it has a minimal associated penalty E. Giunchiglia Planning as Satisfiability

  85. Planning Satisfiability of Boolean formulas (SAT) Classical Planning Planning as satisfiability Satisfiability of Boolean formulas (SAT) and Planning Handling hard and soft constraints QBFs satisfiability and Planning Generating optimal plans ϕ is a planning problem 1 OPT-SATPLAN( ϕ , P , f ) P , ≺ is a preference 1 return OPT-DLL( ϕ ∧ adder ( P , f ) , { } , P ′ , ≺ ′ ) 2 adder ( P , f ) is a Boolean formula 3 OPT-DLL( ϕ , S , P ′ , ≺ ′ ) 2 if all clauses are satisfied corresponding to the penalty then return S function 3 if a clause is violated then return FALSE b m , . . . , b 0 is the sequence of 4 4 if { l } is a unit clause in ϕ variables (bits) representing the then return OPT-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) 5 l := a minimal unassigned variable in P ′ , ≺ ′ if ∃ ; value of adder ( P , f ) and a literal in ϕ otherwise P ′ is the set {¬ b m , . . . , ¬ b 0 } return OPT-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) or 5 OP-DLL( ϕ l , S ∪ { l } , P ′ , ≺ ′ ) ¬ b m ≺ ′ ¬ b m − 1 ≺ ′ . . . ≺ ′ ¬ b 0 6 Fact [Giunchiglia & Maratea 2006] OPT-SATPLAN returns an optimal plan given the makespan n . E. Giunchiglia Planning as Satisfiability

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend