A Scalable and Nearly Uniform Generator of SAT Witnesses
Supratik Chakraborty1, Kuldeep S Meel2, Moshe Y Vardi2
1Indian Institute of Technology Bombay, India 2Department of Computer Science, Rice University
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
Supratik Chakraborty1, Kuldeep S Meel2, Moshe Y Vardi2
1Indian Institute of Technology Bombay, India 2Department of Computer Science, Rice University
a b c 64 bit 64 bit 64 bit Division circuit c = a/b
Designing Constraints
4
64 bit 64 bit
64 bit
5
6
Prior Work & Our Approach Theoretical Results Experimental Results Where do we go from here?
Heuristic Work Guarantees: weak Performance: strong BGP Algorithm XORSample’ Theoretical Work Guarantees: strong Performance: weak BDD-based Guarantees: strong Performance: weak SAT-based heuristics Guarantees: weak Performance: strong
INDUSTRY
ACADEMIA
8
Heuristic Work Guarantees: weak Performance: strong BGP Algorithm XORSample’ Theoretical Work Guarantees: strong Performance: weak BDD-based Guarantees: strong Performance: weak SAT-based heuristics Guarantees: weak Performance: strong
INDUSTRY
ACADEMIA UniWit Guarantees : strong Performance: strong
9
10
11
12
H(n,m,r): Family of r-universal hash functions
Higher the r => Stronger guarantees on range of
r-wise universality => Polynomials of degree r-1 Lower universality => lower complexity
13
Prior Work Partitioned space All cells are “small” “ ” ndependent “ ” “ ” 3-independent RF : Solution space
n-universal hashing Uniform Generation All cells should be small BGP Algorithm
14
Solution space
Prior Work Partitioned space All cells are “small” “ ” ndependent “ ” “ ” 3-independent RF : Solution space Random Partitioned space “ ” A random cells is “small” Hashing Our Approach
n-universal hashing 2-universal hashing Uniform Generation
Random
All cells should be small Only a randomly chosen cells needs to be “small” BGP Algorithm Near Uniform Generation UniWit
15
Solution space
Prior Work Partitioned space All cells are “small” “ ” ndependent “ ” “ ” 3-independent RF : Solution space Random Partitioned space “ ” A random cells is “small” Hashing Our Approach
n-universal hashing 2-independent hashing Uniform Generation
Random
All cells should be small Only a randomly chosen cells needs to be “small” BGP Algorithm Near Uniform Generation UniWit
16
Solution space
Employs XOR-based hash functions instead of
Uses off-the-shelf SAT solver CryptoMiniSAT
17
For every solution y of RF
Pr [y is output] = 1/|RF|
Near Uniformity Success Probability Polynomial: O(n3/2) 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
Benchmarks (over 200)
Bit-blasted versions of word level constraints from VHDL
Bit-blasted versions from SMTLib version and ISCAS’85
Objectives
Comparison with algorithms BGP & XORSample’
◼ Uniformity ◼ Performance
XORSample’ UniWit
1 10 100 1000 10000 100000 4000 8000 12000 16000 Frequency Solutions XORSample’ Uniform Uniform/8 1 10 100 1000 10000 100000 4000 8000 12000 16000 Frequency Solutions Uniwit Uniform Uniform/8
21
0.1 1 10 100 1000 10000 100000 case47 case_3_b14_3 case105 case8 case203 case145 case61 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 Time(s) Benchmarks UniWit XORSample'
22
0.1 1 10 100 1000 10000 100000 case47 case_3_b14_3 case105 case8 case203 case145 case61 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 Time(s) Benchmarks UniWit XORSample'
23
Uniform sampling is an important problem Prior work didn’t scale or offered weak guarantees We use 2-wise independent hash function to divide
Only a randomly chosen partition has to be small Theoretical guarantees of near uniformity Major improvements in running time and uniformity
Tool is available at
Extension to SMT Extending the technique to model counting (CP’13) Stronger Guarantees Efficient hash functions
RF
RF
NO
NO
YES
YES Select a solution randomly with probability “c” from the
picked, return Failure