a scalable and nearly uniform generator of sat witnesses
play

A Scalable and Nearly Uniform Generator of SAT Witnesses Supratik - PowerPoint PPT Presentation

A Scalable and Nearly Uniform Generator of SAT Witnesses Supratik Chakraborty 1 , Kuldeep S Meel 2 , Moshe Y Vardi 2 1 Indian Institute of Technology Bombay, India 2 Department of Computer Science, Rice University CAV 2013 Life in the 21 st


  1. A Scalable and Nearly Uniform Generator of SAT Witnesses Supratik Chakraborty 1 , Kuldeep S Meel 2 , Moshe Y Vardi 2 1 Indian Institute of Technology Bombay, India 2 Department of Computer Science, Rice University CAV 2013

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

  3. Motivating Example How do we verify that this circuit works ? a b • Formal Verification – Not Scalable! 64 bit 64 bit • Randomly sample some a’s and b’s Division circuit • Wait! None of the circuits in the past c = a/b faulted when 10 < b < 40 • Finite resources! 64 bit c • Lets sample from regions where it is likely to fault

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

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

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

  7. Overview  Prior Work & Our Approach  Theoretical Results  Experimental Results  Where do we go from here?

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

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

  10. Central Idea 10

  11. Partitioning into equal “small” cells 11

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

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

  14. Hashing-Based Approaches 14 Solution space RF : Solution space n-universal hashing 3-independent ndependent Prior Work BGP Algorithm “ ” Partitioned space “ ” “ ” All cells are “ small ” All cells should be small Uniform Generation

  15. Scaling to Thousands of Variables 15 Solution space RF : Solution space n-universal hashing 2-universal hashing 3-independent ndependent Random Hashing Random Prior Our Work BGP Algorithm Approach UniWit “ ” Partitioned space “ ” Partitioned space “ ” All cells are “ small ” Only a randomly chosen A random cells is “ small ” “ ” All cells should be small cells needs to be “small” Uniform Generation Near Uniform Generation

  16. Scaling to Thousands of Variables 16 Solution space RF : Solution space n-universal hashing 2-independent hashing 3-independent From tens of variables to ndependent Random Hashing Random thousands of variables! Prior Our Work BGP Algorithm Approach UniWit “ ” Partitioned space “ ” Partitioned space “ ” All cells are “ small ” Only a randomly chosen A random cells is “ small ” “ ” All cells should be small cells needs to be “small” Uniform Generation Near Uniform Generation

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

  18. Strong Theoretical Guarantees Uniformity  For every solution y of R F Pr [y is output] = 1/|R F |

  19. Strong Theoretical Guarantees  Near Uniformity For every solution y of R F Pr [y is output] >= 1 /8 x 1/|R F |  Success Probability Algorithm UniWit succeeds with probability at least 1/8  Polynomial: O(n 3/2 ) calls to SAT Solver

  20. 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

  21. Better Uniformity than State-of-art Generators 21 100000 100000 XORSample’ Uniwit Uniform Uniform Uniform/8 Uniform/8 10000 10000 Frequency 1000 Frequency 1000 100 100 10 10 1 1 0 4000 8000 12000 16000 0 4000 8000 12000 16000 Solutions Solutions XORSample ’ UniWit • Benchmark: case110.cnf; #var: 287; #clauses: 1263 • Total Runs : 1.08x10 8 ; Total Solutions : 16384 • XORSample ’ could not find 772 solutions and more than 250 solutions were generated only once

  22. 22 Time(s) 2-3 Orders of Magnitude Faster 100000 10000 1000 100 0.1 10 1 case47 case_3_b14_3 case105 case8 case203 case145 case61 Benchmarks case9 case15 case140 case_2_b14_1 case_3_b14_1 squaring14 squaring7 case_2_ptb_1 case_1_ptb_1 case_2_b14_2 case_3_b14_2 XORSample' UniWit

  23. 2-3 Orders of Magnitude Faster 23 100000 10000 1000 • UniWit is is 2-3 orders of magnitude faster than XORSample ’ Time(s) 100 10 • Observed success probability = 0.6 ( >> theoretical guarantee of 0.125) UniWit 1 XORSample' 0.1 case47 case8 case61 case9 case15 squaring14 case_3_b14_3 case105 case203 case145 case140 case_2_b14_1 case_3_b14_1 squaring7 case_2_ptb_1 case_1_ptb_1 case_2_b14_2 case_3_b14_2 Benchmarks

  24. Key Takeaways  Uniform sampling is an important problem  Prior work didn’t scale or offered weak guarantees  We use 2-wise independent hash function to divide solution space into “small” partitions  Only a randomly chosen partition has to be small  Theoretical guarantees of near uniformity  Major improvements in running time and uniformity compared to the existing generators  Tool is available at http://www.cfdvs.iitb.ac.in/reports/UniWit/

  25. Where Do We Go From Here?  Extension to SMT  Extending the technique to model counting (CP’13)  Stronger Guarantees  Efficient hash functions

  26. Discussion Acknowledgments • NSF • ExCAPE • Intel • BRNS, India • Sun Microsystems • Sigma Solutions,Inc Thank You for your attention!

  27. UniWit R F

  28. UniWit R F NO

  29. UniWit

  30. UniWit NO

  31. UniWit

  32. UniWit YES

  33. UniWit Select a solution randomly with YES probability “c” from the partition. If no solution is picked, return Failure

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