html5-img
1 / 31

GRASP-an efficient SAT solver

GRASP-an efficient SAT solver. Pankaj Chauhan. What is SAT?. Given a propositional formula in CNF, find an assignment to boolean variables that makes the formula true! E.g.  1 = (x 2  x 3 )  2 = (  x 1  x 4 )  3 = (  x 2  x 4 ) A = {x 1 =0, x 2 =1, x 3 =0, x 4 =1}.

Download Presentation

GRASP-an efficient SAT solver

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GRASP-an efficient SAT solver Pankaj Chauhan

  2. What is SAT? • Given a propositional formula in CNF, find an assignment to boolean variables that makes the formula true! • E.g. 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) A = {x1=0, x2=1, x3=0, x4=1} SATisfying assignment! 15-398: GRASP and Chaff

  3. What is SAT? • Solution 1: Search through all assignments! • n variables 2n possible assignments, explosion! • SAT is a classic NP-Complete problem, solve SAT and P=NP! 15-398: GRASP and Chaff

  4. Why SAT? • Fundamental problem from theoretical point of view • Numerous applications • CAD, VLSI • Optimization • Model Checking and other type of formal verification • AI, planning, automated deduction 15-398: GRASP and Chaff

  5. Outline • Terminology • Basic Backtracking Search • GRASP • Pointers to future work Please interrupt me if anything is not clear! 15-398: GRASP and Chaff

  6. Terminology • CNF formula  • x1,…, xn: n variables • 1,…, m: m clauses • Assignment A • Set of (x,v(x)) pairs • |A| < n  partial assignment {(x1,0), (x2,1), (x4,1)} • |A| = n  complete assignment {(x1,0), (x2,1), (x3,0), (x4,1)} • |A= 0  unsatisfyingassignment {(x1,1), (x4,1)} • |A= 1  satisfying assignment {(x1,0), (x2,1), (x4,1)} 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) A = {x1=0, x2=1, x3=0, x4=1} 15-398: GRASP and Chaff

  7. Terminology • Assignment A (contd.) • |A= X  unresolved {(x1,0), (x2,0), (x4,1)} • An assignment partitions the clause databaseinto three classes • Satisfied, unsatisfied, unresolved • Free literals: unassigned literals of a clause • Unitclause: #free literals = 1 15-398: GRASP and Chaff

  8. Basic Backtracking Search • Organize the search in the form of a decision tree • Each node is an assignment, called decision assignment • Depth of the node in the decision tree decision level (x) • x=v@d  xis assigned tovat decision leveld 15-398: GRASP and Chaff

  9. Basic Backtracking Search • Iterate through: • Make new decision assignments to explore new regions of search space • Infer implied assignments by a deduction process. May lead to unsatisfied clauses, conflict! The assignment is called conflicting assignment. • Conflicting assignments leads to backtrack to discard the search subspace 15-398: GRASP and Chaff

  10. x1 x1 = 0@1 x2 x2 = 0@2 Backtracking Search in Action 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) x1 = 1@1  x4 = 0@1  x2 = 0@1  x3 = 1@1  x3 = 1@2 {(x1,1), (x2,0), (x3,1) , (x4,0)} {(x1,0), (x2,0), (x3,1)} No backtrack in this example! 15-398: GRASP and Chaff

  11. x1 x1 = 0@1 x1 = 1@1 x2 x2 = 0@2 Backtracking Search in Action Add a clause 1 = (x2  x3) 2 = (x1  x4) 3 = (x2  x4) 4 = (x1  x2  x3)  x4 = 0@1  x2 = 0@1  x3 = 1@1  x3 = 1@2 conflict {(x1,0), (x2,0), (x3,1)} 15-398: GRASP and Chaff

  12. Davis-Putnam revisited Deduction Decision Backtrack 15-398: GRASP and Chaff

  13. GRASP • GRASP is Generalized seaRch Algorithm for the Satisfiability Problem (Silva, Sakallah, ’96) • Features: • Implication graphs for BCP and conflict analysis • Learning of new clauses • Non-chronological backtracking! 15-398: GRASP and Chaff

  14. GRASP search template 15-398: GRASP and Chaff

  15. GRASP Decision Heuristics • Procedure decide() • Choose the variable that satisfies the most #clauses == max occurences as unit clauses at current decision level • Other possibilities exist 15-398: GRASP and Chaff

  16. GRASP Deduction • Boolean Constraint Propagation using implication graphs E.g. for the clause  = (x y), ify=1, then we must havex=1 • For a variable xoccuring in a clause , assignment 0 to all other literals is calledantecedent assignmentA(x) • E.g. for  = (x y  z), A(x) = {(y,0), (z,1)}, A(y) = {(x,0),(z,1)}, A(z) = {(x,0), (y,0)} • Variables directly responsible for forcing the value ofx • Antecedent assignment of a decision variable is empty 15-398: GRASP and Chaff

  17. Implication Graphs • Nodes are variable assignments x=v(x) (decision or implied) • Predecessors of x are antecedent assignments A(x) • No predecessors for decision assignments! • Special conflict vertices have A() = assignments to vars in the unsatisfied clause • Decision level for an implied assignment is (x) = max{(y)|(y,v(y))A(x)} 15-398: GRASP and Chaff

  18. 4 x2=1@6 x5=1@6 1 4 3 6 x4=1@6  conflict 6 3 2 5 2 5 x6=1@6 x3=1@6 Example Implication Graph Current truth assignment: {x9=0@1 ,x10=0@3, x11=0@3, x12=1@2, x13=1@2} Current decision assignment: {x1=1@6} x10=0@3 1 = (x1  x2) 2 = (x1  x3  x9) 3 = (x2  x3  x4) 4 = (x4  x5  x10) 5 = (x4  x6  x11) 6 = (x5  x6) 7 = (x1  x7  x12) 8 = (x1 x8) 9 = (x7  x8   x13) x1=1@6 x9=0@1 x11=0@3 15-398: GRASP and Chaff

  19. GRASP Deduction Process 15-398: GRASP and Chaff

  20. GRASP Conflict Analysis • After a conflict arises, analyze the implication graph at current decision level • Add new clauses that would prevent the occurrence of the same conflict in the future  Learning • Determine decision level to backtrack to, might not be the immediate one  Non-chronological backtrack 15-398: GRASP and Chaff

  21. Learning • Determine the assignment that caused the conflict, negation of this assignment is called conflict induced clause C() • The conjunct of this assignment is necessary condition for  • So adding C() will prevent the occurrenceof  again 15-398: GRASP and Chaff

  22. Learning • Find C() by a backward traversal of the IG, find the roots of the IG in the transitive fanin of  • For our example IG, C() = (x1  x9  x10  x11) 15-398: GRASP and Chaff

  23. (x,v(x)) if A(x) =  causesof(x) = (x)  [  causesof(y)]o/w (y,v(y))  (x) Learning (some math) • For any node of an IG x, partition A(x) into (x) = {(y,v(y)) A(x)|(y)<(x)} (x) = {(y,v(y)) A(x)|(y)=(x)} • Conflicting assignment AC() = causesof(), where 15-398: GRASP and Chaff

  24. C() =  xv(x) (x,v(x))  AC() Learning (some math) • Deriving conflicting clause C()from the conflicting assignment AC() is straight forward • For our IG, AC() = {x1=1@6, x9 =0@1, x10 = 0@3, x11 = 0@3} 15-398: GRASP and Chaff

  25. Learning • Unique implication points (UIPs) of an IG also provide conflict clauses • Learning of new clauses increases clause database size • Heuristically delete clauses based on a user parameter • If size of learned clause > parameter, don’t include it 15-398: GRASP and Chaff

  26. Backtracking Failure driven assertions (FDA): • If C() involves current decision variable, then after addition, it becomes unit clause, so different assignment for the current variable is immediately tried. • In our IG, after erasing the assignment at level 6, C() becomes a unit clause x1 • This immediately implies x1=0 15-398: GRASP and Chaff

  27. Continued IG Decision level 3 x8=1@6 x9=0@1 C() 8 9 x10=0@3 5 ’ x13=1@2 x1=0@6 C() 9 9 C() 7 x11=0@3 x7=1@6 x1 7 6 x12=1@2 Due to C()  ’ 15-398: GRASP and Chaff

  28. Backtracking Conflict Directed Backtracking • Now deriving a new IG after setting x1=0 by FDA, we get another conflict ’ • Non-chronological backtrack to decision level 3, because backtracking to any level 5, 4 would generate the same conflict ’ 15-398: GRASP and Chaff

  29. Backtracking Conflict Directed Backtracking contd. • Backtrack level is given by • = d-1chronological backtrack • < d-1non-chronological backtrack AC(’) = {x9 =0@1, x10 = 0@3, x11 = 0@3, x12=1@2, x13=1@2} C() = (x9  x10  x11   x12   x13)  = max{(x)|(x,v(x))AC(’)} 15-398: GRASP and Chaff

  30. Procedure Diagnose() 15-398: GRASP and Chaff

  31. Is that all? • Huge overhead for constraint propagation • Better decision heuristics • Better learning, problem specific • Better engineering! Chaff 15-398: GRASP and Chaff

More Related