Chapter 7 Propositional Satisfiability Techniques

Similar documents
Chapter 7 Propositional Satisfiability Techniques

Planning as Satisfiability

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Foundations of Artificial Intelligence

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Lecture 9: Search 8. Victor R. Lesser. CMPSCI 683 Fall 2010

A brief introduction to Logic. (slides from

Foundations of Artificial Intelligence

Lecture 2 Propositional Logic & SAT

Chapter 16 Planning Based on Markov Decision Processes

Mathematical Logic Part Three

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving

Chapter 17 Planning Based on Model Checking

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

Chapter 17 Planning Based on Model Checking

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II)

Chapter 3 Deterministic planning

Comp487/587 - Boolean Formulas

SAT Solvers: Theory and Practice

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz )

Lecture 9: The Splitting Method for SAT

Logical Agents. Santa Clara University

Artificial Intelligence Chapter 7: Logical Agents

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Propositional Logic: Models and Proofs

Proof Methods for Propositional Logic

Propositional Logic: Methods of Proof. Chapter 7, Part II

Logical Agents. Chapter 7

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

Artificial Intelligence

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

SAT, NP, NP-Completeness

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Propositional and First Order Reasoning

Tecniche di Verifica. Introduction to Propositional Logic

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

Advanced Topics in LP and FP

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Intelligent Agents. Pınar Yolum Utrecht University

Deliberative Agents Knowledge Representation I. Deliberative Agents

Proof Complexity Meets Algebra

Pythagorean Triples and SAT Solving

Tutorial 1: Modern SMT Solvers and Verification

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Incremental Deterministic Planning

Warm-Up Problem. Is the following true or false? 1/35

CS21 Decidability and Tractability

CS:4420 Artificial Intelligence

Foundations of Artificial Intelligence

Part 1: Propositional Logic

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional Logic: Methods of Proof (Part II)

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

CS 730/830: Intro AI. 2 handouts: slides, asst 5. Wheeler Ruml (UNH) Lecture 10, CS / 19. What is KR? Prop. Logic. Reasoning

CS156: The Calculus of Computation

Artificial Intelligence

CS 380: ARTIFICIAL INTELLIGENCE

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Formal Verification Methods 1: Propositional Logic

Logical Agents. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

Decision Procedures for Satisfiability and Validity in Propositional Logic

Topics in Model-Based Reasoning

Propositional Reasoning

Lecture 7: Logic and Planning

NP-Complete Reductions 2

Artificial Intelligence

Propositional logic II.

Classical Propositional Logic

A Method for Generating All the Prime Implicants of Binary CNF Formulas

Lecture Notes on SAT Solvers & DPLL

Planning as X X {SAT, CSP, ILP, }

CSCI 1590 Intro to Computational Complexity

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

An Introduction to SAT Solving

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel

LOGIC PROPOSITIONAL REASONING

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 1

Logic. Propositional Logic: Syntax

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Propositional and Predicate Logic. jean/gbooks/logic.html

Logical agents. Chapter 7. Chapter 7 1

Class Assignment Strategies

Solving SAT Modulo Theories

Normal Forms of Propositional Logic

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

NP-Completeness Part II

Propositional Resolution

CS156: The Calculus of Computation Zohar Manna Autumn 2008

Artificial Intelligence

CS 188: Artificial Intelligence Spring 2007

Transcription:

Lecture slides for Automated Planning: Theory and Practice Chapter 7 Propositional Satisfiability Techniques Dana S. Nau University of Maryland 12:58 PM February 15, 2012 1

Motivation Propositional satisfiability: given a boolean formula» e.g., (P Q) ( Q R S) ( R P), does there exist a model» i.e., an assignment of truth values to the propositions that makes the formula true? This was the very first problem shown to be NP-complete Lots of research on algorithms for solving it Algorithms are known for solving all but a small subset in average-case polynomial time Therefore, Try translating classical planning problems into satisfiability problems, and solving them that way 2

Outline Encoding planning problems as satisfiability problems Extracting plans from truth values Satisfiability algorithms Davis-Putnam Local search GSAT Combining satisfiability with planning graphs SatPlan 3

Overall Approach A bounded planning problem is a pair (P,n): P is a planning problem; n is a positive integer Any solution for P of length n is a solution for (P,n) Planning algorithm: Do iterative deepening like we did with Graphplan: for n = 0, 1, 2,,» encode (P,n) as a satisfiability problem Φ» if Φ is satisfiable, then From the set of truth values that satisfies Φ, a solution plan can be constructed, so return it and exit 4

Notation For satisfiability problems we need to use propositional logic Need to encode ground atoms into propositions For set-theoretic planning we encoded atoms into propositions by rewriting them as shown here:» Atom: at(r1,loc1)» Proposition: at-r1-loc1 For planning as satisfiability we ll do the same thing But we won t bother to do a syntactic rewrite Just use at(r1,loc1) itself as the proposition Also, we ll write plans starting at a 0 rather than a 1 π = a 0, a 1,, a n 1 5

Fluents If π = a 0, a 1,, a n 1 is a solution for (P,n), it generates these states: s 0, s 1 = γ (s 0,a 0 ), s 2 = γ (s 1,a 1 ),, s n = γ (s n 1, a n 1 ) Fluent: proposition saying a particular atom is true in a particular state at(r1,loc1,i) is a fluent that s true iff at(r1,loc1) is in s i We ll use l i to denote the fluent for literal l in state s i» e.g., if l = at(r1,loc1) then l i = at(r1,loc1,i) a i is a fluent saying that a is the i th step of π» e.g., if a = move(r1,loc2,loc1) then a i = move(r1,loc2,loc1,i) 6

Encoding Planning Problems Encode (P,n) as a formula Φ such that π = a 0, a 1,, a n 1 is a solution for (P,n) if and only if Φ can be satisfied in a way that makes the fluents a 0,, a n 1 true Let A = {all actions in the planning domain} S = {all states in the planning domain} L = {all literals in the language} Φ is the conjunct of many other formulas 7

1. Formula describing the initial state: Formulas in Φ /\{l 0 l s 0 } /\{ l 0 l L s 0 } 2. Formula describing the goal: /\{l n l g + } /\{ l n l g } 3. For every action a in A and for i = 1,, n, a formula describing what changes a would make if it were the i th step of the plan: a i /\{p i p Precond(a)} /\ {e i+1 e Effects(a)} 4. Complete exclusion axiom: For every pair of actions a and b, and for i = 0,, n 1, a formula saying they can t both be the i th step of the plan a i b i this guarantees there can be only one action at a time Is this enough? 8

5. Frame axioms: Frame Axioms Formulas describing what doesn t change between steps i and i+1 Several ways to write these One way: explanatory frame axioms For i = 0,, n 1, an axiom for every literal l» Says that if l changes between s i and s i+1, then the action at step i must be responsible: ( l i l i+1 V a in A {a i l effects + (a)}) (l i l i+1 V a in A {a i l effects (a)}) 9

Planning domain: one robot r1 two adjacent locations l1, l2 Example one planning operator (to move the robot from one location to another) Encode (P,n) where n = 1 1. Initial state: {at(r1,l1)} Encoding: at(r1,l1,0) at(r1,l2,0) 2. Goal: {at(r1,l2)} Encoding: at(r1,l2,1) at(r1,l1,1) 3. Operator: see next slide 10

Operator: move(r,l,l' ) Encoding: Example (continued) precond: at(r,l) effects: at(r,l' ), at(r,l) move(r1,l1,l2,0) at(r1,l1,0) at(r1,l2,1) at(r1,l1,1) move(r1,l2,l1,0) at(r1,l2,0) at(r1,l1,1) at(r1,l2,1) move(r1,l1,l1,0) at(r1,l1,0) at(r1,l1,1) at(r1,l1,1) move(r1,l2,l2,0) at(r1,l2,0) at(r1,l2,1) at(r1,l2,1) move(l1,r1,l2,0) move(l2,l1,r1,0) move(l1,l2,r1,0) move(l2,l1,r1,0) Operator: move(r : robot, l : location, l' : location) precond: at(r,l) effects: at(r,l' ), at(r,l) contradictions (easy to detect) nonsensical, and we can avoid generating them if we use data types like we did for state-variable representation 11

Example (continued) 4. Complete-exclusion axiom: move(r1,l1,l2,0) move(r1,l2,l1,0) 5. Explanatory frame axioms: at(r1,l1,0) at(r1,l1,1) move(r1,l2,l1,0) at(r1,l2,0) at(r1,l2,1) move(r1,l1,l2,0) at(r1,l1,0) at(r1,l1,1) move(r1,l1,l2,0) at(r1,l2,0) at(r1,l2,1) move(r1,l2,l1,0) Φ is the conjunct of all of these 12

Summary of the Example P is a planning problem with one robot and two locations initial state {at(r1,l1)} goal {at(r1,l2)} Encoding of (P,1) Φ = [at(r1,l1,0) at(r1,l2,0)] (initial state) [at(r1,l2,1) at(r1,l1,1)] (goal) [move(r1,l1,l2,0) at(r1,l1,0) at(r1,l2,1) at(r1,l1,1)] (action) [move(r1,l2,l1,0) at(r1,l2,0) at(r1,l1,1) at(r1,l2,1)] (action) [ move(r1,l1,l2,0) move(r1,l2,l1,0)] (complete exclusion) [ at(r1,l1,0) at(r1,l1,1) move(r1,l2,l1,0)] [ at(r1,l2,0) at(r1,l2,1) move(r1,l1,l2,0)] [at(r1,l1,0) at(r1,l1,1) move(r1,l1,l2,0)] [at(r1,l2,0) at(r1,l2,1) move(r1,l2,l1,0)] (frame axiom) (frame axiom) (frame axiom) (frame axiom) 13

Let Φ be an encoding of (P,n) Extracting a Plan Suppose we find an assignment of truth values that satisfies Φ. This means P has a solution of length n For i=1,,n, there will be exactly one action a such that a i = true This is the i th action of the plan. Example The formula on the previous slide Φ can be satisfied with move(r1,l1,l2,0) = true» Thus move(r1,l1,l2,0) is a solution for (P,1) It s the only solution - no other way to satisfy Φ 14

Planning How to find an assignment of truth values that satisfies Φ? Use a satisfiability algorithm Example: the Davis-Putnam algorithm First need to put Φ into conjunctive normal form e.g., Φ = D ( D A B) ( D A B) ( D A B) A Write Φ as a set of clauses (disjuncts of literals) Φ = {{D}, { D, A, B}, { D, A, B}, { D, A, B}, {A}} Some special cases:» If Φ = then Φ is always true» If Φ = {,, } then Φ is always false (hence unsatisfiable)» If Φ contains a unit clause, l, then l must be true in order to satisfy Φ 15

The Davis-Putnam Procedure Backtracking search through alternative assignments of truth values to literals µ = {literals to which we have assigned the value TRUE} initially empty For every unit clause l add l to µ remove clauses that contain l modify clauses that contain l If Φ contains, µ fails If Φ =, µ is a solution Select a Boolean variable P in Φ do two recursive calls Φ P Φ P Unit-propagate(Φ,µ) if Φ then return error in the book here if Φ = then exit with µ 16

Local Search Let u be an assignment of truth values to all of the variables cost(u,φ) = number of clauses in Φ that aren t satisfied by u flip(p,u) = u except that P s truth value is reversed Local search: Select a random assignment u while cost(u,φ) 0» if there is a P such that cost(flip(p,u),φ) < cost(u,φ) then randomly choose any such P u flip(p,u)» else return failure Local search is sound Boolean variable If it finds a solution it will find it very quickly Local search is not complete: can get trapped in local minima 17

Basic-GSAT: GSAT Select a random assignment u while cost(u,φ) 0» choose a P that minimizes cost(flip(p,u),φ), and flip it Not guaranteed to terminate GSAT: restart after a max number of flips return failure after a max number of restarts The book discusses several other stochastic procedures One is Walksat» works better than both local search and GSAT I ll skip the details 18

Recall the overall approach: Discussion for n = 0, 1, 2,,» encode (P,n) as a satisfiability problem Φ» if Φ is satisfiable, then From the set of truth values that satisfies Φ, extract a solution plan and return it By itself, not very practical (takes too much memory and time) But it can work well if combined with other techniques e.g., planning graphs 19

SatPlan SatPlan combines planning-graph expansion and satisfiability checking Works roughly as follows: for k = 0, 1, 2,» Create a planning graph that contains k levels» Encode the planning graph as a satisfiability problem» Try to solve it using a SAT solver If the SAT solver finds a solution within some time limit, - Remove some unnecessary actions - Return the solution Memory requirement still is combinatorially large but less than what s needed by a direct translation into satisfiability BlackBox (predecessor to SatPlan) was one of the best planners in the 1998 planning competition SatPlan was one of the best planners in the 2004 and 2006 planning competitions 20

Other Translation Approaches Translate planning problems into 0-1 integer programming problems Then solve them using an integer programming package such as CPLEX Techniques are somewhat similar to translation of planning to satisfiability Translate planning problems into constraint satisfaction problems Then solve them using CSP techniques such as arc consistency and path consistency For details, see Chapter 8 21