350 likes | 509 Views
Lower Bounds for Exact Model Counting and Applications in Probabilistic Databases. Paul Beame Jerry Li Sudeepa Roy Dan Suciu University of Washington. Model Counting. Model Counting Problem: Given a Boolean formula F ,
E N D
Lower Bounds for Exact Model Counting and Applications in Probabilistic Databases Paul Beame Jerry Li Sudeepa Roy Dan Suciu University of Washington
Model Counting • Model Counting Problem: Given a Boolean formula F, compute #F = #Models (satisfying assignments) of F e.g. F = (x y) (x u w) (x u w z) #Assignments on x, y, u, z, w which make F = true • Probability Computation Problem: Given F, and independent Pr(x), Pr(y), Pr(z), …, compute Pr(F)
Model Counting • #P-hard • Even for formulas where satisfiability is easy to check • Applications in probabilistic inference • e.g. Bayesian net learning • There are many practical model counters that can compute both #F and Pr(F)
Exact Model Counters [Birnbaumet. al.’99] • CDP • Relsat • Cachet • SharpSAT • c2d • Dsharp • … Search-based/DPLL-based (explore the assignment-space and count the satisfying ones) [Bayardo Jr. et. al. ’97, ’00] [Sang et. al. ’05] [Thurley ’06] [Darwiche ’04] Knowledge Compilation-based (compile F into a “computation-friendly” form) [Muiseet. al. ’12] [Survey by Gomes et. al. ’09] • Both techniques explicitly or implicitly • use DPLL-based algorithms • produce FBDD or Decision-DNNFcompiled forms (output or trace) • [Huang-Darwiche’05, ’07]
Model Counters Use Extensions to DPLL • Caching Subformulas • Cachet, SharpSAT, c2d, Dsharp • Component Analysis • Relsat, c2d, Cachet , SharpSAT, Dsharp • Conflict Directed Clause Learning • Cachet, SharpSAT, c2d, Dsharp • DPLL + caching + (clause learning) FBDD • DPLL + caching + component + (clause learning) Decision-DNNF • How much more does component analysisadd? • i.e. how much more powerful are decision-DNNFsthanFBDDs?
Main Result • Theorem: • Decision-DNNF of size N FBDD of size Nlog N + 1 • If the formulaisk-DNF, then FBDD of size Nk • Algorithmruns in linear time in the size of its output
Consequence: Running Time Lower Bounds Model counting algorithm running time ≥ compiled form size Lowerbound on compiledform size Lowerbound on running time • Note: Running time may be much larger than the size • e.g. an unsatisfiable CNF formula has a trivial compiled form
Consequence: Running Time Lower Bounds • Our quasipolynomial conversion • + Knownexponentiallowerbounds on FBDDs • [Bollig-Wegener ’00, Wegener’02] • Exponentiallowerbounds on decision-DNNF size • Exponentiallowerbounds on running time of exact model counters
Outline • Review of DPLL-based algorithms • Extensions (Caching & Component Analysis) • Knowledge Compilation (FBDD & Decision-DNNF) • Our Contributions • Decision-DNNF to FBDD conversion • Implications of the conversion • Applications to Probabilistic Databases • Conclusions
DPLL Algorithms 5/8 • F: (xy) (xuw) (xuwz) x // basic DPLL: Function Pr(F): if F= false then return 0 if F = true then return 1 select a variable x, return • ½ Pr(FX=0)+ ½ Pr(FX=1) 1 0 Davis, Putnam, Logemann, Loveland [Davis et. al. ’60, ’62] uwz y(uw) 7/8 3/8 z y 1 0 1 0 uw uw ¾ ¾ 0 1 u u 0 1 0 0 1 1 w 1 1 ½ w ½ w 1 w 1 1 0 1 0 0 1 0 1 1 0 1 0 Assume uniform distribution for simplicity
DPLL Algorithms 5/8 • F: (xy) (xuw) (xuwz) x 1 0 uwz y(uw) 7/8 3/8 z y • The trace is a • Decision-Tree for F 1 0 1 0 uw uw ¾ ¾ 0 1 u u 0 1 0 0 1 1 w 1 1 ½ ½ w w 1 w 1 1 0 1 0 0 1 0 1 1 0 1 0
Extensions to DPLL • Caching Subformulas • Component Analysis • Conflict Directed Clause Learning • Affects the efficiency of the algorithm, but not the final “form” of the trace • Traces of • DPLL + caching + (clause learning) FBDD • DPLL + caching + component + (clause learning) Decision-DNNF
Caching • F: (xy) (xuw) (xuwz) // basic DPLL: Function Pr(F): if F= false then return 0 if F = true then return 1 select a variable x, return • ½ Pr(FX=0)+ ½ Pr(FX=1) x 1 0 uwz y(uw) z y 1 1 0 0 uw uw u u 0 1 • // DPLL with caching: • Cache F and Pr(F);look it up before computing 0 0 1 1 w w w 1 w 1 1 0 1 0 1 0 1 0
Caching & FBDDs Decision-Node • F: (xy) (xuw) (xuwz) x 1 0 • The trace is a decision-DAG for F • FBDD(Free BinaryDecisionDiagram) • or • ROBP(Read Once Branching Program) • Every variable istestedatmost once on anypath • All internalnodes are decision-nodes uwz y(uw) z y 1 1 0 0 uw u 0 1 0 1 w w 1 1 0 1 0
Component Analysis • F: (xy) (xuw) (xuwz) // basic DPLL: Function Pr(F): if F= false then return 0 if F = true then return 1 select a variable x, return • ½ Pr(FX=0)+ ½ Pr(FX=1) x 1 0 uwz y (uw) z y 1 1 0 0 uw // DPLL with component analysis (and caching): if F = G H where G and H have disjoint set of variables Pr(F) = Pr(G)× Pr(H) u 0 1 0 1 w w 1 1 0 1 0
Components & Decision-DNNF Decision Node • F: (xy) (xuw) (xuwz) x AND Node 1 0 uwz y (uw) • The trace is a Decision-DNNF • [Huang-Darwiche ’05, ’07] • FBDD + “Decomposable” AND-nodes • (Twosub-DAGs do not share variables) z 1 0 y uw y u 1 1 0 0 1 w 1 0 w 1 1 0 How much power do they add? 1 0
Main Technical Result Efficient construction Decision-DNNF FBDD Size N Size Nlog N+1 (quasipolynomial) Size Nk (polynomial) k-DNF e.g. 3-DNF: (x y z) (w y z)
Outline • Review of DPLL algorithms • Extensions (Caching & Component Analysis) • Knowledge Compilation (FBDDs & Decision-DNNF) • Our Contributions • Decision-DNNF to FBDD conversion • Implications of the conversion • Applications to Probabilistic Databases • Conclusions
Decision-DNNF FBDD Need to convert all AND-nodes to Decision-nodes while evaluating the same formula F
A Simple Idea • G 1 G • H • H FBDD 0 0 1 1 0 0 1 Decision-DNNF FBDD • G and H do not share variables, so every variable is still • tested at most once on any path
But, what if sub-DAGs are shared? • Conflict! • G • H G g ’ h • H h g ’ 0 0 • H • G 1 0 0 1 1 1 0 0 Decision-DNNF
Obvious Solution: Replicate Nodes G G g ’ h • H • H No conflict Apply the simple idea 0 1 0 1 But, may need recursive replication Can have exponential blowup!
Main Idea: Replicate Smaller Sub-DAG Edges coming from other nodes in the decision-DNNF Smaller sub-DAG Each AND-node creates a private copy of its smaller sub-DAG Larger sub-DAG
Light and Heavy Edges Light Edge Heavy Edge Smaller sub-DAG Larger sub-DAG • Each AND-node creates a private copy of its smaller sub-DAG • Recursively each node u is replicated #times in a smaller sub-DAG • #Copies of u = #sequences of light edges leading to u
Quasipolynomial Conversion L = Max #light edgeson any path L ≤ log N N = Nsmall + Nbig ≥ 2 Nsmall ≥ ... ≥ 2L #Copies of each node ≤ NL ≤ Nlog N #Nodes in FBDD ≤ N. Nlog N We also show that our analysis is tight
Polynomial Conversion for k-DNFs • L = #Max light edges on any path ≤ k – 1 • #Nodes in FBDD ≤ N. NL = Nk
Outline • Review of DPLL algorithms • Extensions (Caching & Component Analysis) • Knowledge Compilation (FBDDs & Decision-DNNF) • Our Contributions • Decision-DNNF to FBDD conversion • Implications of the conversion • Applications to Probabilistic Databases • Conclusions
Separation Results Exponential Separation Poly-size AND-FBDD or d-DNNF exists Exponential lower bound on decision-DNNF size • FBDD:Decision-DAG, each variable is tested once along any path • Decision-DNNF:FBDD + decomposable AND-nodes (disjoint sub-DAGs) Decision-DNNF d-DNNF AND-FBDD FBDD • AND-FBDD:FBDD + AND-nodes (not necessarily decomposable) • [Wegener’00] • d-DNNF: Decomposable AND nodes + OR-nodes with sub-DAGs not simultaneously satisfiable[Darwiche ’01, Darwiche-Marquis ’02]
Outline • Review of DPLL algorithms • Extensions (Caching & Component Analysis) • Knowledge Compilation (FBDDs & Decision-DNNF) • Our Contributions • Decision-DNNF to FBDD conversion • Implications of the conversion • Applications to Probabilistic Databases • Conclusions
Probabilistic Databases • Tuples are probabilistic (and independent) • “Ann” is present with probability 0.3 • What is the probability that Q is true on D? • Assign unique variables to tuples • Boolean formula FQ,D = (x1y1z1) (x1y2z2) (x2y3z2) • Q is true on D FQ,D is true y1 x1 0.5 z1 0.9 0.3 y2 1.0 0.5 x2 z2 0.1 y3 0.7 Boolean query Q: x y AsthmaPatient(x) Friend (x, y) Smoker(y) Pr(x1) = 0.3
Probabilistic Databases • FQ,D = (x1y1z1) (x1y2z2) (x2y3z2) • Probability Computation Problem: Compute Pr(FQ,D) given Pr(x1), Pr(x2), …. • FQ,D can be written as a k-DNF • for fixed, monotone queries Q • For an important class of queries Q, we get • exponential lower bounds on decision-DNNFs • and model counting algorithms
Outline • Review of DPLL algorithms • Extensions (Caching & Component Analysis) • Knowledge Compilation (FBDDs & Decision-DNNF) • Our Contributions • Decision-DNNF to FBDD conversion • Implications of the conversion • Applications to Probabilistic Databases • Conclusions
Summary • Quasi-polynomial conversion of any decision-DNNF into an FBDD (polynomial for k-DNF) • Exponential lower bounds on model counting algorithms • d-DNNFs and AND-FBDDs are exponentially more powerful than decision-DNNFs • Applications in probabilistic databases
Open Problems • A polynomial conversion of decision-DNNFs to FBDDs? • A more powerful syntactic subclass of d-DNNFs than decision-DNNFs? • d-DNNF is a semantic concept • No efficient algorithm to test if two sub-DAGs of an OR-node are simultaneously satisfiable • Approximate model counting?
Thank You Questions?