Compiling Probabilistic Logic Programs into Sentential Decision - - PowerPoint PPT Presentation
Compiling Probabilistic Logic Programs into Sentential Decision - - PowerPoint PPT Presentation
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
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
6
From PLPs to Boolean Circuits Properties of Target Representations Circuit Compilation Experimental Results
From PLPs to Boolean Circuits
7
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).
From PLPs to Boolean Circuits
8
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).
From PLPs to Boolean Circuits
8
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). Cycle !
From PLPs to Boolean Circuits
9
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). …
From PLPs to Boolean Circuits
10
Boolean Circuit
From PLPs to Boolean Circuits
10
Boolean Circuit
smokes-a(b)
From PLPs to Boolean Circuits
11
Boolean Circuit (propositional formula) Compile Tractable Target Representation (equivalent formula)
From PLPs to Boolean Circuits
11
Boolean Circuit (propositional formula) Compile Tractable Target Representation (equivalent formula) HOW ? WHICH language ?
Properties of Target Representations
12
Three key properties for target languages:
Succinctness Class of tractable transformations Class of tractable queries
A Knowledge Compilation Map [Darwiche et al.]
Properties of Target Representations
13
Tractable Queries
Weighted Model Counting linear in compiled circuit
Tractable Transformations
Apply-operator (˄, ˅, ¬) simplifies compilation process Variable reordering (minimization)
Properties of Target Representations
13
Tractable Queries
Weighted Model Counting linear in compiled circuit
Tractable Transformations
Apply-operator (˄, ˅, ¬) simplifies compilation process Variable reordering (minimization)
Properties of Target Representations
14
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
Circuit Compilation
15
Compiling into OBDD
Historically used as target representation Supports bottom-up compilation approach Supports minimization of the circuit size
Circuit Compilation
15
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).
Circuit Compilation
15
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
Circuit Compilation
15
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
˅
Circuit Compilation
15
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
Circuit Compilation
15
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
Circuit Compilation
15
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
˄
Circuit Compilation
15
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
Circuit Compilation
16
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
Circuit Compilation
16
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
Circuit Compilation
16
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
“Real” d-DNNF is bigger
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
19
Compiling into SDD
CNF compilation Bottom-up compilation (apply-operator) Minimization
Circuit Compilation
19
Compiling into SDD
CNF compilation Bottom-up compilation (apply-operator) Minimization
Circuit Compilation
19
Compiling into SDD
CNF compilation Bottom-up compilation (apply-operator) Minimization
Disjunctions (decisions) Conjunctions
Experimental Results ‘Smokers example’
20
Four different approaches:
c2d : compile CNF into d-DNNF cnf : compile CNF into SDD sdd_m : bottom-up compilation into SDD with minimization sdd_f : bottom-up compilation into SDD with fixed variable ordering
Experimental Results ‘Smokers example’
21
Four different approaches:
c2d : compile CNF into d-DNNF cnf : compile CNF into SDD sdd_m : bottom-up compilation into SDD with minimization sdd_f : bottom-up compilation into SDD with fixed variable ordering
Compilation Time
(until out of memory)
Experimental Results ‘Smokers example’
22
Four different approaches:
c2d : compile CNF into d-DNNF cnf : compile CNF into SDD sdd_m : bottom-up compilation into SDD with minimization sdd_f : bottom-up compilation into SDD with fixed variable ordering
Circuit Size
(until out of memory)
Conclusions
Boolean Circuit
[De Raedt et al., …] [Vlasselaer et al.] [Fierens et al.]
OBDD SDD
d-DNNF
23
http://dtai.cs.kuleuven.be/problog/ http://reasoning.cs.ucla.edu/