1 / 68

Sampling Techniques for Boolean Satisfiability

Kuldeep S Meel 1 (Joint work with Supratik Chakraborty 2 , Moshe Y Vardi 1 ). Sampling Techniques for Boolean Satisfiability. 1 Department of Computer Science, Rice University 2 Indian Institute of Technology Bombay, India. COMP 600. Sept 9, 2013. Life in The 21 st Century!.

washi
Télécharger la présentation

Sampling Techniques for 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. Kuldeep S Meel1 (Joint work with Supratik Chakraborty2, Moshe Y Vardi1) Sampling Techniques for Boolean Satisfiability 1Department of Computer Science, Rice University 2Indian Institute of Technology Bombay, India COMP 600 Sept 9, 2013

  2. Life in The 21st Century! Was my “I Love You” message/email to my girlfriend delivered to her or her roommate?

  3. Life in The 21st Century! How do we guarantee that the systems work correctly ?

  4. Motivating Example • How do we verify that this circuit works ? • Try for all values of a and b • 2128 possibilities (1022 years) • Not scalable • Randomly sample some a’s and b’s • Wait! None of the circuits in the past faulted when 10 < b < 40 • Finite resources! • Let’s sample from regions where it is likely to fault b a 64 bit 64 bit c = ab 64 bit c

  5. Constraints Design • Designing Constraints • Designers: • 100 < b < 200 • 300 < a < 451 • 40 < a < 50 and 30 < b < 40 • Past Experience: • 400 < a < 2000 • 120 < b < 230 • Users: • 1000<a < 1100 • 20000 < b < a < 22000 b a 64 bit 64 bit c = ab 64 bit c Problem: How can we uniformly sample the values of a and b satisfying the above constraints?

  6. Uniform Generation of SAT-Witnesses Set of Constraints SAT Formula (a V b) {(0,1), (1,0), (1,1)} SAT is NP-complete (Cook 1971)

  7. Uniform Generation of SAT-Witnesses Set of Constraints SAT Formula Given a SAT formula, can one uniformly sample solutions without enumerating all solutions Uniform Generation of SAT-Witnesses

  8. Uniform Generation of SAT-Witnesses Set of Constraints SAT Formula Given a SAT formula, can one uniformly sample solutions without enumerating all solutions while scaling to real world problems? Scalable Uniform Generation of SAT-Witnesses

  9. Overview • Uniform Generation of SAT-witnesses • Approximate Model Counting • Future Directions

  10. Overview • Uniform Generation of SAT-witnesses • Approximate Model Counting • Future Directions

  11. Prior Work BDD-based Guarantees: strong Performance: weak SAT-based heuristics Guarantees: weak Performance: strong INDUSTRY • Theoretical Work • Guarantees: strong • Performance: weak • Heuristic Work • Guarantees: weak • Performance: strong ACADEMIA BGP Algorithm XORSample’

  12. Our Contribution BDD-based Guarantees: strong Performance: weak SAT-based heuristics Guarantees: weak Performance: strong INDUSTRY UniWit Guarantees : strong Performance: strong • Theoretical Work • Guarantees: strong • Performance: weak • Heuristic Work • Guarantees: weak • Performance: strong ACADEMIA BGP Algorithm XORSample’

  13. Central Idea

  14. Partitioning into equal “small” cells

  15. How to Partition? How to partition into roughly equal small cells of solutions without knowing the distribution of solutions? Universal Hashing [Carter-Wegman 1979, Sipser 1983]

  16. Universal Hashing • Hash functions from mapping {0,1}n to {0,1}m (2n elements to 2m cells) • Random data => All cells are roughly small • Universal hash functions: • Adversarial data => All cells are roughly small • Need stronger bounds on range of the size of cells

  17. Lower Universality Lower Complexity • H(n,m,r): Family of r-universal hash functionsmapping {0,1}n to {0,1}m (2n elements to 2m cells) • Higher the r => Stricter guarantees on range of size of cells • r-wise universality => Polynomials of degree r-1 • Lower universality => lower complexity

  18. Hashing-Based Approaches Solution space n-universal hashing BGP Algorithm All cells should be small Uniform Generation

  19. Scaling to Thousands of Variables Solution space n-universal hashing 2-universal hashing Random BGP Algorithm UniWit Only a randomly chosen cells needs to be “small” All cells should be small Uniform Generation Near Uniform Generation

  20. Scaling to Thousands of Variables Solution space n-universal hashing 2-independent hashing From tens of variables to thousands of variables! Random BGP Algorithm UniWit Only a randomly chosen cells needs to be “small” All cells should be small Uniform Generation Near Uniform Generation

  21. Highlights • Employs XOR-based hash functions instead of computationally infeasible algebraic hash functions • Uses off-the-shelf SAT solver CryptoMiniSAT (MiniSAT+XOR support)

  22. Strong Theoretical Guarantees • Uniformity • For every solution y of RF • Pr [y is output] = 1/|RF|

  23. Strong Theoretical Guarantees • Near Uniformity • Success Probability • Polynomial calls to SAT Solver • For every solution y of RF • Pr [y is output] >= 1/8 x 1/|RF| Algorithm UniWit succeeds with probability at least 1/8

  24. Experimental Methodology • Benchmarks (over 200) • Bit-blasted versions of word-level constraints from VHDL designs • Bit-blasted versions from SMTLib version and ISCAS’85 • Objectives • Comparison with algorithms BGP &XORSample’ • Uniformity • Performance

  25. Better Uniformity than State-of-art Generators UniWit XORSample’ • Benchmark: case110.cnf; #var: 287; #clauses: 1263 • Total Runs: 1.08x108;Total Solutions : 16384 • XORSample’ could not find 772 solutions and more than 250 solutions were generated only once

  26. Results : Performance

  27. Results : Performance • UniWitis is 2-3 orders of magnitude faster than XORSample’ • Observed success probability = 0.6 ( >> theoretical guarantee of 0.125)

  28. The Story So Far • Theoretical guarantees of near uniformity • Major improvements in running time and uniformity compared to existing generators • But………. How many samples should I test my system to achieve desired coverage? • Are 105 samples enough? • Case A: Total solutions -106 • Case B: Total solutions - 1060

  29. The missing link What is the total number of satisfying assignments to system of constraints?

  30. Overview • Uniform Generation of SAT-witnesses • Approximate Model Counting • Future Directions

  31. What is Model Counting? • Given a SAT formula F • RF: Set of all solutions of F • Problem (#SAT): Estimate the number of solutions of F (#F) i.e., what is the cardinality of RF? • E.g., F = (a v b) • RF = {(0,1), (1,0), (1,1)} • The number of solutions (#F) = 3 #P: The class of counting problems for decision problems in NP!

  32. Practical Applications Exciting range of applications! • Probabilistic reasoning/Bayesian inference • Planning with uncertainty • Multi-agent/ adversarial reasoning [Roth 96, Sang 04, Bacchus 04, Domshlak 07]

  33. But it is hard! • #SAT is #P-complete • Even for counting solutions of 2-CNF SAT • #P is really hard! • Believed to be much harder than NP-complete problems • PH P#P

  34. The Hardness of Model Counting

  35. The Hardness of Model Counting Can we do better? Approximate counting (with guarantees) suffices for most of the applications

  36. Prior Work Input Formula: F; Total Solutions: #F; Return Value: C

  37. Approximate Model Counting Design an approximate model counter G: • inputs: • CNF formula F • tolerance e • confidenced • the count returned by it is within e of the #F with confidence at least d Approximate Model Counting

  38. Approximate Model Counting Design an approximate model counter G: • inputs: • CNF formula F • tolerance e • confidenced • the count returned by it is within e of the #F with confidence at least d and scales to real world problems Scalable Approximate Model Counting Lies in the 2nd level of Polynomial hierarchy: S2P

  39. Our Contribution Input Formula: F; Total Solutions: #F TheFirst Scalable ApproximateModel Counter

  40. How do we count?

  41. Naïve Enumeration: Not Scalable • Enumerate all solutions • Exact Counting! • Cachet, Relsat, sharpSAT Not Scalable! (Think of enumerating 2100 solutions)

  42. Counting through Partitioning

  43. Counting through Partitioning Pick a random cell Total # of solutions= #solutions in the cell * total # of cells

  44. Algorithm in Action Algorithm 690 710 730 730 731 831 834 ………….… t

  45. Algorithm in Action Algorithm Median 690 710 730 730 731 831 834 ………….… t

  46. Partitioning How to partition into roughly equal cells of solutions without knowing the distribution of solutions? • Linear hash functions (3-wise independent)

  47. Theoretical Results ApproxMC (CNF: F, tolerance: e, confidence:d) Suppose ApproxMC(F,e,d) returns C. Then, Pr[ #F/(1+e)≤ C ≤ (1+ e) #F ] ≥ d ApproxMC runs in time polynomial in log (1-d)-1, |F|, e-1relative to SAT oracle

  48. Experimental Methodology • Benchmarks (over 200) • Grid networks, DQMR networks, Bayesian networks • Plan recognition, logistics problems • Circuit synthesis • Tolerance: e= 0.75, Confidence: d = 0.9 • Objectives • Comparison with exact counters (Cachet) & bounding counters (MiniCount, Hybrid-MBound, SampleCount) • Performance • Quality of bounds

  49. Results: Performance Comparison

  50. Results: Performance Comparison

More Related