Approximate DNF-Counting Kuldeep S. Meel 1 , Aditya A. Shrotri 2 , - - PowerPoint PPT Presentation

approximate dnf counting
SMART_READER_LITE
LIVE PREVIEW

Approximate DNF-Counting Kuldeep S. Meel 1 , Aditya A. Shrotri 2 , - - PowerPoint PPT Presentation

On Hashing-Based Approaches to Approximate DNF-Counting Kuldeep S. Meel 1 , Aditya A. Shrotri 2 , Moshe Y. Vardi 2 1 School of Computing, 2 Department of Computer Science, National University of Singapore Rice University


slide-1
SLIDE 1

On Hashing-Based Approaches to Approximate DNF-Counting

Kuldeep S. Meel1, Aditya A. Shrotri2, Moshe Y. Vardi2

1 School of Computing, 2 Department of Computer Science,

National University of Singapore Rice University

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 1

slide-2
SLIDE 2

Boolean formulas

  • Variables take values T/F
  • Logical Operations AND, OR, NOT, XOR

Formula encodings:

  • Conjunctive Normal Form (CNF)
  • (X
  • 1 ∨ ¬X2 ∨ ¬X3 ) ∧ (¬X1 ∨ X4) ∧..

Disjunctive Normal Form (DNF)

  • (X
  • 1 ∧ ¬X2 ∧ ¬X3 ) ∨ (¬X1 ∧ X4) ∨..

At a glance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 2

slide-3
SLIDE 3
  • Counting Problem
  • number of satisfying assignments?
  • DNF-Counting Applications
  • Probabilistic Databases
  • Network Reliability
  • CNF-Counting Applications
  • Probabilistic Inference
  • Information Leakage

At a glance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 3

slide-4
SLIDE 4
  • Counting problem is hard [Valiant,’79]
  • “#P-Complete”
  • Relaxation: Approximate Counting
  • Challenge: Efficiently find an approximate answer that is guaranteed to

be close

At a glance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 4

slide-5
SLIDE 5

Hash functions show promise!

  • Hashing
  • based Approximate CNF-Counting

Improvements over

  • 5+ years

[Chakraborty et al.

  • ’13,’14,’16]

Scales to large formulas

  • Hashing
  • based Approximate DNF-Counting [Chakraborty et al. ‘16]

At a glance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 5

slide-6
SLIDE 6
  • Hash functions show promise!
  • Hashing-based Approximate CNF-Counting
  • Improvements over 5+ years
  • [Chakraborty et al. ’13,’14,’16]
  • Scales to large formulas
  • Hashing-based Approximate DNF-Counting [Chakraborty et al. ‘16]
  • Poor time complexity

At a glance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 6

slide-7
SLIDE 7

Problem

  • :
  • Approximate DNF-Counting

Our Solution Strategy

  • :

Design

  • efficient hashing techniques

Contributions

  • 3
  • algorithmic improvements to the hashing framework

Result

  • Reduction in complexity from cubic to linear
  • Significance
  • Power and versatility of hashing
  • At a glance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 7

slide-8
SLIDE 8

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 8

Boolean Formulas and the Counting problem

slide-9
SLIDE 9

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 9

slide-10
SLIDE 10

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

# variables n =

  • 3

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 10

slide-11
SLIDE 11

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Cubes: C1 C2 C3

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 11

slide-12
SLIDE 12

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Cubes: C1 C2 C3 # cubes m =

  • 3

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 12

slide-13
SLIDE 13

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

  • Assignment: X1 = F , X2 = T , X3 = T

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 13

slide-14
SLIDE 14

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

  • Assignment: X1 = F , X2 = T , X3 = T

(¬F ∧ T ) ∨ (T ∧T ) ∨ (F ∧ T ) = T ∨ T ∨ F = T

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 14

slide-15
SLIDE 15

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Assignment: X

  • 1 = F , X2 = T , X3 = T

σ = <

  • 0, 1, 1>

σ satisfies C

  • 2 ⇒ σ satisfies 

σ

  • ⊨ C2

σ

  • ⊨ 

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 15

slide-16
SLIDE 16

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

  • Assignment: X1 = F , X2 = T , X3 = T
  • σ = <0, 1, 1>
  • σ satisfies C2 ⇒ σ satisfies 
  • σ ⊨ C2
  • σ ⊨ 
  • Checking σ ⊨  takes linear time

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 16

slide-17
SLIDE 17

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Universe of assignments U = {

  • 0,1}n

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 17

slide-18
SLIDE 18

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Universe of assignments U = {

  • 0,1}n

Set of solutions S

  •  = { σ ∈ U : σ ⊨  }

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 18

slide-19
SLIDE 19

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

Universe of assignments U = {

  • 0,1}n

Set of solutions S

  •  = { σ ∈ U : σ ⊨  }

DNF

  • Counting: Determine |S| “Count of ”

Disjunctive Normal Form

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 19

slide-20
SLIDE 20

 = ¬𝑌1 ∧ 𝑌2 ∨ 𝑌2 ∧ 𝑌3 ∨ (𝑌1 ∧ 𝑌3)

  • |U| = 23 = 8
  • S = { <0, 1, 0> , <0, 1, 1> , <1,0,1>, <1, 1, 1> }
  • |S| = 4

DNF Counting Problem

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 20

slide-21
SLIDE 21
  • Checking satisfiability
  • UNSAT: ..∨ ( .. ∧ Xi ∧ ¬Xi ∧ .. ) ∨ ..

Hardness of DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 21

slide-22
SLIDE 22

Enumerating satisfying assignments

  •  = (X1 ∧¬X2 ) ∨ (X3 ∧ X4) ∨ …
  • <1 , 0, 0, 0>
  • <1 , 0, 0, 1>
  • <1 , 0, 1, 0>
  • <1 , 0, 1, 1>
  • 𝑇𝑑1 = {<1 , 0, 0, 0>, <1 , 0, 0, 1>, <1 , 0, 1, 0>, <1 , 0, 1, 1>}

Hardness of DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 22

slide-23
SLIDE 23
  • Enumerating satisfying assignments
  •  = (X1 ∧¬X2 ) ∨ (X3 ∧ X4) ∨ …
  • <1 , 0, 0, 0>
  • <1 , 0, 0, 1>
  • <1 , 0, 1, 0>
  • <1 , 0, 1, 1>
  • 𝑇𝑑1 = {<1 , 0, 0, 0>, <1 , 0, 0, 1>, <1 , 0, 1, 0>, <1 , 0, 1, 1>}
  • 𝑇𝑑1 ∩ 𝑇𝑑2 is not empty

Hardness of DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 23

slide-24
SLIDE 24

Enumerating satisfying assignments

  •  = (X1 ∧¬X2 ) ∨ (X3 ∧ X4) ∨ …
  • <1 , 0, 0, 0>
  • <1 , 0, 0, 1>
  • <1 , 0, 1, 0>
  • <1 , 0, 1, 1>
  • 𝑇𝑑1 = {<1 , 0, 0, 0>, <1 , 0, 0, 1>, <1 , 0, 1, 0>, <1 , 0, 1, 1>}
  • 𝑇𝑑1 ∩ 𝑇𝑑2 is not empty ⇒

|S| = |𝑇𝑑1 ∪ 𝑇𝑑2 ∪ 𝑇𝑑3 … ∪ 𝑇𝑑𝑛|

Hardness of DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 24

slide-25
SLIDE 25

DNF

  • Counting is #P-Complete [Valiant,’79]

Class contains entire Polynomial Hierarchy!

  • Need to Approximate!
  • Hardness of DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 25

slide-26
SLIDE 26

Input: DNF Formula  Tolerance ε 0 < ε < 1 Confidence δ 0 < δ < 1 Output: Approximate Count C s.t. Pr [|S|⋅(1-ε) < C < |S|⋅(1+ε) ] > 1-δ

Approximate DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 26

slide-27
SLIDE 27

Input: DNF Formula  Tolerance ε 0 < ε < 1 Confidence δ 0 < δ < 1 Output: Approximate Count C s.t. Pr [|S|⋅(1-ε) < C < |S|⋅(1+ε) ] > 1-δ Challenge: Design a poly(m, n, 1

𝜗 , log( 1 𝜀 )) time algorithm “FPRAS”

Approximate DNF-Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 27

where m = #cubes n = #vars

slide-28
SLIDE 28

Monte Carlo Sampling for Approximate DNF

1.

  • Counting

[Karp,

1.

Luby ‘83] [Karp,

2.

Luby, Madras ‘89]

3.

[Dagum, Karp, Luby, Ross ‘00]

Hashing

2.

  • Based Algorithms for Approximate DNF-Counting

Originated with [

1.

Sipser, ‘83], [Bellare et al. ‘98 ], [Gomes et al. ‘06] DNF

2.

  • Counting FPRAS: [Chakraborty et al., ‘16]

Previous Work

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 28

slide-29
SLIDE 29

Randomized algorithms based on drawing independent samples

  • Method 1: Monte Carlo Sampling

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 29

slide-30
SLIDE 30

Randomized algorithms based on drawing independent samples

  • Method 1: Monte Carlo Sampling

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 30

U S

Randomly sample from U

  • “Throwing darts”
slide-31
SLIDE 31

Randomized algorithms based on drawing independent samples

  • Method 1: Monte Carlo Sampling

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 31

U S

Randomly sample from U

  • “Throwing darts”

Count darts on target

  • |S
  • | ≈

#• #•+#• * |U|

slide-32
SLIDE 32

Randomized algorithms based on drawing independent samples

  • Method 1: Monte Carlo Sampling

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 32

U S

Randomly sample from U

  • “Throwing darts”

Count darts on target

  • |S
  • | ≈

#• #•+#• * |U|

𝑃

  • (𝑛 ⋅ 𝑜 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2) [Karp et al., ‘89] where m = #cubes n = #vars

slide-33
SLIDE 33

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 33

U S “Cutting slices of a pie”

slide-34
SLIDE 34

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 34

Partition universe into

  • ‘cells’

U S

slide-35
SLIDE 35

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 35

Partition universe into

  • ‘cells’

Ensure

  • ‘roughly’ equal solutions to  in each cell

U S

slide-36
SLIDE 36

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 36

Partition universe into

  • ‘cells’

Ensure

  • ‘roughly’ equal solutions to  in each cell

Pick a cell at random

  • U

S

slide-37
SLIDE 37

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 37

U S

Partition universe into

  • ‘cells’

Ensure

  • ‘roughly’ equal solutions to  in each cell

Pick a cell at random

  • Count solutions only in the picked cell
slide-38
SLIDE 38

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 38

U S

Partition universe into

  • ‘cells’

Ensure

  • ‘roughly’ equal solutions to  in each cell

Pick a cell at random

  • Count solutions only in the picked cell
  • Estimate count as #(solutions to
  •  in cell) x #cells
slide-39
SLIDE 39

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 39

U S

Partition universe into

  • ‘cells’

Hash function

  • : Conjunction of Hash Constraints

Hash Constraint:

  • Boolean formula randomly chosen

from special set (Hash family)

slide-40
SLIDE 40

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 40

U S Q1

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

slide-41
SLIDE 41

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 41

U S Q1

Partition universe into

  • ‘cells’

Hash function

  • : Conjunction of Hash Constraints

Hash Constraint:

  • Boolean formula randomly chosen

from special set (Hash family)

  • Q1 partitions U into 2 ‘cells’
  • Q1 = 0
  • Q1 = 1
slide-42
SLIDE 42

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 42

U S Q1 Q2

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 partitions U into 4 ‘cells’
  • Q1 , Q2 ∈ {00 , 01, 10, 11}
slide-43
SLIDE 43

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 43

U S

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 , Q3 …. , QL partitions U into 2L ‘cells’
slide-44
SLIDE 44

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 44

U S

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 , Q3 …. , QL partitions U into 2L ‘cells’
  • Ensure ‘roughly’ equal solutions to  in each cell
slide-45
SLIDE 45

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 45

U S

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 , Q3 …. , QL partitions U into 2L ‘cells’
  • Ensure ‘roughly’ equal solutions to  in each cell
  • Use 2-universal Hash Families
slide-46
SLIDE 46

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 46

U S

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 , Q3 …. , QL partitions U into 2L ‘cells’
  • Ensure ‘roughly’ equal solutions to  in each cell
  • Use 2-universal Hash Families
  • Pick cell at random
  • Q1Q2Q3 …. QL = 0100…1
slide-47
SLIDE 47

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 47

U S

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 , Q3 …. , QL partitions U into 2L ‘cells’
  • Ensure ‘roughly’ equal solutions to  in each cell
  • Use 2-universal Hash Families
  • Pick cell at random
  • Q1Q2Q3 …. QL = 0100…1
  • Count solutions in the picked cell
  • ’ =  ∧ Q
  • Q =(Q1 ⇔ 0) ∧ (Q2 ⇔ 1) ∧ (Q3 ⇔ 0) .. (QL ⇔ 1)
  • Calculate |S’|
slide-48
SLIDE 48

Method 2: Hashing - Based

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 48

U S

  • Partition universe into ‘cells’
  • Hash function: Conjunction of Hash Constraints
  • Hash Constraint: Boolean formula randomly chosen

from special set (Hash family)

  • Q1 , Q2 , Q3 …. , QL partitions U into 2L ‘cells’
  • Ensure ‘roughly’ equal solutions to  in each cell
  • Use 2-universal Hash Families
  • Pick cell at random
  • Q1Q2Q3 …. QL = 0100…1
  • Count solutions in the picked cell
  • ’ =  ∧ Q
  • Q =(Q1 ⇔ 0) ∧ (Q2 ⇔ 1) ∧ (Q3 ⇔ 0) .. (QL ⇔ 1)
  • Calculate |S’|
  • Estimate count as #(solutions to  in cell) x #cells
  • |S| ≈ |S’| x (# cells)
slide-49
SLIDE 49

Monte Carlo Sampling

  • “Dart Throwing”

DNF

  • Counting

Complexity:

  • 𝑃(𝑛 ⋅ 𝑜 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

[Karp et al.,

  • ’89]

Hashing Based

  • “Pie Slicing”
  • DNF-Counting
  • Complexity: 𝑃(𝑛 ⋅ 𝑜3 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

  • ‘ApproxMC’ [Chakraborty et al., ’16]

Comparison of Approaches

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 49

where m = #cubes n = #vars

slide-50
SLIDE 50

Monte Carlo Sampling

  • “Dart Throwing”
  • DNF-Counting
  • Complexity: 𝑃(𝑛 ⋅ 𝑜 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

  • [Karp et al., ’89]
  • CNF-Counting
  • Does not scale well

Hashing Based

  • “Pie Slicing”
  • DNF-Counting
  • Complexity: 𝑃(𝑛 ⋅ 𝑜3 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

  • ‘ApproxMC’ [Chakraborty et al., ’16]
  • CNF-Counting
  • Very successful in practice

Comparison of Approaches

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 50

where m = #cubes n = #vars

slide-51
SLIDE 51

Power of Hashing?

  • Can
  • ApproxMC be made competitive with state-of-the-art?

Motivating Questions

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 51

slide-52
SLIDE 52

Better Hashing techniques for Approximate DNF-Counting

Row Echelon Hash Family

  • Symbolic Hashing
  • Stochastic Cell
  • Counting

Contributions

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 52

slide-53
SLIDE 53

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 53

Row Echelon Hash Family

slide-54
SLIDE 54

Boolean Formulas with only XOR

  • 2-Universal

Sampling procedure:

  • Pick each variable with probability
  • 0.5

XOR picked variables

  • XOR Family of Hash Functions

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 54

slide-55
SLIDE 55

Sample each constraint at random (n=

  • 7)
  • Q1 = X1 ⊕ X4 ⊕ X5
  • Q2 = X3 ⊕ X4 ⊕ X6 ⊕ X7
  • QL = X2 ⊕ X4 ⊕ X6

XOR Family: Hash Matrix

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 55

slide-56
SLIDE 56

Sample each constraint at random (n=

  • 7)
  • Q1 = X1 ⊕ X4 ⊕ X5
  • Q2 = X3 ⊕ X4 ⊕ X6 ⊕ X7
  • QL = X2 ⊕ X4 ⊕ X6

Equivalent to sampling a

  • 0/1 matrix of dimension L x 7

X1 ⊕ X4 ⊕ X5 1 0 0 1 1 0 0 ∧ X3 ⊕ X4 ⊕ X6 ⊕ X7 ⇒ 0 0 1 1 0 1 1 ∧ .. … ∧ X2 ⊕ X4 ⊕ X6 0 1 0 1 0 1 0

XOR Family: Hash Matrix

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 56

L N=7

slide-57
SLIDE 57

Sample a hash matrix

1.

  • Q1 = X1 ⊕ X4 ⊕ X5
  • Q2 = X3 ⊕ X4 ⊕ X6 ⊕ X7
  • QL = X2 ⊕ X4 ⊕ X6

Pick a cell (L bits) at random

2.

10

  • …1

Count solutions to

3.

 in cell

  • ’ =  ∧ Q where Q = (Q1 ⇔ 1) ∧ (Q2 ⇔ 0) ∧ .. (QL ⇔ 1)

Need to find |S

  • ’|

XOR Family: Counting using XORs

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 57

slide-58
SLIDE 58

1.

Sample a hash matrix

  • Q1 = X1 ⊕ X4 ⊕ X5
  • Q2 = X3 ⊕ X4 ⊕ X6 ⊕ X7
  • QL = X2 ⊕ X4 ⊕ X6

2.

Pick a cell (L bits) at random

  • 10…1

3.

Count solutions to  in cell

  • ’ =  ∧ Q where Q = (Q1 ⇔ 1) ∧ (Q2 ⇔ 0) ∧ .. (QL ⇔ 1)
  • Need to find |S’| : Enumerate solutions to Q and check if satisfy 

XOR Family: Counting using XORs

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 58

slide-59
SLIDE 59

Constraints Cell Hash Matrix Cell Vector X1 ⊕ X4 ⊕ X5 = 1 1 0 0 1 1 0 0 X1 1 ∧ X3 ⊕ X4 ⊕ X6 ⊕ X7 = 0 ⇒ 0 0 1 1 0 1 1 X2 = 0 ∧ … .. … .. .. ∧ X2 ⊕ X4 ⊕ X6 = 1 0 1 0 1 0 1 0 X7 1

Q is a system of linear equations (mod

  • 2)

Simplify using Gaussian Elimination!

  • XOR Family: Enumerating Solutions

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 59

slide-60
SLIDE 60
  • 1

1 . . 1 1 1 . . 1 1 . . 1 . . . . . . . . . . 1 1 𝑌1 𝑌2 . . 𝑌𝑜′ = 1 1 . . . . 1

𝐻𝑏𝑣𝑡𝑡𝑗𝑏𝑜 𝐹𝑚𝑗𝑛𝑗.

1 . . 1 1 1 . . 1 1 1 . . 1 . . . . . . . . . . . . . . 𝑌1 𝑌2 . . 𝑌𝑜′ = 1 . . . . 1

Row Echelon Form:

  • First block is the identity matrix
  • Zero rows after non
  • zero rows

XOR Hash: Gaussian Elimination

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 60

Row Echelon Form

slide-61
SLIDE 61
  • 1

1 . . 1 1 1 . . 1 1 . . 1 . . . . . . . . . . 1 1 𝑌1 𝑌2 . . 𝑌𝑜′ = 1 1 . . . . 1

𝐻𝑏𝑣𝑡𝑡𝑗𝑏𝑜 𝐹𝑚𝑗𝑛𝑗.

1 . . 1 1 1 . . 1 1 1 . . 1 . . . . . . . . . . . . . . 𝑌1 𝑌2 . . 𝑌𝑜′ = 1 . . . . 1

Row Echelon Form:

  • First block is the identity matrix
  • Zero rows after non
  • zero rows

Drawback: Gaussian Elimination is O(n

  • 3)

ApproxMC

  • Complexity 𝑃(𝑛 ⋅ 𝑜3 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

XOR Hash: Gaussian Elimination

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 61

Row Echelon Form

slide-62
SLIDE 62

1

  • 0. .

1 1 1

  • 0. .

1 1

  • 1. .

. . . . . . . . . . . .

  • 0. .

1 1 1 𝑌1 𝑌2 . . 𝑌𝑜 = 1 . . 1

Sample a hash matrix in Row-Echelon form directly!

Row Echelon Hash Family

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 62

L n

slide-63
SLIDE 63

1

  • 0. .

𝟐 𝟐 1

  • 0. .

𝟐 𝟐

  • 1. .

𝟏 𝟏 . . . . . . . . . . . .

  • 0. .

1 𝟐 𝟐 𝑌1 𝑌2 . . 𝑌𝑜 = 1 . . 1

Sample a hash matrix in Row-Echelon form directly!

  • Only sample 𝑀 × (𝑜 − 𝑀) non-identity part

Row Echelon Hash Family

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 63

L n

slide-64
SLIDE 64

1

  • 0. .

𝟐 𝟐 1

  • 0. .

𝟐 𝟐

  • 1. .

𝟏 𝟏 . . . . . . . . . . . .

  • 0. .

1 𝟐 𝟐 𝑌1 𝑌2 . . 𝑌𝑜 = 1 . . 1

Sample a hash matrix in Row-Echelon form directly!

  • Only sample 𝑀 × (𝑜 − 𝑀) non-identity part
  • Eliminates expensive Gaussian Elimination step

Row Echelon Hash Family

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 64

L n

slide-65
SLIDE 65

1

  • 0. .

𝟐 𝟐 1

  • 0. .

𝟐 𝟐

  • 1. .

𝟏 𝟏 . . . . . . . . . . . .

  • 0. .

1 𝟐 𝟐 𝑌1 𝑌2 . . 𝑌𝑜 = 1 . . 1

Sample a hash matrix in Row-Echelon form directly!

  • Only sample 𝑀 × (𝑜 − 𝑀) non-identity part
  • Eliminates expensive Gaussian Elimination step
  • Is it 2-Universal?

Row Echelon Hash Family

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 65

L n

slide-66
SLIDE 66

1

  • 0. .

𝟐 𝟐 1

  • 0. .

𝟐 𝟐

  • 1. .

𝟏 𝟏 . . . . . . . . . . . .

  • 0. .

1 𝟐 𝟐 𝑌1 𝑌2 . . 𝑌𝑜 = 1 . . 1

Sample a hash matrix in Row-Echelon form directly!

  • Only sample 𝑀 × (𝑜 − 𝑀) non-identity part
  • Eliminates expensive Gaussian Elimination step
  • Is it 2-Universal? Yes!
  • Theorem: Row-Echelon Family is 2-Universal

Row Echelon Hash Family

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 66

L n

slide-67
SLIDE 67

XOR Hash Family O(n

  • 2) space

O(n

  • 3) time to generate (Gaussian Elim.)

O(n

  • 2) time to enumerate one solution

Row Echelon Hash Family O(n

  • 2) space

O(n

  • 2) time (Sampling the matrix)

O(n) time to enumerate one solution

  • Hash Family Comparison

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 67

where m = #cubes n = #vars

slide-68
SLIDE 68

XOR Hash Family O(n

  • 2) space

O(n

  • 3) time to generate (Gaussian Elim.)

O(n

  • 2) time to enumerate one solution

Complexity of

  • ApproxMC (XOR hash)

[Chakraborty et al, ‘16]: 𝑃(𝑛 ⋅ 𝑜3 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

Row Echelon Hash Family O(n

  • 2) space

O(n

  • 2) time (Sampling the matrix)

O(n) time to enumerate one solution

  • Complexity of
  • ApproxMC with RE

hash: 𝑃(𝑛 ⋅ 𝑜2 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

Hash Family Comparison

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 68

where m = #cubes n = #vars

slide-69
SLIDE 69

XOR Hash Family O(n

  • 2) space

O(n

  • 3) time to generate (Gaussian Elim.)

O(n

  • 2) time to enumerate one solution

Complexity of

  • ApproxMC (XOR hash)

[Chakraborty et al, ‘16]: 𝑃(𝑛 ⋅ 𝑜3 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

Row Echelon Hash Family

  • O(n2) space
  • O(n2) time (Sampling the matrix)
  • O(n) time to enumerate one solution
  • Complexity of ApproxMC with RE

hash: 𝑃(𝑛 ⋅ 𝑜2 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

Hash Family Comparison

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 69

Karp et al. Algorithm: 𝑃(𝑛 ⋅ 𝑜 ⋅ 𝑚𝑝𝑕(

1 𝜀) ⋅ 1 𝜁2)

slide-70
SLIDE 70

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 70

Symbolic Hashing and Stochastic Cell-Counting

slide-71
SLIDE 71

Time to sample a matrix from RE family:

  • 𝑀 × (𝑜 − 𝑀)

If L

  • ≈ n then sample time = O(n)

Room for Improvement

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 71

slide-72
SLIDE 72
  • Time to sample a matrix from RE family: 𝑀 × (𝑜 − 𝑀)
  • If L ≈ n then sample time = O(n)
  • L ≈ n when |S| ≈ |U|

Room for Improvement

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 72

slide-73
SLIDE 73
  • Time to sample a matrix from RE family: 𝑀 × (𝑜 − 𝑀)
  • If L ≈ n then sample time = O(n)
  • L ≈ n when |S| ≈ |U|
  • But |S| can be much smaller than |U|
  • Exponentially smaller in worst case

Room for Improvement

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 73

slide-74
SLIDE 74

Transform U to U

1.

’ [Karp et al., ‘83]

|S

  • | is polynomially smaller than |U’| in worst case

Hash over the transformed universe U

2.

’ (our contribution)

Symbolic Hashing: Outline

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 74

slide-75
SLIDE 75

Transform U to U

1.

’ [Karp et al., ‘83]

U = {

  • 0,1}n

Set of all assignments

  • σ

Includes satisfying and unsatisfying assignments to

Symbolic Hashing: Space Transform

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 75

slide-76
SLIDE 76

Transform U to U

1.

’ [Karp et al., ‘83]

  • U’ = { (σ , Ci ) | σ ⊨ Ci }

Multiset of satisfying assignments ( Recall: σ

  • ⊨Ci ⇒ σ ⊨  )

Each

  • σ occurs at most m = #cubes times

|U

| ⩽ m.|S|

Symbolic Hashing: Space Transform

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 76

slide-77
SLIDE 77

 = (¬X1 ∧ X2 ) ∨ (X2 ∧X3 ) ∨ ( X1 ∧ X3 )

Symbolic Hashing: Space Transform Example

|U| = 8 |S| = 4 |U| ⩽ 2.|S|

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 77

<0,0,1> <1,0,0> <1,1,0> <0,0,0> U

<0,1,1> <1,0,1> <0,1,0> <1,1,1>

S

slide-78
SLIDE 78

 = (¬X1 ∧ X2 ) ∨ (X2 ∧X3 ) ∨ ( X1 ∧ X3 )

Symbolic Hashing: Space Transform Example

|U| = 8 |S| = 4 |U| ⩽ 2.|S|

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 78

|U’| = 6 |S| = 4 |U’ | ⩽ 1.5 |S| <0,0,1> <1,0,0> <1,1,0> <0,0,0> U <0,1,1>, C2 <0,1,1>, C1 <1,1,1>, C3 <1,0,1>, C3 <1,1,1>, C2 <0,1,0>, C1 U’

<0,1,1> <1,0,1> <0,1,0> <1,1,1>

S

slide-79
SLIDE 79

Partition U

2.

’ = { (σ , Ci ) | σ ⊨ Ci }

Use hash constraints with

  • n + log(m) variables
  • X1 … Xn
  • Y1 … Ylog(m) - auxiliary variables
  • “Bit-Blasting”

First n bits select

  • σ

Last log(m) bits select C

  • i

Binary representation of the index

  • i

Symbolic Hashing: Hashing over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 79

where m = #cubes n = #vars

slide-80
SLIDE 80

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 80

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

slide-81
SLIDE 81

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 81

1) Add constraints ..

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

slide-82
SLIDE 82

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 82

1) Add constraints : Q1

slide-83
SLIDE 83

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 83

1) Add constraints : Q1 , Q2

slide-84
SLIDE 84

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 84

1) Add constraints : Q1 , Q2 , … , QL

slide-85
SLIDE 85

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 85

1) Add constraints : Q1 , Q2 , … , QL 2) Pick a cell at random

slide-86
SLIDE 86

(𝝉𝒌𝟑, 𝑫𝒋𝟑) (𝝉𝒌𝟐, 𝑫𝒋𝟐) (𝝉𝒌𝟓, 𝑫𝒋𝟓) (𝝉𝒌𝟔, 𝑫𝒋𝟔) (𝝉𝒌𝟖, 𝑫𝒋𝟖) (𝝉𝒌𝟔, 𝑫𝒋𝟔) U’ (𝝉𝒌𝟒, 𝑫𝒋𝟒) (𝝉𝒌𝟕, 𝑫𝒋𝟕)

Symbolic Hashing: Counting over U’

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 86

Add constraints : Q 1)

1 , Q2 , … , QL

Pick a cell at random 2) Estimate |S 3)

| ≈ |S’| x (# cells)

Details in paper

slide-87
SLIDE 87

Theorem:

  • The estimate |S’| × 2L in U’ provides the required

tolerance 𝜗 and confidence 𝜀 [Chakraborty et al.

  • ‘13, ‘16] imposed tight coupling between

input formula and hash function

Removed this restriction

  • U’ is never explicitly constructed

Adapted ideas from Monte Carlo to Hashing

  • Symbolic Hashing: Significance

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 87

slide-88
SLIDE 88

Idea: Use Monte Carlo within cell!

  • Sample assignments uniformly from cell
  • No need to calculate
  • |S’| exactly

Probabilistic estimate

  • Y ≈ |S’| adapting [Karp et al., ‘89]

Theorem:

  • The estimate Y × 2L in U’ provides the required

tolerance 𝜗 and confidence 𝜀

Stochastic Cell Counting

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 88

slide-89
SLIDE 89

DNF

  • ApproxMC

Row Echelon Hash Functions

  • Symbolic Hashing
  • Stochastic Cell
  • Counting

Theorem:

  • DNF-ApproxMC runs in time ෩

𝑷(𝒏 ⋅ 𝒐 ⋅ 𝒎𝒑𝒉(

𝟐 𝜺) ⋅ 𝟐 𝜻𝟑)

Complexity

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 89

slide-90
SLIDE 90

Problem:

  • Approximate DNF-Counting

Previous work

  • : Poor time complexity

Our contributions

  • : Improvements to the hashing framework

Row Echelon Hash Family, Symbolic Hashing, Stochastic Cell Counting

  • Result
  • : New complexity ෩

𝑷(𝒏 ⋅ 𝒐 ⋅ 𝒎𝒑𝒉(𝟐

𝜺) ⋅ 𝟐 𝜻𝟑)

Significance:

  • General technique of hashing is as powerful as

specialized technique of Monte Carlo for DNF-Counting!

Summary

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 90

slide-91
SLIDE 91

Extend techniques to Weighted DNF

  • Counting

Utilize techniques to improve CNF

  • Counting

Techniques do not depend on encoding of formula

  • Sparsity of Row Echelon
  • Hash functions

Future Work

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 91

slide-92
SLIDE 92

Theorem

  • 1: Row-Echelon Hash Family is 2-Universal

Theorem

  • 2: The estimate obtained from DNF-ApproxMC

provides the required tolerance 𝜗 and confidence 𝜀 Theorem

  • 3: DNF-ApproxMC runs in time ෩

𝑷(𝒏 ⋅ 𝒐 ⋅ 𝒎𝒑𝒉(

𝟐 𝜺) ⋅ 𝟐 𝜻𝟑)

Main Results

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 92

slide-93
SLIDE 93

Questions?

Thank you

9/5/2018 On Hashing-Based Approaches to Approximate DNF Counting Kuldeep S. Meel, Aditya A. Shrotri, Moshe Y. Vardi 93