Compiling Probabilistic Logic Programs into Sentential Decision Diagrams Jonas Vlasselaer, Joris Renkens, Guy Van den Broeck and Luc De Raedt KU Leuven, Belgium PLP 2014 July 17, 2014
Motivation Inference in Probabilistic Logic Programs (PLPs) : Probabilistic Logic Program (Relevant to Query) Grounded Program (Break cycles) Boolean Circuit (Compilation) Tractable Target Representation (Weighted Model Counting) Probability of Query 2
Motivation Inference in Probabilistic Logic Programs (PLPs) Probabilistic Logic Program (Relevant to Query) Grounded Program (Break cycles) Boolean Circuit (Compilation) Tractable Target Representation (Weighted Model Counting) Probability of Query 2
Motivation Compiling Probabilistic Logic Programs Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD d-DNNF 3
Motivation Compiling Probabilistic Logic Programs Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD d-DNNF 3
Motivation Compiling Bayesian Networks Boolean Circuit [Darwiche , …] [ Darwiche , …] [Chavira et al., …] OBDD SDD d-DNNF 4
Motivation Compiling Bayesian Networks Boolean Circuit [Darwiche , …] [ Darwiche , …] [Chavira et al., …] OBDD SDD d-DNNF 4
Motivation Compiling Bayesian Networks Boolean Circuit [Darwiche , …] [ Darwiche , …] [Chavira et al., …] OBDD SDD d-DNNF 4
Motivation Compiling Probabilistic Logic Programs Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD SDD d-DNNF 5
Outline From PLPs to Boolean Circuits Properties of Target Representations Circuit Compilation Experimental Results 6
From PLPs to Boolean Circuits Probabilistic Logic Program (PLP) 0.4 :: friends(a,b). 0.5 :: friends(b,a). 0.8 :: friends(a,c). 0.9 :: friends(c,a). 0.2 :: friends(c,b). 0.1 :: friends(b,c). 0.1 :: stress(a). 0.5 :: stress(b). 0.9 :: stress(c). smokes(X) :- stress(X). smokes(X) :- friends(X,Y), smokes(Y). 7
From PLPs to Boolean Circuits Grounded PLP (probabilistic facts are omitted) smokes(a) :- stress(a). smokes(b) :- stress(b). smokes(c) :- stress(c). smokes(a) :- friends(a,b), smokes(b). smokes(a) :- friends(a,c), smokes(c). smokes(b) :- friends(b,a), smokes(a). smokes(b) :- friends(b,c), smokes(c). smokes(c) :- friends(c,a), smokes(a). smokes(c) :- friends(c,b), smokes(b). 8
From PLPs to Boolean Circuits Grounded PLP (probabilistic facts are omitted) smokes(a) :- stress(a). smokes(b) :- stress(b). smokes(c) :- stress(c). smokes(a) :- friends(a,b), smokes(b). smokes(a) :- friends(a,c), smokes(c). Cycle ! smokes(b) :- friends(b,a), smokes(a). smokes(b) :- friends(b,c), smokes(c). smokes(c) :- friends(c,a), smokes(a). smokes(c) :- friends(c,b), smokes(b). 8
From PLPs to Boolean Circuits Cycle – Free Grounded PLP smokes(a) :- stress(a). … smokes(a) :- friends(a,b), smokes-a(b). smokes(a) :- friends(a,c), smokes-a(c). … smokes-a(b) :- stress(b). smokes-a(c) :- stress(c). smokes-a(b) :- friends(b,c), smokes-ab(c). smokes-a(c) :- friends(c,b), smokes-ac(b). … smokes-ab(c) :- stress(c). smokes-ac(b) :- stress(b). 9 …
From PLPs to Boolean Circuits Boolean Circuit 10
From PLPs to Boolean Circuits Boolean Circuit smokes-a(b) 10
From PLPs to Boolean Circuits Boolean Circuit (propositional formula) Compile Tractable Target Representation (equivalent formula) 11
From PLPs to Boolean Circuits Boolean Circuit (propositional formula) Compile HOW ? Tractable Target Representation (equivalent formula) WHICH language ? 11
Properties of Target Representations Three key properties for target languages: Succinctness Class of tractable transformations Class of tractable queries A Knowledge Compilation Map [Darwiche et al.] 12
Properties of Target Representations Tractable Queries Weighted Model Counting linear in compiled circuit Tractable Transformations Apply-operator ( ˄, ˅, ¬) simplifies compilation process Variable reordering (minimization) 13
Properties of Target Representations Tractable Queries Weighted Model Counting linear in compiled circuit Tractable Transformations Apply-operator ( ˄, ˅, ¬) simplifies compilation process Variable reordering (minimization) 13
Properties of Target Representations Succinctness Size of smallest compiled circuit d-DNNF < SDD ≤ OBDD Upper bounds on the size of the compiled circuit OBDD : based on pathwidth d-DNNF and SDD : based on treewidth 14
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). smokes-a(b) :- friends(b,c), stress(c). 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). smokes-a(b) :- friends(b,c), stress(c). • Variable true Variable false 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). ˅ smokes-a(b) :- friends(b,c), stress(c). Variable true Variable false 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). smokes-a(b) :- friends(b,c), stress(c). Variable true Variable false 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). smokes-a(b) :- friends(b,c), stress(c). Variable true Variable false 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size ˄ smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). smokes-a(b) :- friends(b,c), stress(c). Variable true Variable false 15
Circuit Compilation Compiling into OBDD Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size smokes(a) :- friends(a,b), smokes-a(b). smokes-a(b) :- stress(b). smokes-a(b) :- friends(b,c), stress(c). Variable true Variable false 15
Circuit Compilation Compiling into d-DNNF Requires intermediate encoding in CNF Auxiliary variables needed (for every rule with >1 literal in body) Compile CNF into d-DNNF 16
Circuit Compilation Compiling into d-DNNF Requires intermediate encoding in CNF Auxiliary variables needed (for every rule with >1 literal in body) Compile CNF into d-DNNF Conjunctions (˄) are decomposable Disjunctions (˅) are deterministic 16
Circuit Compilation Compiling into d-DNNF Requires intermediate encoding in CNF Auxiliary variables needed (for every rule with >1 literal in body) Compile CNF into d-DNNF “Real” d -DNNF is bigger Conjunctions (˄) are decomposable Disjunctions (˅) are deterministic 16
Circuit Compilation Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD d-DNNF 17
Circuit Compilation Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD d-DNNF More succinct Tighter upper bounds Requires CNF representation Auxiliary variables needed 17
Circuit Compilation Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD SDD d-DNNF 18
Circuit Compilation Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD SDD d-DNNF Tighter upper bounds on their size 18
Circuit Compilation Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD SDD d-DNNF Apply operator (bottom-up compilation) Support for minimization 18
Circuit Compilation Boolean Circuit [De Raedt et al., …] [Fierens et al.] OBDD SDD d-DNNF SDD combine desirable properties of OBDD and d-DNNF 18
Circuit Compilation Compiling into SDD CNF compilation Bottom-up compilation (apply-operator) Minimization 19
Circuit Compilation Compiling into SDD CNF compilation Bottom-up compilation (apply-operator) Minimization 19
Circuit Compilation Compiling into SDD CNF compilation Bottom-up compilation (apply-operator) Minimization Disjunctions (decisions) Conjunctions 19
Recommend
More recommend