Satisfiability: Applications and Algorithms Jim Kukula [email_address]
Outline <ul><li>Boolean functions and expressions </li></ul><ul><li>Applications and related formalisms </li></ul><ul><li>...
Boolean Functions <ul><li>Bit vector </li></ul><ul><li>Corners of  n -dimensional cube </li></ul><ul><li>Base-2 coded inte...
Truth Table <ul><li>Read-only memory is like this:  </li></ul><ul><ul><li>Addr_in -> data_out </li></ul></ul><ul><ul><li>1...
Composing Functions a b b c
Logic Optimization <ul><li>Very difficult to find optimal expression for a given Boolean function </li></ul><ul><ul><li>Ga...
2-Level Expressions <ul><li>DNF: Disjunctive Normal Form </li></ul><ul><li>CNF: Conjunctive Normal Form </li></ul>
Decision Tree a b b c c c c 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
Pruning Unnecessary Nodes a b b c c 1 1 0 0 1 0 0 0 0 0 0 1 1 1 1 1
Reusing Duplicate Nodes a b b c 1 1 0 0 0 0 0 0 1 1 1 1 Tree becomes  Diagram , or  BDD
Binary Decision Diagrams <ul><li>Breakthrough paper  </li></ul>Randy Bryant, Graph - Based Algorithms for Boolean Function...
BDD Manipulation <ul><li>BDDs are canonical, given variable order </li></ul><ul><ul><li>Trivial to check function equality...
Formalized Decisions <ul><li>Boolean Functions </li></ul><ul><ul><li>Set of fixed length strings </li></ul></ul><ul><li>St...
Computational Problems <ul><li>Optimizing expressions </li></ul><ul><ul><li>Language in which machine expressed </li></ul>...
Applications for Satisfiability <ul><li>Given a Boolean function, find an input bit vector for which the function evaluate...
Bounded Emptiness <ul><li>Convert infinite set to finite set </li></ul><ul><ul><li>Bound length of string </li></ul></ul><...
Satisfiability Community <ul><li>International Conference on Theory and Applications of Satisfiability Testing </li></ul><...
Dimacs Format p cnf 59056 323700 1 2 0 1 3 0 1 4 0 1 -5 0 1 6 0 1 -7 0 1 -8 0 1 -9 0 1 -10 0 -2 -3 -4 5 -6 7 8 9 10 -1 0 -...
Random CNF P(Sat) 1 0 # Clauses / # Variables 1 0 2 3 4 5 6 7 Limit for large #V Small #V
Algorithms <ul><li>CNF Resolution </li></ul><ul><li>BDD variable elimination </li></ul><ul><li>Local Search </li></ul><ul>...
Resolution <ul><li>Exhaustive application will yield empty clause if problem is unsatisfiable </li></ul><ul><ul><li>3 n  p...
BDD Variable Elimination <ul><li>Construction of BDD from circuit often infeasible </li></ul><ul><ul><li>Intermediate blow...
Local Search <ul><li>Generally implemented with CNF </li></ul><ul><li>Start by assigning arbitrary value to each variable ...
Stuck-at Fault Model Circuit as designed Circuit as manufactured Test generation:   find a input bit vector that will prod...
Circuit-Based SAT 1 Can we find input assignments to drive the circuit output to 1?
Circuit-Based SAT 1 1 1 Inputs to AND must be 1 for output to be 1
Circuit-Based SAT 1 1 1 0 At least one input of NAND must be 0 for output to be 1, so we make a choice.
Circuit-Based SAT 1 1 1 1 0 1 Inputs to NAND must be 1 for output to be 0
Circuit-Based SAT 1 1 1 1 0 1 1 1 Inputs to AND must be 1 for output to be 1
Circuit-Based SAT 1 1 1 1 0 1 1 1 Conflict!  need to backtrack and make different choices
Loosely Coupled Subproblems <ul><li>Subproblems revisited many times </li></ul><ul><li>Need to save and reuse learning </l...
Landmark Papers in CNF SAT <ul><li>Joao Marques-Silva and Karem Sakallah, “ GRASP: A Search Algorithm for Propositional Sa...
CNF Decision & Implication Decide:
CNF Decision & Implication Decide: Imply:
CNF Decision & Implication Decide: Imply: Imply:
CNF Decision & Implication Decide: Imply: Imply: Imply:
CNF Decision & Implication Decide: Imply: Imply: Imply: Decide:
CNF Decision & Implication Decide: Imply: Imply: Imply: Decide: Imply:
Implication Graph Chains of implication  linked by pairs of clauses  with common variable  but opposite signs: opportuniti...
Learned Clauses Cut in implication graph corresponds to learned clause derivable by resolution Look for small cuts –  shor...
Leveraging Structure <ul><li>SAT is very hard in the worst case </li></ul><ul><li>But practical instances often manageable...
Upcoming SlideShare
Loading in …5
×

Satisfiability

856 views

Published on

An introductory survey of applications and algorithms for the satisfiability problem

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
856
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
19
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Satisfiability

  1. 1. Satisfiability: Applications and Algorithms Jim Kukula [email_address]
  2. 2. Outline <ul><li>Boolean functions and expressions </li></ul><ul><li>Applications and related formalisms </li></ul><ul><li>Satisfiability Algorithms </li></ul><ul><ul><li>Expression-Based </li></ul></ul><ul><ul><li>Assignment-Based </li></ul></ul>
  3. 3. Boolean Functions <ul><li>Bit vector </li></ul><ul><li>Corners of n -dimensional cube </li></ul><ul><li>Base-2 coded integer </li></ul><ul><li>True/false </li></ul><ul><li>In/out of set </li></ul><ul><li>Pass/fail </li></ul>
  4. 4. Truth Table <ul><li>Read-only memory is like this: </li></ul><ul><ul><li>Addr_in -> data_out </li></ul></ul><ul><ul><li>16 address bits enough to store a book </li></ul></ul><ul><ul><li>No way, in general, to squeeze n bit values into any smaller space </li></ul></ul>a b c
  5. 5. Composing Functions a b b c
  6. 6. Logic Optimization <ul><li>Very difficult to find optimal expression for a given Boolean function </li></ul><ul><ul><li>Gate count </li></ul></ul><ul><ul><li>Longest path from input to output </li></ul></ul><ul><li>Any function has infinite expressions </li></ul><ul><li>Most functions require exponential space </li></ul><ul><ul><li>Counting argument: Boolean functions with n variables </li></ul></ul>
  7. 7. 2-Level Expressions <ul><li>DNF: Disjunctive Normal Form </li></ul><ul><li>CNF: Conjunctive Normal Form </li></ul>
  8. 8. Decision Tree a b b c c c c 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
  9. 9. Pruning Unnecessary Nodes a b b c c 1 1 0 0 1 0 0 0 0 0 0 1 1 1 1 1
  10. 10. Reusing Duplicate Nodes a b b c 1 1 0 0 0 0 0 0 1 1 1 1 Tree becomes Diagram , or BDD
  11. 11. Binary Decision Diagrams <ul><li>Breakthrough paper </li></ul>Randy Bryant, Graph - Based Algorithms for Boolean Function Manipulation . IEEE Transaction on Computers, 1986 http:// vlsi.colorado.edu/~fabio/CUDD / <ul><li>High quality public package </li></ul>
  12. 12. BDD Manipulation <ul><li>BDDs are canonical, given variable order </li></ul><ul><ul><li>Trivial to check function equality, satisfiability </li></ul></ul><ul><li>Often compact </li></ul><ul><ul><li>Optimizing variable order is difficult </li></ul></ul><ul><ul><ul><li>Interleave bits of an adder! </li></ul></ul></ul><ul><li>BDD for (f&g) can be computed efficiently, from BDD for f and BDD for g </li></ul>
  13. 13. Formalized Decisions <ul><li>Boolean Functions </li></ul><ul><ul><li>Set of fixed length strings </li></ul></ul><ul><li>State Machines </li></ul><ul><ul><li>Regular languages </li></ul></ul><ul><li>Turing Machines </li></ul><ul><ul><li>Universal computability </li></ul></ul>
  14. 14. Computational Problems <ul><li>Optimizing expressions </li></ul><ul><ul><li>Language in which machine expressed </li></ul></ul><ul><ul><li>Optimality criteria </li></ul></ul><ul><li>Language Emptiness </li></ul><ul><ul><li>Boolean Functions </li></ul></ul><ul><ul><ul><li>NP-Complete </li></ul></ul></ul><ul><ul><li>Finite State Machines </li></ul></ul><ul><ul><ul><li>P-Space Complete </li></ul></ul></ul><ul><ul><li>Turing Machines </li></ul></ul><ul><ul><ul><li>Undecidable </li></ul></ul></ul>
  15. 15. Applications for Satisfiability <ul><li>Given a Boolean function, find an input bit vector for which the function evaluates to 1 </li></ul><ul><ul><li>Artificial Intelligence </li></ul></ul><ul><ul><ul><li>E.g. medical diagnosis </li></ul></ul></ul><ul><ul><li>Operations Research </li></ul></ul><ul><ul><ul><li>Optimizing over discrete domains </li></ul></ul></ul><ul><ul><li>Electronics Engineering </li></ul></ul><ul><ul><ul><li>Detecting faults </li></ul></ul></ul><ul><ul><li>Computer Science </li></ul></ul><ul><ul><ul><li>Check resource contention </li></ul></ul></ul>
  16. 16. Bounded Emptiness <ul><li>Convert infinite set to finite set </li></ul><ul><ul><li>Bound length of string </li></ul></ul><ul><ul><li>Discretize space </li></ul></ul><ul><li>Use SAT to attack harder problems </li></ul><ul><ul><li>E.g. Bounded Model Checking </li></ul></ul>
  17. 17. Satisfiability Community <ul><li>International Conference on Theory and Applications of Satisfiability Testing </li></ul><ul><ul><li>http://ie.technion.ac.il/SAT10/ (Edinburgh) </li></ul></ul><ul><li>Journal on Satisfiability, Boolean Modeling and Computation </li></ul><ul><ul><li>http:// www.isa.ewi.tudelft.nl/Jsat / </li></ul></ul><ul><li>Up-to-date links concerning research </li></ul><ul><ul><li>http:// www.satlive.org / </li></ul></ul>
  18. 18. Dimacs Format p cnf 59056 323700 1 2 0 1 3 0 1 4 0 1 -5 0 1 6 0 1 -7 0 1 -8 0 1 -9 0 1 -10 0 -2 -3 -4 5 -6 7 8 9 10 -1 0 -11 -12 -13 14 0 -14 11 0 -14 12 0 -14 13 0
  19. 19. Random CNF P(Sat) 1 0 # Clauses / # Variables 1 0 2 3 4 5 6 7 Limit for large #V Small #V
  20. 20. Algorithms <ul><li>CNF Resolution </li></ul><ul><li>BDD variable elimination </li></ul><ul><li>Local Search </li></ul><ul><li>Circuit-based value assignment </li></ul><ul><li>Conflict-based Learning </li></ul>
  21. 21. Resolution <ul><li>Exhaustive application will yield empty clause if problem is unsatisfiable </li></ul><ul><ul><li>3 n potential clauses! </li></ul></ul>
  22. 22. BDD Variable Elimination <ul><li>Construction of BDD from circuit often infeasible </li></ul><ul><ul><li>Intermediate blow-up even if ultimate answer is trivial </li></ul></ul><ul><li>Interleave existential quantification </li></ul><ul><ul><li>Eliminating variables often reduces BDD sizes </li></ul></ul><ul><ul><li>Finding an order of variables to eliminate is difficult </li></ul></ul><ul><ul><ul><li>Keep the support sizes small of intermediate results </li></ul></ul></ul><ul><ul><ul><li>Equivalent to elimination with sparse matrices </li></ul></ul></ul>
  23. 23. Local Search <ul><li>Generally implemented with CNF </li></ul><ul><li>Start by assigning arbitrary value to each variable </li></ul><ul><li>Flip values of variables one by one </li></ul><ul><ul><li>Any variable that appears in a false clause is a candidate </li></ul></ul><ul><li>Gradually reduce number of false clauses </li></ul><ul><li>Need mechanism to escape local minima </li></ul><ul><li>No proof of unsatisfiability </li></ul>
  24. 24. Stuck-at Fault Model Circuit as designed Circuit as manufactured Test generation: find a input bit vector that will produce different outputs in correct versus faulty circuits 1
  25. 25. Circuit-Based SAT 1 Can we find input assignments to drive the circuit output to 1?
  26. 26. Circuit-Based SAT 1 1 1 Inputs to AND must be 1 for output to be 1
  27. 27. Circuit-Based SAT 1 1 1 0 At least one input of NAND must be 0 for output to be 1, so we make a choice.
  28. 28. Circuit-Based SAT 1 1 1 1 0 1 Inputs to NAND must be 1 for output to be 0
  29. 29. Circuit-Based SAT 1 1 1 1 0 1 1 1 Inputs to AND must be 1 for output to be 1
  30. 30. Circuit-Based SAT 1 1 1 1 0 1 1 1 Conflict! need to backtrack and make different choices
  31. 31. Loosely Coupled Subproblems <ul><li>Subproblems revisited many times </li></ul><ul><li>Need to save and reuse learning </li></ul><ul><li>CNF is simple & incremental </li></ul>… A B C D E U V W
  32. 32. Landmark Papers in CNF SAT <ul><li>Joao Marques-Silva and Karem Sakallah, “ GRASP: A Search Algorithm for Propositional Satisfiability ,” ICCAD 1996 </li></ul><ul><li>Matthew W. Moskewicz,  Conor F. Madigan,  Ying Zhao,  Lintao Zhang,  Sharad Malik, “ Chaff: Engineering an Efficient SAT Solver, ” DAC 2001 </li></ul>
  33. 33. CNF Decision & Implication Decide:
  34. 34. CNF Decision & Implication Decide: Imply:
  35. 35. CNF Decision & Implication Decide: Imply: Imply:
  36. 36. CNF Decision & Implication Decide: Imply: Imply: Imply:
  37. 37. CNF Decision & Implication Decide: Imply: Imply: Imply: Decide:
  38. 38. CNF Decision & Implication Decide: Imply: Imply: Imply: Decide: Imply:
  39. 39. Implication Graph Chains of implication linked by pairs of clauses with common variable but opposite signs: opportunities for resolution
  40. 40. Learned Clauses Cut in implication graph corresponds to learned clause derivable by resolution Look for small cuts – short clauses are tighter constraints
  41. 41. Leveraging Structure <ul><li>SAT is very hard in the worst case </li></ul><ul><li>But practical instances often manageable </li></ul><ul><ul><li>Test Generation, Equivalence Checking </li></ul></ul><ul><ul><ul><li>similarity of two halves of problem </li></ul></ul></ul><ul><ul><li>Bounded Model Checking </li></ul></ul><ul><ul><ul><li>Repetitive structure </li></ul></ul></ul><ul><ul><li>Arithmetic </li></ul></ul><ul><ul><ul><li>Bit order </li></ul></ul></ul>

×