boolean satisfiability
play

Boolean Satisfiability Example problem instance Naive algorithm - PowerPoint PPT Presentation

Boolean Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Boolean Satisfiability Example problem instance Naive algorithm pseudocode example Ari Mermelstein (with advisement from Professor Gu)


  1. Boolean Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Boolean Satisfiability Example problem instance Naive algorithm pseudocode example Ari Mermelstein (with advisement from Professor Gu) Motivation DPLL algorithm Unit Propagation Pure Literals DPLL with heuristics added CSc 76010 Parallel Scientific Computing, 2017 How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

  2. Boolean What is Satisfiability? Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Given: Example problem ◮ a set X of n Boolean variables, instance Naive algorithm (i.e. X = { x 1 , x 2 , · · · , x n } and each x i ∈ { 0 , 1 } ). pseudocode example ◮ a set of m clauses in Conjunctive Normal Form (CNF) Motivation (i.e. C = { c 1 , c 2 , · · · , c m } .) DPLL algorithm Each clause contains some of the variables, and for each Unit Propagation Pure Literals x ∈ X , either x or ¯ x appears. DPLL with heuristics added How to Parallelize Does an assignment, σ : X → { 0 , 1 } , exist such that for all Johnson’s Randomized c ∈ C , c = true . Approximation Algorithm How to parallelize

  3. Boolean Example Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Example problem instance Naive algorithm X = { x 1 , x 2 , x 3 } pseudocode example C = { x 1 ∨ ¯ x 2 , ¯ x 3 ∨ ¯ x 1 , x 3 ∨ x 1 ∨ x 2 } Motivation The set of clauses C, is also known as a formula. DPLL algorithm Unit Propagation Pure Literals DPLL with heuristics added How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

  4. Boolean Naive algorithm Satisfiability Result: A boolean true or false Ari Mermelstein (with advisement Input: A set of variables X[1..n] from Professor Gu) Input: A formula F[1..m] Statement of the Let satisfied[1..m] and assign[1..n] be new arrays; Problem Initialize(assign) ; // set all assignments to 0 Example problem instance while NotAllOnes(assign) do Naive algorithm Increment(assign) ; // change the assignment in pseudocode example one position, treating assign like a binary Motivation number DPLL algorithm Initialize(satisfied); Unit Propagation Pure Literals for i=1 to m do DPLL with heuristics added How to Parallelize satisfied [ i ] = evaluate ( F [ i ]); Johnson’s if all c ∈ C are satisfied then Randomized Approximation return true; Algorithm end How to parallelize end return false; end

  5. Boolean Example Satisfiability Ari Mermelstein (with advisement from Professor Gu) X = { x 1 , x 2 , x 3 } Statement of the Problem C = { x 1 ∨ ¯ x 2 , ¯ x 3 ∨ ¯ x 1 , x 3 ∨ x 1 ∨ x 2 } Example problem instance ◮ We will start with x 1 = 0, x 2 = 0, and x 3 = 0 . Naive algorithm With this assignment, we obtain: pseudocode example 0 ∨ 1, 1 ∨ 1, 0 ∨ 0 ∨ 0. Motivation which is equal to 1 , 1, 0. DPLL algorithm This is not satisfiable. Unit Propagation Pure Literals DPLL with heuristics ◮ We move on to x 1 = 0, x 2 = 0, and x 3 = 1 . added How to Parallelize We obtain: 0 ∨ 1, 0 ∨ 1, 1 ∨ 0 ∨ 0 Johnson’s which is equal to 1 , 1 , 1. Randomized Approximation This is satisfiable! Algorithm How to parallelize

  6. Boolean Comment and Motivation for presentation Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem The algorithm on the previous slides take Θ(2 n ) time to run. Example problem instance We need to be able to use heuristics and approximations to Naive algorithm solve this problem faster. There are 2 approaches: pseudocode example ◮ modified brute force using heuristics, such as DPLL Motivation algorithm ( Davis, Putnam, Logemann, Loveland 1962). DPLL algorithm Unit Propagation Pure Literals ◮ randomized approximation algorithms, such as DPLL with heuristics added Johnson’s MAX-SAT approximation algorithm (1974). How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

  7. Boolean DPLL Algorithm (1962) Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem The idea of the DPLL algorithm is that you start with a Example problem instance formula F and a partial interpretation I, where initially, Naive algorithm I = ∅ . pseudocode example Evaluate F using the assignments in I. If all of the clauses in Motivation F are true using the assignments in I, then F is satisfiable. If DPLL algorithm at least one clause is definitely false using the assignments in Unit Propagation Pure Literals I, then F is not satisfiable. If there are some clauses for DPLL with heuristics added which you can not tell, we pick an assignment for a varaible, How to Parallelize Johnson’s x i / ∈ I and add it to I, and recursively repeat the process. Randomized Approximation Algorithm How to parallelize

  8. Boolean Pseudocode for DPLL-SAT(X,F, I) Satisfiability Ari Mermelstein (with advisement Result: A Boolean true or false from Professor Gu) Input: A set of variables X[1..n] Statement of the Input: A formula F Problem Input: A partial interpretation I Example problem instance if I ⇒ F then Naive algorithm return true; pseudocode example end Motivation else if I ⇒ ¬ F then DPLL algorithm return false; Unit Propagation Pure Literals DPLL with heuristics end added How to Parallelize else Johnson’s choose x i / ∈ I ; Randomized Approximation return DPLL-SAT(X, F, I ∪ { x i = 1 } ) or DPLL-SAT(X, Algorithm F, I ∪ { x i = 0 } ); How to parallelize end

  9. Boolean Analysis of the above algorithm Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Example problem instance At the moment this is just an elegant way of doing the Naive Naive algorithm pseudocode Algorithm above. However, we should add two heuristics: example Motivation ◮ Unit Propagation DPLL algorithm ◮ Choosing assignment of pure literals Unit Propagation Pure Literals DPLL with heuristics added How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

  10. Boolean Unit Propagation Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Example problem instance ◮ We view F as having the unit rules from I added into it. Naive algorithm ◮ When we consider these assignments, we can remove pseudocode example some variables from the clauses of F that have no Motivation bearing on the final result. DPLL algorithm Unit Propagation ◮ This is accomplished by removing the negation of all Pure Literals DPLL with heuristics variables of the assignment from the clauses of F. added How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

  11. Boolean Example Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Suppose that F = { x 1 ∨ ¯ x 2 , ¯ x 3 ∨ ¯ x 1 , x 3 ∨ x 1 ∨ x 2 } . and Example problem I = { x 3 = 1 } instance Naive algorithm pseudocode ◮ That tells us that x 3 is true, and hence ¯ x 3 is false. example Motivation ◮ We know that ¯ x 3 has no bearing on the truth value of DPLL algorithm the clauses in which ¯ x 3 is part. (we can remove ”false” Unit Propagation Pure Literals from an or statement). DPLL with heuristics added How to Parallelize ◮ So we can simplify F to be Johnson’s F = { x 1 ∨ ¯ x 2 , ¯ x 1 , x 3 ∨ x 1 ∨ x 2 } . Randomized Approximation Algorithm How to parallelize

  12. Boolean Pure Literals Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Example problem instance ◮ If a variable only appears positively, (i.e. for any given Naive algorithm variable x i , ¯ x i never appears) then we don’t lose pseudocode example anything by deciding to set it to true. Motivation ◮ If a variable only appears negatively, (i.e. for any given DPLL algorithm Unit Propagation variable x i , x i itself never appears) then we don’t lose Pure Literals DPLL with heuristics anything by deciding to set it to false. added How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

  13. Boolean Example Satisfiability Ari Mermelstein (with advisement from Professor Gu) Statement of the Problem Example problem instance Naive algorithm Suppose that F = { x 1 ∨ ¯ x 2 , ¯ x 3 ∨ x 1 , x 3 ∨ x 1 ∨ x 2 } . pseudocode example We see that x 1 only appears positively, so we will choose to Motivation set it to 1, and update I = I ∪ { x 1 = 1 } . DPLL algorithm Unit Propagation Pure Literals DPLL with heuristics added How to Parallelize Johnson’s Randomized Approximation Algorithm How to parallelize

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

Recommend


More recommend