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

a scalable and nearly uniform generator of sat witnesses
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

CAV 2013

slide-2
SLIDE 2

Life in the 21st Century!

How do we guarantee that the systems work correctly ?

slide-3
SLIDE 3

Motivating Example

a b c 64 bit 64 bit 64 bit Division circuit c = a/b

How do we verify that this circuit works ?

  • Formal Verification – 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!
  • Lets sample from regions where it is likely

to fault

slide-4
SLIDE 4

Constraints Design

Designing Constraints

  • Designers:
  • 1. 100 < b < 200
  • 2. 300 < a < 451
  • 3. 40 < a < 50 and 30 < b < 40
  • Past Experience:
  • 1. 400 < a < 2000
  • 2. 120 < b < 230
  • Users:
  • 1. 1000<a < 1100
  • 2. 20000 < b < a < 22000

Problem: How can we uniformly sample the values of a and b satisfying the above constraints?

4

a b

c

64 bit 64 bit

c = ab

64 bit

slide-5
SLIDE 5

Set of Constraints Given a SAT formula, can one uniformly sample solutions without enumerating all solutions SAT Formula

5

Uniform Generation of SAT-Witnesses

slide-6
SLIDE 6

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

6

Uniform Generation of SAT-Witnesses

slide-7
SLIDE 7

Overview

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

slide-8
SLIDE 8

Prior Work

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

slide-9
SLIDE 9

Our Contribution

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

slide-10
SLIDE 10

Central Idea

10

slide-11
SLIDE 11

Partitioning into equal “small” cells

11

slide-12
SLIDE 12

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]

12

slide-13
SLIDE 13

Lower Universality Lower Complexity

 H(n,m,r): Family of r-universal hash functions

mapping {0,1}n to {0,1}m (2n elements to 2m cells)

 Higher the r => Stronger guarantees on range of

size of cells

 r-wise universality => Polynomials of degree r-1  Lower universality => lower complexity

13

slide-14
SLIDE 14

Hashing-Based Approaches

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

slide-15
SLIDE 15

Scaling to Thousands of Variables

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

slide-16
SLIDE 16

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

From tens of variables to thousands of variables!

Scaling to Thousands of Variables

slide-17
SLIDE 17

Highlights

 Employs XOR-based hash functions instead of

computationally infeasible algebraic hash functions

 Uses off-the-shelf SAT solver CryptoMiniSAT

(MiniSAT+XOR support)

17

slide-18
SLIDE 18

Uniformity

For every solution y of RF

Pr [y is output] = 1/|RF|

Strong Theoretical Guarantees

slide-19
SLIDE 19

 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

Strong Theoretical Guarantees

slide-20
SLIDE 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

slide-21
SLIDE 21

Better Uniformity than State-of-art Generators

XORSample’ UniWit

  • 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

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

slide-22
SLIDE 22

2-3 Orders of Magnitude Faster

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

slide-23
SLIDE 23

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'

  • UniWit is is 2-3 orders of magnitude faster than XORSample’
  • Observed success probability = 0.6 ( >> theoretical guarantee of 0.125)

23

2-3 Orders of Magnitude Faster

slide-24
SLIDE 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/

slide-25
SLIDE 25

Where Do We Go From Here?

 Extension to SMT  Extending the technique to model counting (CP’13)  Stronger Guarantees  Efficient hash functions

slide-26
SLIDE 26

Discussion

Thank You for your attention!

Acknowledgments

  • NSF
  • ExCAPE
  • Intel
  • BRNS, India
  • Sun Microsystems
  • Sigma Solutions,Inc
slide-27
SLIDE 27

UniWit

RF

slide-28
SLIDE 28

UniWit

RF

NO

slide-29
SLIDE 29

UniWit

slide-30
SLIDE 30

UniWit

NO

slide-31
SLIDE 31

UniWit

slide-32
SLIDE 32

UniWit

YES

slide-33
SLIDE 33

UniWit

YES Select a solution randomly with probability “c” from the

  • partition. If no solution is

picked, return Failure