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

planning as satisfiability
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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 - Univ. Genova Thanks to: M. Cashmore, M. Fox, M. Maratea, M. Narizzano, A. Tacchella. . .

Third International SAT/SMT Summer School 2013 Espoo, Finland, July 3-5, 2013

  • E. Giunchiglia

Planning as Satisfiability

slide-2
SLIDE 2

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-3
SLIDE 3

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-4
SLIDE 4

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Problem-solving agents

Restricted form of general agent:

function SIMPLE-PROBLEM-SOLVING-AGENT( percept) returns an ac- tion static: seq, a set of (ordered) actions, initially empty state, some description of the current world state goal, a goal, initially null problem, a problem formulation state ← UPDATE-STATE(state,percept) if seq is empty then goal ← FORMULATE-GOAL(state,goal) problem ← FORMULATE-PROBLEM(state,goal,problem) seq ← SEARCH( problem) action ← RECOMMENDATION(seq, state) seq ← REMAINDER(seq, state) return action

Note: this is offline problem solving; solution executed “eyes closed.”

  • E. Giunchiglia

Planning as Satisfiability

slide-5
SLIDE 5

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: Romania

On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: be in Bucharest Formulate problem:

states: various cities actions: drive between cities

Find solution: sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest

  • E. Giunchiglia

Planning as Satisfiability

slide-6
SLIDE 6

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: Romania

Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86

  • E. Giunchiglia

Planning as Satisfiability

slide-7
SLIDE 7

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-8
SLIDE 8

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Problem Types

Deterministic, fully observable = ⇒ single-state problem Agent knows exactly which state it will be in; solution is a sequence Non-observable = ⇒ conformant problem Agent may have no idea where it is; solution (if any) is a sequence Partially/Fully observable = ⇒ contingency problem percepts provide new information about current state solution is a contingent plan or a policy

  • ften interleave search, execution

Unknown state space = ⇒ exploration problem (“online”)

  • E. Giunchiglia

Planning as Satisfiability

slide-9
SLIDE 9

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Single-state, start in #5. Solution? [Right, Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} e.g., Right goes to {2, 4, 6, 8}. Solution? [Right, Suck, Left, Suck] Contingency, start in #5 or #7 (Murphy’s Law: Suck can dirty a clean carpet) Local sensing: dirt, location only. Solution? [Right, if dirt then Suck]

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-10
SLIDE 10

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Single-state, start in #5. Solution? [Right, Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} e.g., Right goes to {2, 4, 6, 8}. Solution? [Right, Suck, Left, Suck] Contingency, start in #5 or #7 (Murphy’s Law: Suck can dirty a clean carpet) Local sensing: dirt, location only. Solution? [Right, if dirt then Suck]

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-11
SLIDE 11

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Single-state, start in #5. Solution? [Right, Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} e.g., Right goes to {2, 4, 6, 8}. Solution? [Right, Suck, Left, Suck] Contingency, start in #5 or #7 (Murphy’s Law: Suck can dirty a clean carpet) Local sensing: dirt, location only. Solution? [Right, if dirt then Suck]

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-12
SLIDE 12

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Single-state, start in #5. Solution? [Right, Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} e.g., Right goes to {2, 4, 6, 8}. Solution? [Right, Suck, Left, Suck] Contingency, start in #5 or #7 (Murphy’s Law: Suck can dirty a clean carpet) Local sensing: dirt, location only. Solution? [Right, if dirt then Suck]

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-13
SLIDE 13

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Contingency, start in #5 or #7 (real world: Suck can fail) Local sensing: dirt, location

  • nly.

Solution? assuming fairness [Right, while dirt do Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} (Murphy’s Law: Suck can dirty a clean carpet). Solution? no sequence of actions is guaranteed to achieve the goal

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-14
SLIDE 14

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Contingency, start in #5 or #7 (real world: Suck can fail) Local sensing: dirt, location

  • nly.

Solution? assuming fairness [Right, while dirt do Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} (Murphy’s Law: Suck can dirty a clean carpet). Solution? no sequence of actions is guaranteed to achieve the goal

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-15
SLIDE 15

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world (Goal: everything clean)

Contingency, start in #5 or #7 (real world: Suck can fail) Local sensing: dirt, location

  • nly.

Solution? assuming fairness [Right, while dirt do Suck] Conformant, start in {1, 2, 3, 4, 5, 6, 7, 8} (Murphy’s Law: Suck can dirty a clean carpet). Solution? no sequence of actions is guaranteed to achieve the goal

1 2 3 4 5 6 7 8

  • E. Giunchiglia

Planning as Satisfiability

slide-16
SLIDE 16

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

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

slide-17
SLIDE 17

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

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

slide-18
SLIDE 18

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-19
SLIDE 19

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world state space graph

R L S S S S R L R L R L S S S S L L L L R R R R

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

slide-20
SLIDE 20

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world state space graph

R L S S S S R L R L R L S S S S L L L L R R R R

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

slide-21
SLIDE 21

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world state space graph

R L S S S S R L R L R L S S S S L L L L R R R R

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

slide-22
SLIDE 22

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world state space graph

R L S S S S R L R L R L S S S S L L L L R R R R

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

slide-23
SLIDE 23

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: vacuum world state space graph

R L S S S S R L R L R L S S S S L L L L R R R R

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

slide-24
SLIDE 24

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: The 8-puzzle

2

Start State Goal State

5 1 3 4 6 7 8 5 1 2 3 4 6 7 8 5

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

slide-25
SLIDE 25

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: The 8-puzzle

2

Start State Goal State

5 1 3 4 6 7 8 5 1 2 3 4 6 7 8 5

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

slide-26
SLIDE 26

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: The 8-puzzle

2

Start State Goal State

5 1 3 4 6 7 8 5 1 2 3 4 6 7 8 5

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

slide-27
SLIDE 27

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: The 8-puzzle

2

Start State Goal State

5 1 3 4 6 7 8 5 1 2 3 4 6 7 8 5

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

slide-28
SLIDE 28

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: The 8-puzzle

2

Start State Goal State

5 1 3 4 6 7 8 5 1 2 3 4 6 7 8 5

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

slide-29
SLIDE 29

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: robotic assembly

R R R P 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

slide-30
SLIDE 30

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: robotic assembly

R R R P 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

slide-31
SLIDE 31

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: robotic assembly

R R R P 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

slide-32
SLIDE 32

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: robotic assembly

R R R P 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

slide-33
SLIDE 33

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Problem types and problem formulation Example Problems

Example: robotic assembly

R R R P 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

slide-34
SLIDE 34

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-35
SLIDE 35

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-36
SLIDE 36

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-37
SLIDE 37

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-38
SLIDE 38

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-39
SLIDE 39

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-40
SLIDE 40

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

STRIPS Language I

The STRIPS 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

slide-41
SLIDE 41

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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:

1

the Add List, being the atoms which are the effects of the action (the positive effects)

2

the Delete List, being the atoms whose negation is an effect of the action (the negative effects)

  • E. Giunchiglia

Planning as Satisfiability

slide-42
SLIDE 42

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

STRIPS Example I

Have(item) Go(x,y) At(y), not At(x) At(store), Sells(store,item) Buy(item,store) At(x)

  • E. Giunchiglia

Planning as Satisfiability

slide-43
SLIDE 43

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-44
SLIDE 44

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-45
SLIDE 45

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

STRIPS Semantics - Example I

Have(item) Go(x,y) At(y), not At(x) At(store), Sells(store,item) Buy(item,store) At(x)

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

slide-46
SLIDE 46

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

STRIPS Semantics - Example I

Have(item) Go(x,y) At(y), not At(x) At(store), Sells(store,item) Buy(item,store) At(x)

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

slide-47
SLIDE 47

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Symbolic Encoding of Planning Problems

Assume that for any set of variables X and integer i, Xi is a copy of X obtained by substituting each x ∈ X with xi ∈ Xi. For any pair of states S, S′ and action A it is possible to encode a propositional formula tri in the signature Si ∪ Ai ∪ S′

i+1 such

that S′ is the result of executing A in S iff Si, Ai, S′

i+1 |

= tri 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

slide-48
SLIDE 48

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-49
SLIDE 49

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding based on the Classical Frame Axioms I

Universal Axioms: for each action α ∈ A s.t.

  • p(α, Pre, Add, Del) ∈ Ops,

αi→{pi | p ∈ Pre} αi→{pi+1 | p ∈ Add} αi→{¬pi+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

slide-50
SLIDE 50

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding based on the Classical Frame Axioms II

Classical Frame Axioms: for each action α ∈ A s.t.

  • p(α, Pre, Add, Del) ∈ Ops,

αi→{pi+1 ≡ pi | 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

slide-51
SLIDE 51

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-52
SLIDE 52

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding STRIPS

For each action,

1

If we drive from Sestri to Genova, we must be in Sestri at the starting state, i.e., Drivei(SL, GE) ⊃ Ati(SL)

2

If we drive from Sestri to Genova, we end up in Genova and we are no longer in Sestri, i.e., Drivei(SL, GE) ⊃ ¬Ati+1(SL) ∧ Ati+1(GE)

3

If we drive from Sestri to Genova, all the state variables not in the effects do not change their value, i.e., Drivei(SL, GE) ⊃ (Ati+1(MI) ≡ Ati(MI))

4

In every state we have to execute one action: (Drivei(SL, GE) ∨ Drivei(GE, MI) ∨ Flyi(GE, MI))

  • E. Giunchiglia

Planning as Satisfiability

slide-53
SLIDE 53

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-54
SLIDE 54

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding based on the Explanatory Frame Axioms I

Universal Axioms: for each action α ∈ A s.t.

  • p(α, Pre, Add, Del) ∈ Ops,

αi→{pi | p ∈ Pre} αi→{pi+1 | p ∈ Add} αi→{¬pi+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

slide-55
SLIDE 55

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding based on the Explanatory Frame Axioms II

Explanatory Frame Axioms: for all fluents f ∈ F, (fi ∧ ¬fi+1)→ {αi | α ∈ A, op(α, Pre, Add, Del) ∈ Ops, f ∈ Del} (¬fi ∧ fi+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

slide-56
SLIDE 56

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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,

  • p(α′, Pre′, Add′, Del′) ∈ Ops, and Pre ∩ Del′ = { } or

Pre′ ∩ Del = { }. Cardinality: O(|A|2)

  • E. Giunchiglia

Planning as Satisfiability

slide-57
SLIDE 57

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

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

slide-58
SLIDE 58

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding STRIPS descriptions in SAT

Let i be an integer.

1

If an action is executed at time i, its preconditions are satisfied, e.g., Drivei(SL, GE) ⊃ Ati(SL)

2

If an action is executed at time i, its effects hold at time i + 1, e.g., Drivei(SL, GE) ⊃ ¬Ati+1(SL) ∧ Ati+1(GE)

3

Changes occur only because of action, e.g., Ati+1(SL) ∧ ¬Ati(SL) ⊃ Drivei(GE, SL) ∨ Drivei(MI, SL)

4

It is not possible to execute two conflicting actions at the same time, e.g., ¬(Flyi(GE, MI) ∧ Drivei(GE, MI))

  • E. Giunchiglia

Planning as Satisfiability

slide-59
SLIDE 59

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding Classical Planning descriptions in SAT

1

Considering STRIPS descriptions various other encodings have been proposed (Graphplan based, based on process semantics, with operator splitting, ... ) and various

  • ptimizations have been proposed to the explanatory

based encoding:

1

adding fluent mutexes, e.g., “it is not possible to be in Milan and Genoa at the same time”, by inductive reasoning starting from the initial state,

2

allowing for more actions to be executed at the same step: 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

slide-60
SLIDE 60

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

Encoding Classical Planning descriptions in SAT

1

There are far more expressive languages for modeling 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, . . .

2

These languages allow for easier modeling of problems in various domains (e.g., security, formal verification)

  • E. Giunchiglia

Planning as Satisfiability

slide-61
SLIDE 61

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-62
SLIDE 62

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-63
SLIDE 63

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Mechanizing SAT (I)

Conjunctive Normal Form Formulas having the form m

i=1

hi

j=1 lij where:

the formula is a conjunction (set of) clauses each clause is a disjunctions (set of) literals each literal lij 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

slide-64
SLIDE 64

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Mechanizing SAT (II)

s1 = (

s

  • (x1 ⊕ x3) ⊕

(x2 ∧ x4)

  • c

) (s ∨ c)∧ (¬s ∨ ¬c)∧ (¬s ∨ x1 ∨ x3)∧ (¬s ∨ ¬x1 ∨ ¬x3)∧ (s ∨ ¬x1 ∨ x3)∧ (s ∨ x1 ∨ ¬x3)∧ (c ∨ ¬x2 ∨ ¬x4)∧ (¬c ∨ x2)∧ (¬c ∨ x4) { {s, c}, {s, c}∧ {s, x1, x3}, {s, x1, x3}, {s, x1, x3}, {s, x1, x3}, {c, x2, x4}, {c, x2}, {c, x4} }

{l} is a unit clause

  • E. Giunchiglia

Planning as Satisfiability

slide-65
SLIDE 65

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

The Satisfiability Problem

Problem SAT Given a set of clauses ϕ, is ϕ satisfiable? The complexity of SAT Prototypical NP-complete problem n variables imply 2n 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

slide-66
SLIDE 66

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Search algorithm

DLL(ϕ,S) 1 if all clauses are satisfied then return S 2 if a clause is violated then return FALSE 3 if {l} is a unit clause in ϕ then return DLL(ϕl,S ∪ {l}) 4 l := a literal in ϕ; return DLL(ϕl,S ∪ {l}) or DLL(ϕl,S ∪ {l}) [Davis, Logemann, Loveland 1962]

Key technologies in today’s implementations:

1

(Lazy) data structures for efficient unit clause detection

2

Dynamic heuristics either based on learning or on unit-propagation

3

(UIP-based) Learning for backjumping over irrelevant nodes and avoid repeating the same mistakes in different parts of the search tree minisat has less than 1Kloc

  • E. Giunchiglia

Planning as Satisfiability

slide-67
SLIDE 67

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Search algorithm

DLL(ϕ,S) 1 if all clauses are satisfied then return S 2 if a clause is violated then return FALSE 3 if {l} is a unit clause in ϕ then return DLL(ϕl,S ∪ {l}) 4 l := a literal in ϕ; return DLL(ϕl,S ∪ {l}) or DLL(ϕl,S ∪ {l}) [Davis, Logemann, Loveland 1962]

Key technologies in today’s implementations:

1

(Lazy) data structures for efficient unit clause detection

2

Dynamic heuristics either based on learning or on unit-propagation

3

(UIP-based) Learning for backjumping over irrelevant nodes and avoid repeating the same mistakes in different parts of the search tree minisat has less than 1Kloc

  • E. Giunchiglia

Planning as Satisfiability

slide-68
SLIDE 68

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

(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

slide-69
SLIDE 69

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

2011 Competition results, real world category

200 400 600 800 1000 1200 20 40 60 80 100 120 140 160 180 200 CPU Time (in seconds) Number of problems solved Results of the SAT competition/race winners on the SAT 2009 application benchmarks, 20mn timeout Limmat (2002) Zchaff (2002) Berkmin (2002) Forklift (2003) Siege (2003) Zchaff (2004) SatELite (2005) Minisat 2 (2006) Picosat (2007) Rsat (2007) Minisat 2.1 (2008) Precosat (2009) Glucose (2009) Clasp (2009) Cryptominisat (2010) Lingeling (2010) Minisat 2.2 (2010) Glucose 2 (2011) Glueminisat (2011) Contrasat (2011) Lingeling 587f (2011)

  • E. Giunchiglia

Planning as Satisfiability

slide-70
SLIDE 70

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-71
SLIDE 71

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Planning as Satisfiability

Assumptions

1

I, tri, G is a deterministic planning problem:

1

there is only one state satisfying I

2

for each state s and complex action a there is at most one state s′ satisfying tr

Planning problem (of length n) A planning problem (of length n) is the Boolean formula I0 ∧ ∧n

i=1tri ∧ Gn

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

slide-72
SLIDE 72

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Planning as Satisfiability

Given, I0 ∧ ∧n

i=1tri ∧ Gn

1

its size is polynomial in n and tri,

1

. . . but n can be exponential in |X|,

2

⇒ is important to use “enhanced explanatory frame axioms”

2

The existence of a plan can be proved by trying different n (usually using an incremental strategy)

1

. . . but what if a plan does not exist?

  • E. Giunchiglia

Planning as Satisfiability

slide-73
SLIDE 73

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Strategies for finding n

1

sequential: Solve SAT problems sequentially one at a time for horizon lengths 1, 2, 3, 4, ... until a plan is found.

2

algorithm A: Start k solvers simultaneously, solving the planning problem for horizon lengths 1,2,3,4,...,k. Call them SAT1, . . . , SATk. If SATm returns a plan we

  • terminate. If SATm returns UNSAT, kill the solvers SATj

with j < m and start m new solvers so that there are always k SAT instances being solved.

3

algorithm B: Start k solvers SAT1, . . . , SATk as for algo A. SATm gets an amount of CPU proportional to γm, with 0 < γ < 1.

4

algorithm C: Solve horizon lengths 1,2,4,8,16,... in parallel, up to some finite length, with the same amount of CPU assigned to each horizon length.

  • E. Giunchiglia

Planning as Satisfiability

slide-74
SLIDE 74

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

... but what is n?

... or, what are we looking for?

1

just a plan, or

2

an optimal parallel plan,

3

an optimal sequential plan,

4

...

  • E. Giunchiglia

Planning as Satisfiability

slide-75
SLIDE 75

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Experimental analysis (from Rintanen’s web page)

  • E. Giunchiglia

Planning as Satisfiability

slide-76
SLIDE 76

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-77
SLIDE 77

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Planning with hard Constraints

Assumptions

1

ϕ is a planning problem of length n Example (State (Qualification) Constraints) It is not possible to be in two locations at the same time. Just add to ϕ: ∧n

i=0¬(Ati(GE) ∧ Ati(SL))

Example (Trajectory Constraints on Action Variables) I do want to drive after flying. Just add to ϕ: ∧n−1

i=0 ¬(Flyi(MI, GE) ∧ Drivei+1(GE, SL))

[Kautz, Selman 1996], [Biere, et al. 1999], [Latvala, et al. 2004]

  • E. Giunchiglia

Planning as Satisfiability

slide-78
SLIDE 78

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Planning with hard Constraints

Assumptions

1

ϕ is a planning problem of length n Example (State (Qualification) Constraints) It is not possible to be in two locations at the same time. Just add to ϕ: ∧n

i=0¬(Ati(GE) ∧ Ati(SL))

Example (Trajectory Constraints on Action Variables) I do want to drive after flying. Just add to ϕ: ∧n−1

i=0 ¬(Flyi(MI, GE) ∧ Drivei+1(GE, SL))

[Kautz, Selman 1996], [Biere, et al. 1999], [Latvala, et al. 2004]

  • E. Giunchiglia

Planning as Satisfiability

slide-79
SLIDE 79

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Planning with hard Constraints

Assumptions

1

ϕ is a planning problem of length n Example (State (Qualification) Constraints) It is not possible to be in two locations at the same time. Just add to ϕ: ∧n

i=0¬(Ati(GE) ∧ Ati(SL))

Example (Trajectory Constraints on Action Variables) I do want to drive after flying. Just add to ϕ: ∧n−1

i=0 ¬(Flyi(MI, GE) ∧ Drivei+1(GE, SL))

[Kautz, Selman 1996], [Biere, et al. 1999], [Latvala, et al. 2004]

  • E. Giunchiglia

Planning as Satisfiability

slide-80
SLIDE 80

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Preferences

Assumptions

1

π is a planning problem of length n 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 F0 ∪ A0 ∪ F1 ∪ A1 ∪ . . . ∪ Fn.

  • E. Giunchiglia

Planning as Satisfiability

slide-81
SLIDE 81

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

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: At0(GE) ∨ At1(GE) ∨ At2(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

slide-82
SLIDE 82

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Interacting preferences

Problem It may not be possible to satisfy all preferences together Example Considering the goal At2(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:

1

Qualitative approaches

2

Quantitative approaches

  • E. Giunchiglia

Planning as Satisfiability

slide-83
SLIDE 83

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

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 {¬Drive1(GE, MI), ¬Plain1(GE, MI)} with ¬Plain1(GE, MI) ≺ ¬Drive1(GE, MI).

  • E. Giunchiglia

Planning as Satisfiability

slide-84
SLIDE 84

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Optimal plan with preferences

Assumptions

1

P, ≺ is a preference for a given planning problem A plan π1 is preferred to a plan π2 iff

1

they satisfy different sets of preferences, and

2

for each preference p2 satisfied by π2 and not by π1 there is another preference p1 satisfied by π1 and not by π2 with p1 ≺ p2 A plan (for the given problem) is optimal if it is a minimal element of the partial order Example Given the only preference ¬Plain1(GE, MI) ≺ ¬Drive1(GE, MI), the plan with Drive0(SL, GE), Drive1(GE, MI) is preferred to the plan Drive0(SL, GE), Plain1(GE, MI).

  • E. Giunchiglia

Planning as Satisfiability

slide-85
SLIDE 85

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Planning with soft Constraints: Optimal Planning

Assumptions

1

P is the set of plans (of any length) for a planning problem,

2

≺ is a partial order over P: π1 ≺ π2 means π1 is preferred 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

slide-86
SLIDE 86

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Generating optimal plans

OPT-SATPLAN(ϕ,P,≺) 1 return OPT-DLL(ϕ ∧ ψ,{ },P′,≺′) OPT-DLL(ϕ,S,P′,≺′) 2 if all clauses are satisfied then return S 3 if a clause is violated then return FALSE 4 if {l} is a unit clause in ϕ then return OPT-DLL(ϕl,S ∪ {l},P′,≺′) 5 l := a minimal unassigned variable in P′, ≺′ if ∃; and a literal in ϕ otherwise return OPT-DLL(ϕl,S ∪ {l},P′,≺′) or OP-DLL(ϕl,S ∪ {l},P′,≺′)

1

ϕ is a planning problem

2

P, ≺ is a preference

3

ψ = ∧p∈Pv(p) ≡ p

4

P′ is the set of the variables v(p)

5

v(p1) ≺′ v(p2) iff p1 ≺ p2 Facts: [Giunchiglia & Maratea 2006]

1

OPT-SATPLAN returns an optimal plan of length n

2

P, ≺ may cause an exponential CPU degradation

  • E. Giunchiglia

Planning as Satisfiability

slide-87
SLIDE 87

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Generating optimal plans

OPT-SATPLAN(ϕ,P,≺) 1 return OPT-DLL(ϕ ∧ ψ,{ },P′,≺′) OPT-DLL(ϕ,S,P′,≺′) 2 if all clauses are satisfied then return S 3 if a clause is violated then return FALSE 4 if {l} is a unit clause in ϕ then return OPT-DLL(ϕl,S ∪ {l},P′,≺′) 5 l := a minimal unassigned variable in P′, ≺′ if ∃; and a literal in ϕ otherwise return OPT-DLL(ϕl,S ∪ {l},P′,≺′) or OP-DLL(ϕl,S ∪ {l},P′,≺′)

1

ϕ is a planning problem

2

P, ≺ is a preference

3

ψ = ∧p∈Pv(p) ≡ p

4

P′ is the set of the variables v(p)

5

v(p1) ≺′ v(p2) iff p1 ≺ p2 Facts: [Giunchiglia & Maratea 2006]

1

OPT-SATPLAN returns an optimal plan of length n

2

P, ≺ may cause an exponential CPU degradation

  • E. Giunchiglia

Planning as Satisfiability

slide-88
SLIDE 88

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Example: Going to Milan from Sestri

Assume ¬Plain1(GE, MI) ≺ ¬Drive1(GE, MI). The branches explored by OPT-DLL are in the following order:

1

¬Plain1(GE, MI), ¬Drive1(GE, MI): if no plan is found extending this branch, then OPT-DLL backtracks and (possibly) explores a branch with

2

¬Plain1(GE, MI), Drive1(GE, MI): if no plan is found extending this branch, then OPT-DLL backtracks and (possibly) explores a branch with

3

Plain1(GE, MI), ¬Drive1(GE, MI): if no plan is found extending this branch, then OPT-DLL backtracks and (possibly) explores a branch with

4

Plain1(GE, MI), Drive1(GE, MI): if no plan is found extending this branch, then OPT-DLL returns FALSE.

  • E. Giunchiglia

Planning as Satisfiability

slide-89
SLIDE 89

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Issues

Issue:

1

What is the performance degradation that we get if we have preferences?

2

Is the degradation related to the number of preferences? Done:

1

We implemented OPT-DLL on top of minisat. SATPLAN04 uses siege.

2

We considered problems with simple preferences among goals and irredundant plans

  • E. Giunchiglia

Planning as Satisfiability

slide-90
SLIDE 90

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Example: Simple preferences among goals

Assumptions

1

I, tr, G is a planning problem

2

S is a set of soft goals. Example: Simple preference among goals

1

consider I0 ∧ ∧n

i=1tri ∧ Gn ∧g∈S (vn(g) ≡ gn)

together with the simple preference {vn(g) : g ∈ S}.

  • E. Giunchiglia

Planning as Satisfiability

slide-91
SLIDE 91

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Simple preferences among goals: # of unsatisfied goals

  • E. Giunchiglia

Planning as Satisfiability

slide-92
SLIDE 92

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Simple preference among goals: CPU times

  • E. Giunchiglia

Planning as Satisfiability

slide-93
SLIDE 93

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Example: irredundant plans

Assumptions

1

I, tr, G is a planning problem Example: irredundant plans

1

Consider I0 ∧ ∧n

i=1tri ∧ Gn

together with the simple preference {¬ai : a is an action}.

  • E. Giunchiglia

Planning as Satisfiability

slide-94
SLIDE 94

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Irredundant plans: #actions

  • E. Giunchiglia

Planning as Satisfiability

slide-95
SLIDE 95

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Irredundant plans: CPU times

  • E. Giunchiglia

Planning as Satisfiability

slide-96
SLIDE 96

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Example: Makespan optimality: SATPLAN

Assumptions

1

I, tr, G is a planning problem Example: Makespan optimality: SATPLAN

1

generate I0 ∧ ∧n

i=1tri ∧ Gn

for n = 0, and

2

increment n till the formula becomes satisfiable CONS: for each n, computation of previous SAT checks is lost (nogoods)

  • E. Giunchiglia

Planning as Satisfiability

slide-97
SLIDE 97

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Example: Makespan optimality: Alternative

Makespan optimality: Alternative

1

generate I0 ∧ ∧n

i=1tri ∧ ∧n i=k(pi ≡ Gi)

for k = 0 and any arbitrarily fixed n together with pk ≺ pk+1 ≺ . . . ≺ pn, and

2

fix k = n and n to another bigger value till the formula 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

slide-98
SLIDE 98

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

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 ¬Drive1(GE, MI) and ¬Plain1(GE, MI)} with penalties 1 and 2 resp.

  • E. Giunchiglia

Planning as Satisfiability

slide-99
SLIDE 99

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Optimal plan with preferences

Assumptions

1

P, f is a preference for a given planning problem A plan π1 is preferred to a plan π2 iff

  • p∈P:π1|

=p

f(p) ≤

  • p∈P:π2|

=p

f(p) A plan (for the given problem) is optimal if it has a minimal associated penalty

  • E. Giunchiglia

Planning as Satisfiability

slide-100
SLIDE 100

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Generating optimal plans

OPT-SATPLAN(ϕ,P,f) 1 return OPT-DLL(ϕ ∧ adder(P, f),{ },P′,≺′) OPT-DLL(ϕ,S,P′,≺′) 2 if all clauses are satisfied then return S 3 if a clause is violated then return FALSE 4 if {l} is a unit clause in ϕ then return OPT-DLL(ϕl,S ∪ {l},P′,≺′) 5 l := a minimal unassigned variable in P′, ≺′ if ∃; and a literal in ϕ otherwise return OPT-DLL(ϕl,S ∪ {l},P′,≺′) or OP-DLL(ϕl,S ∪ {l},P′,≺′)

1

ϕ is a planning problem

2

P, ≺ is a preference

3

adder(P, f) is a Boolean formula corresponding to the penalty function

4

bm, . . . , b0 is the sequence of variables (bits) representing the value of adder(P, f)

5

P′ is the set {¬bm, . . . , ¬b0}

6

¬bm ≺′ ¬bm−1 ≺′ . . . ≺′ ¬b0 Fact [Giunchiglia & Maratea 2006] OPT-SATPLAN returns an optimal plan given the makespan n.

  • E. Giunchiglia

Planning as Satisfiability

slide-101
SLIDE 101

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Generating optimal plans

OPT-SATPLAN(ϕ,P,f) 1 return OPT-DLL(ϕ ∧ adder(P, f),{ },P′,≺′) OPT-DLL(ϕ,S,P′,≺′) 2 if all clauses are satisfied then return S 3 if a clause is violated then return FALSE 4 if {l} is a unit clause in ϕ then return OPT-DLL(ϕl,S ∪ {l},P′,≺′) 5 l := a minimal unassigned variable in P′, ≺′ if ∃; and a literal in ϕ otherwise return OPT-DLL(ϕl,S ∪ {l},P′,≺′) or OP-DLL(ϕl,S ∪ {l},P′,≺′)

1

ϕ is a planning problem

2

P, ≺ is a preference

3

adder(P, f) is a Boolean formula corresponding to the penalty function

4

bm, . . . , b0 is the sequence of variables (bits) representing the value of adder(P, f)

5

P′ is the set {¬bm, . . . , ¬b0}

6

¬bm ≺′ ¬bm−1 ≺′ . . . ≺′ ¬b0 Fact [Giunchiglia & Maratea 2006] OPT-SATPLAN returns an optimal plan given the makespan n.

  • E. Giunchiglia

Planning as Satisfiability

slide-102
SLIDE 102

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Computing adder(P, f)

There are several ways to compute adder(P, f): Warners 1998 : linear in #clauses (8|P|) and #variables (2|P|) Bailleux & Boufkhad 2003 : quadratic in number of clauses Sinz 2005 : (slightly) improved versions of the previous ... : ...

  • E. Giunchiglia

Planning as Satisfiability

slide-103
SLIDE 103

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Simple preference among goals: # of unsatisfied goals

  • E. Giunchiglia

Planning as Satisfiability

slide-104
SLIDE 104

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Simple preference among goals: CPU times

  • E. Giunchiglia

Planning as Satisfiability

slide-105
SLIDE 105

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Irredundant plans: #actions

  • E. Giunchiglia

Planning as Satisfiability

slide-106
SLIDE 106

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

Irredundant plans: CPU times

  • E. Giunchiglia

Planning as Satisfiability

slide-107
SLIDE 107

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

IPC problems

#actions Time PB siegemSAToptSATC optSATS siege mSAToptSATC optSATS pipe7 10 9 8 8 0.46 1.92 260.27 2.69 pipe5t 10 10 8 8 7.06 24.9 146.65 40.3 sat2 13 – – 13 272.78 – – 4.34 air14 60 60 – 60 2.07 2.3 – 3.77 phil29 330 330 330 330 9.64 9.90 13.28 11.88

  • pt11

216 216 216 – 54.29 53.68 227.34 – psr47 27 27 27 27 27.45 30.85 173.78 8.79 dep7 37 39 23 23 25.35 17.39 212.00 223.41 driv9 26 28 24 24 29.05 52.96 190.16 24.01 zeno8 16 17 15 15 5.70 1.30 173.03 9.01 log6-9 41 39 24 28 0.22 0.15 235.39 0.18 block6-2 20 20 – 20 48.16 81.46 – 15.37 mprime9 16 14 8 8 2.33 2.88 21.20 4.45 myst9 9 10 8 8 1.38 1.48 6.36 2.53

  • E. Giunchiglia

Planning as Satisfiability

slide-108
SLIDE 108

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-109
SLIDE 109

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-110
SLIDE 110

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

The syntax of QBFs

prefix

  • Q1z1 · · · Qnzn

matrix

  • φ(z1, . . . , zn)

n ≥ 0

Every Qi (1 ≤ i ≤ n) is a quantifier, either existential ∃ or universal ∀ Every zi is a Boolean variable φ is a Boolean formula over the set of variables {z1, . . . zn} using standard Boolean connectives and the constants ⊥ and ⊤

  • E. Giunchiglia

Planning as Satisfiability

slide-111
SLIDE 111

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

The semantics or value of QBFs

The semantics of a QBF Q1z1 · · · Qnznφ can be easily defined

  • n the basis that

∃xϕ and (ϕx ∨ ϕx) are logically equivalent. ∀yϕ and (ϕy ∧ ϕy) are logically equivalent. ϕl is obtained from ϕ by substituting l with ⊤ and l with ⊥.

  • E. Giunchiglia

Planning as Satisfiability

slide-112
SLIDE 112

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Examples

∀y∃x.(x ≡ y) forall values of y, is there a value for x such that x ≡ y is true? ∃x∀y.(x ≡ y) Is there a value for x such that for all values of y, x ≡ y is true? ∃x1∀y∃x2.(x1 ∧ y) → x2 Is there a value for x1 such that for all values of y, there exists a value of x2, such that x1 and y imply x2? ∃x1∃x2∃x3.(x1 ∧ x2) ≡ x3 Is the Boolean formula (x1 ∧ x2) ≡ x3 satisfiable? ∀y1∀y2.¬(y1 ∧ y2) ≡ (¬y1 ∨ ¬y2) Is the Boolean formula ¬(y1 ∧ y2) ≡ (¬y1 ∨ ¬y2) a tautology?

  • E. Giunchiglia

Planning as Satisfiability

slide-113
SLIDE 113

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Reasoning and complexity (I) kQBFs A QBF Q1z1 · · · Qnznφ(z1, . . . , zn) is a kQBF if k = 1 + the number of times Qi = Qi+1. Examples

1 the QBF ∃x∀y.(x ≡ y) is a 2QBF

.

2 the QBF ∃x1∀y∃x2.(x1 ∧ y) → x2 is a 3QBF

.

3 the QBF ∃x1∃x2.(x1 ≡ x2) is a 1QBF

.

4 the QBF ∀y1∀y2.¬(y1 ∧ y2) is a 1QBF

.

  • E. Giunchiglia

Planning as Satisfiability

slide-114
SLIDE 114

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Reasoning and complexity (II)

Let ϕ = Q1z1 · · · Qnznφ be kQBF Problems QSAT Is ϕ true? kQSAT Is ϕ true with k known a priori? QHornSAT Is ϕ true with φ being a set of Horn clauses? Complexity QSAT is the prototypical PSPACE-Complete problem kQSAT is ΣkP-Complete if Q1 = ∃ and ΠkP-Complete if Q1 = ∀ QHornSAT Is in P

  • E. Giunchiglia

Planning as Satisfiability

slide-115
SLIDE 115

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Search algorithm

SOLVE(ϕ) 1 if all clauses are satisfied then return TRUE 2 if a clause is violated then return FALSE 3 if l is unit in ϕ then return SOLVE(ϕl) 4 if l is pure in ϕ then return SOLVE(ϕl) 5 if ϕ = ∃xψ then return SOLVE(ϕx) or SOLVE(ϕ¬x) else return SOLVE(ϕx) and SOLVE(ϕ¬x)

Unit literal A literal l is unit in ϕ iff it is the only existential in some clause c ∈ φ and all the universal literals l′ ∈ c are s.t. depth(l′) > depth(l) Pure literal An existential (resp. universal) literal l is pure in ϕ iff l ∈ c (resp. l ∈ c) for all clauses c ∈ φ [Cadoli, Giovanardi, Schaerf 1998]

  • E. Giunchiglia

Planning as Satisfiability

slide-116
SLIDE 116

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-117
SLIDE 117

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-118
SLIDE 118

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-119
SLIDE 119

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-120
SLIDE 120

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-121
SLIDE 121

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-122
SLIDE 122

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-123
SLIDE 123

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

An example about search

  • E. Giunchiglia

Planning as Satisfiability

slide-124
SLIDE 124

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Alternative approaches

Based on Expansion, e.g., QUANTOR (A. Biere 2003)

eliminate existential variables using resolution expand universal variables ∀xF(x) = F(⊤) ∧ F(⊥)

Based on Variable elimination, e.g., QMRes (G. Pan M.Y. Vardi 2004)

use ZDDs to represent clauses implement resolution and expansion as ZDD operations

Based on Skolemization, e.g., sKizzo (M. Benedetti 2005)

based on skolemization and symbolic representation (with OBDD) of the constraints about Skolem functions implements and interleaves various strategies (e.g., expansion, search, . . . )

Based on reduction to SAT using CEGAR, e.g., RAReQS (M. Janota, W. Klieber , J. Marques-Silva, and E. M. Clarke 2012)

  • E. Giunchiglia

Planning as Satisfiability

slide-125
SLIDE 125

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-126
SLIDE 126

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Conformant Planning

Assumptions

1

I, tr, G is a (nondeterministic) planning problem

2

each action is executable in every state Encoding in QBF ∃A0 · · · Ak−1∀F0 · · · ∀Fk(I(F0) ∧

k−1

  • t=0

tr(Ft, At, Ft+1) → G(Fk)) Similar encoding can be done for planning under partial/full

  • bservability
  • E. Giunchiglia

Planning as Satisfiability

slide-127
SLIDE 127

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Results on planning problems

Family Overall Time Hardness N # S U EAME MH Blocks 11 11 4 7 4.65 0 11 Connect4 13 13 13 3.07 0 13 evader-pursuer-4x4-logarithmic 4 4 4 1.62 4 evader-pursuer-6x6-logarithmic 2 2 2 14.98 0 2 evader-pursuer-8x8-logarithmic 4 4 4 5.23 4 Logn 2 2 2 1 2 RobotsD2 10 10 10 17.03 0 10 RobotsD3 10 10 10 22.69 0 10 RobotsD4 10 10 10 17.31 0 10 RobotsD5 10 10 10 16.23 0 10 Sorting_networks 84 77 53 24 479.34 5 55 17 Strategic_Companies 5305202642567019.515334171 Toilet 3 3 2 1 0.15 3 ToiletA 2 2 1 1 2.1 2

  • E. Giunchiglia

Planning as Satisfiability

slide-128
SLIDE 128

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Outline

1

Planning Problem types and problem formulation Example Problems

2

Classical Planning Encoding based on the Classical Frame Axioms Encoding based on the Explanatory Frame Axioms

3

Satisfiability of Boolean formulas (SAT) and Planning Satisfiability of Boolean formulas (SAT) Planning as satisfiability Handling hard and soft constraints

4

QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-129
SLIDE 129

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Classical planning as QBFs

1

Symbolic reachability (or, classical planning) is PSPACE complete, like QBFs satisfiability

2

⇒ there exists polynomial size encoding of classical planning as QBFs satisfiability.

3

⇒ the issue is how to represent a sequence of 2n states (the plan) as a tree of states of height n (the states in the QBFs semantics). Encodings: We consider two encoding techniques: the flat encoding: the sequence of states is represented by the leaves of the tree the tree encoding: the sequence of states is represented by the nodes (also the internal ones) in the tree

  • E. Giunchiglia

Planning as Satisfiability

slide-130
SLIDE 130

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Flat encoding of planning as QBFs

The flat encoding of a planning problem I, tr, G with makespan n = 2k is the formula: I(XI) ∧ Ek(XI, XG) ∧ G(XG) (1) where k ≥ 0 is the folding parameter and Ek(XI, XG) is: Ek(XI, XG) := ∃Xst∀y∃XsXt( (¬y ⇒ ((XI ↔ Xs) ∧ (Xst ↔ Xt)))∧ (y ⇒ ((Xst ↔ Xs) ∧ (XG ↔ Xt)))∧ Ek−1(Xs, Xt) ) if k > 0, and E0(XI, XG) := ∃X1∃X2 ((XI ↔ X1) ∧ tr(X1, X2) ∧ (X2 ↔ XG)) when k = 0.

  • E. Giunchiglia

Planning as Satisfiability

slide-131
SLIDE 131

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Flat encoding of planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-132
SLIDE 132

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Tree encoding of planning as QBFs

The Tree Encoding of a planning problem I, tr, G with makespan n = 2k+1 is the formula: I(XI) ∧ Qk(XI, XG) ∧ G(XG) where Qk(XI, XG) is: ∃xk∀yk∃xk−1∀yk−1 . . . ∃x1∀y1∃x((∧k

i=1¬yi ⊃ tr(xI, x))∧

(∧k

i=1yi ⊃ tr(x, xG))∧

Tr(xk, yk, xk−1, yk−1, . . . , x1, y1, x) ) Tr(xk, yk, xk−1, yk−1, . . . , x1, y1, x) = (¬yk ∧ ∧k−1

i=1 yi ⊃ tr(x, xk))∧

(yk ∧ ∧k−1

i=1 ¬yi ⊃ tr(xk, x))∧

Tr(xk−1, yk−1, . . . , x1, y1, x) tr(x) = ⊤

  • E. Giunchiglia

Planning as Satisfiability

slide-133
SLIDE 133

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Tree encoding of planning as QBFs

  • E. Giunchiglia

Planning as Satisfiability

slide-134
SLIDE 134

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Size of the encodings

Size of the encodings (e..g. n = 1.000, |X| = 100, |tr| = 1.000): SAT encoding:

(n + 1)|X| existential variables n|tr| clauses

Flat encoding with n = 2k:

log2(n)1 universal variables (3k + 2)|X| existential variables 4(2k + 1)|X| + |tr| clauses

Tree Encoding with n = 2k+1:

log2(n) − 1 universal variables (k + 1)|X| existential variables (2k + 1)|tr| clauses

SAT

≈ 100.000 ≈ 1.000.000

Flat

10 ≈ 3.200 ≈ 9.400

Tree

9 ≈ 1.000 ≈ 19.000

  • E. Giunchiglia

Planning as Satisfiability

slide-135
SLIDE 135

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Experimental analysis: Flat vs Tree encodings

Figure: Times on problems solved with DEPQBF using the Compact Tree Encoding and Flat Encoding, times in ms.

  • E. Giunchiglia

Planning as Satisfiability

slide-136
SLIDE 136

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Experimental analysis: Flat vs Tree encodings

Figure: Average memory usage

  • ver time per domain (smoothed

average), SAT and QBF encodings, solving QBFs with DEPQBF; memory in (kb) Figure: Times on problems solved using the Compact Tree Encoding with various solvers against SAT, times in ms.

  • E. Giunchiglia

Planning as Satisfiability

slide-137
SLIDE 137

Planning Classical Planning Satisfiability of Boolean formulas (SAT) and Planning QBFs satisfiability and Planning Satisfiability of Quantified Boolean Formulas (QBFs) Conformant Planning as QBF satisfiability Classical planning as QBFs

Conclusions

SAT&Planning:

1

Enormous progress since 1992

2

Good for classical planning

3

Can be easily extended to deal with (LTL) constraints

4

Can be easily adapated for handling preferences QBF&Planning:

1

Good progress since 1998.

2

Can be used to solve conformant and contigent plannins problems

3

For classical planning needs more work in the encodings and in the solvers

  • E. Giunchiglia

Planning as Satisfiability