1 / 64

ENGG3190 Logic Synthesis “Boolean Satisfiability”

ENGG3190 Logic Synthesis “Boolean Satisfiability”. Winter 2014 S. Areibi School of Engineering University of Guelph. Outline. SAT Problem Terminology How do we solve it? Applications Logic Circuit Representation Efficiency. Boolean Satisfiability. What is SAT?

irma-sharpe
Download Presentation

ENGG3190 Logic Synthesis “Boolean Satisfiability”

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. ENGG3190Logic Synthesis“Boolean Satisfiability” Winter 2014 S. Areibi School of Engineering University of Guelph

  2. Outline • SAT Problem • Terminology • How do we solve it? • Applications • Logic Circuit Representation • Efficiency

  3. Boolean Satisfiability • What is SAT? • How to make a Boolean Function=1 • Why is it important • Application (Network Repair) • Conjunction Normal Form

  4. SAT in a Nutshell • Given a Boolean formula (propositional logic formula), find a variable assignment such that the formula evaluates to 1, or prove that no such assignment exists. • For n variables, there are 2n possible truth assignments to be checked. • First established NP-Complete problem. S. A. Cook, The complexity of theorem proving procedures, Proceedings, Third Annual ACM Symp. on the Theory of Computing,1971, 151-158 F =(a + b)(a’ + b’ + c) a 0 1 b b 0 1 1 0 c c c c 0 1 0 1 0 1 0 1

  5. Using BDDs to Solve SAT R. Bryant. “Graph-based algorithms for Boolean function manipulation”. IEEE Trans. on Computers, C-35, 8:677-691, 1986. • Store the function in a Directed Acyclic Graph (DAG) representation. Compacted form of the function decision tree. • Reduction rules guarantee canonicity under fixed variable order. • Provides for efficient Boolean function manipulation. •  Overkill for SAT.

  6. Why Bother? • Core computational engine for major applications • EDA • Testing and Verification • Logic synthesis • FPGA routing • Path delay analysis • And more… • AI • Knowledge base deduction • Automatic theorem proving

  7. For what values of d0,d1,d2,d3 can Z = 1??

  8. d (a + b) (a + b + d’) a d (a’ + d) b e (b’ + d) c e(c d) (c’ + d’ + e) (d + e’) (c + e’) Problem Representation • Conjunctive Normal Form • F = (a + b)(a’ + b’ + c) • Simple representation (more efficient data structures) • Logic circuit representation • Circuits have structural and direction information • Circuit – CNF conversion is straightforward!!! clause literal

  9. Clauses Negative Literal Positive Literal

  10. a = 0, b = 1  Clause = 1 Satisfied!! a = 0, b = 1  Clause = 1 Satisfied!! a = 0, b = 1  Clause = 0 Conflicting!! a = 0, b = 1 Unresolved!! • If a clause evaluates to a “0” we call it conflicting • It is conflicting because it conflicts with the goal of Boolean Satisfiability. • If a clause evaluates to a “1” we call it satisfied. • In the third clause since we only know the value of “a” it is unresolved!

  11. Deduction is at the heart of Boolean Satisfiability. • If we can deduce that other values must be assigned to some value for SAT • Example?

  12. Can BDDs help? • Yes but many Boolean functions are large and using BDDs will be complex!

  13. Boolean Satisfiability • Recursion to solve Satisfiability. • Boolean Constraint Propagation (BCP). • The Algorithm. • Limitation. • Code for SAT problem.

  14. 0 0 1 1 This clause has become unit C must be ‘0’ • However, only C is the deciding factor (exactly one unassigned literal found in the third clause). • What do we know?  c has to be a “0” so that c’=1 • We deduced by implication that c=0

  15. Satisfied Literal Unsatisfied Literal Unassigned Literal (a +b’+c)(b +c’)(a’ +c’) a = T, b = T, c is unassigned Implications and Boolean Constraint Propagation • Implication • A variable is forced to be assigned to be True or False based on previous assignments. • Unit clause rule (rule for elimination of one literal clauses) • An unsatisfied clause is a unit clause if it has exactly one unassigned literal. • The unassigned literal is implied because of the unit clause. • Boolean Constraint Propagation (BCP) • Iteratively apply the unit clause rule until there is no unit clause available. • a.k.a. Unit Propagation • Workhorse of DLL based algorithms.

  16. Phi has nine clauses (Omega1 – Omega9) • Not easy to say if Phi is Satisfiable!! Imagine thousands of clauses • If we perform the partial assignment then what happens?

  17. Nothing much happens? • I can’t satisfy any of these clauses yet. • So what should we do?

  18. Don’t worry about these .. • Assigning x1=1 implies that x2 has to equal to 1 and x3 also.!! • Which clauses imply this decision?

  19. W7 and W8 are already satisfied! (don’t worry about them) • What next?

  20. In gigantic circuits the BCP goes on and on ..

  21.  Unit  Unit • If X5=1 and X6=1 then w4 and w5 are unit (Satisfiable). • So we are making great progress … • We continue to uncover clauses that make unit to reach a solution. • So far so good! • What next?

  22. Unfortunately we have a conflict … • This is one reason of using recursion. • What should we do now? • Undo some previous decision taken that might have led to this situation!!

  23. So what is the name of the algorithm for the recursive framework?

  24. This the heart and soul of every SAT engine!! (50 years old) • It is famous and has an entry in Wikipedia.

  25. Lots of work on SAT. • What do you think research concentrated on to make the algorithm more efficient?

  26. DLL Algorithm • Davis, Logemann and Loveland M. Davis, G. Logemann and D. Loveland, “A Machine Program for Theorem-Proving", Communications of ACM, Vol. 5, No. 7, pp. 394-397, 1962 • Also known as DPLL for historical reasons • Basic framework for many modern SAT solvers

  27. Basic DLL Procedure - DFS (a’ + b + c) (a + c + d) (a + c + d’) (a + c’ + d) (a + c’ + d’) (b’ + c’ + d) (a’ + b + c’) (a’ + b’ + c)

  28. Basic DLL Procedure - DFS a (a’ + b + c) (a + c + d) (a + c + d’) (a + c’ + d) (a + c’ + d’) (b’ + c’ + d) (a’ + b + c’) (a’ + b’ + c)

  29. Basic DLL Procedure - DFS a (a’ + b + c) 0  Decision (a + c + d) (a + c + d’) (a + c’ + d) (a + c’ + d’) (b’ + c’ + d) (a’ + b + c’) (a’ + b’ + c)

  30. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0  Decision (a + c’ + d’) (b’ + c’ + d) (a’ + b + c’) (a’ + b’ + c)

  31. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 (a + c’ + d’) c (b’ + c’ + d) (a’ + b + c’) 0  Decision (a’ + b’ + c)

  32. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 (a + c’ + d’) c (b’ + c’ + d) (a’ + b + c’) 0 (a’ + b’ + c) (a + c + d) a=0 d=1 Conflict! Implication Graph c=0 d=0 (a + c + d’)

  33. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 (a + c’ + d’) c (b’ + c’ + d) (a’ + b + c’) 0 (a’ + b’ + c) (a + c + d) a=0 d=1 Conflict! Implication Graph c=0 d=0 (a + c + d’)

  34. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 (a + c’ + d’) c (b’ + c’ + d)  Backtrack (a’ + b + c’) 0 (a’ + b’ + c)

  35. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 (a + c’ + d’) c (b’ + c’ + d) (a’ + b + c’)  Forced Decision 0 1 (a’ + b’ + c) (a + c’ + d) a=0 d=1 Conflict! c=1 d=0 (a + c’ + d’)

  36. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 (a + c’ + d’) c (b’ + c’ + d)  Backtrack (a’ + b + c’) 0 1 (a’ + b’ + c)

  37. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d)  Forced Decision 0 1 (a + c’ + d’) c (b’ + c’ + d) (a’ + b + c’) 0 1 (a’ + b’ + c)

  38. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 1 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1  Decision (a’ + b’ + c) (a + c’ + d) a=0 d=1 Conflict! c=0 d=0 (a + c’ + d’)

  39. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 1 (a + c’ + d’) c c  Backtrack (b’ + c’ + d) (a’ + b + c’) 0 0 1 (a’ + b’ + c)

  40. Basic DLL Procedure - DFS a (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 1 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1  Forced Decision (a’ + b’ + c) (a + c’ + d) a=0 d=1 Conflict! c=1 d=0 (a + c’ + d’)

  41. Basic DLL Procedure - DFS a  Backtrack (a’ + b + c) 0 (a + c + d) (a + c + d’) b (a + c’ + d) 0 1 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c)

  42. Basic DLL Procedure - DFS a (a’ + b + c) 0 1  Forced Decision (a + c + d) (a + c + d’) b (a + c’ + d) 0 1 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c)

  43. Basic DLL Procedure - DFS a (a’ + b + c) 0 1 (a + c + d) (a + c + d’) b b (a + c’ + d) 0 1 0  Decision (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c)

  44. Basic DLL Procedure - DFS a (a’ + b + c) 0 1 (a + c + d) (a + c + d’) b b (a + c’ + d) 0 1 0 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c) (a’ + b + c) a=1 c=1 Conflict! b=0 c=0 (a’ + b + c’)

  45. Basic DLL Procedure - DFS a (a’ + b + c) 0 1 (a + c + d) (a + c + d’) b b  Backtrack (a + c’ + d) 0 1 0 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c)

  46. Basic DLL Procedure - DFS a (a’ + b + c) 0 1 (a + c + d) (a + c + d’) b b (a + c’ + d) 0 1 0  Forced Decision 1 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c) (a’ + b’ + c) a=1 c=1 b=1

  47. Basic DLL Procedure - DFS a (a’ + b + c) 0 1 (a + c + d) (a + c + d’) b b (a + c’ + d) 0 1 0 1 (a + c’ + d’) c c (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c) (a’ + b’ + c) (b’ + c’ + d) a=1 c=1 d=1 b=1

  48. Basic DLL Procedure - DFS a (a’ + b + c) 0 1 (a + c + d) (a + c + d’) b b (a + c’ + d) 0 1 0 1 (a + c’ + d’) c c  SAT (b’ + c’ + d) (a’ + b + c’) 0 0 1 1 (a’ + b’ + c) (a’ + b’ + c) (b’ + c’ + d) a=1 c=1 d=1 b=1

  49. Since problems are large (Vars, Literals, Clauses) we cannot use BDDs!! • What are available SAT code available?

More Related