A. Darwiche Searching while Keeping a Trace The Evolution from SAT to Knowledge Compilation Adnan Darwiche Computer Science Department UCLA
Mar 27, 2015
A. Darwiche
Searching while Keeping a Trace
The Evolution from SAT to Knowledge Compilation
Adnan DarwicheComputer Science Department
UCLA
A. Darwiche
Searching while Keeping a Trace The evolution from SAT to Knowledge
Compilation
Satisfiability (SAT) Knowledge compilation The connection: The trace of
search Implications Open questions
A. Darwiche
Is a set of Boolean constraints satisfiable?
Input to SAT is typically a CNF SAT is mostly solved by DPLL
search
Satisfiability (SAT)
A & okX => BA & okX => B
B & okY => CB & okY => C
A. Darwiche
SAT Solvers: Significant growth in last decade; many solvers publicly available (source code); millions of variables & constraints not uncommon.
Applications: Verification, planning, diagnosis, CAD, non-propositional reasoning (e.g., SMTs), …
Satisfiability (SAT)
A. Darwiche
A & okX => BA & okX => B
B & okY => CB & okY => C
CompiledStructureCompiler
Evaluator(Polytime)
Queries
Knowledge Compilation
A. Darwiche
A & okX => BA & okX => B
B & okY => CB & okY => C ?Compiler
Evaluator(Polytime)
Queries
Knowledge Compilation
A. Darwiche
A & okX => BA & okX => B
B & okY => CB & okY => C
.....Prime Implicates
OBDD…
Compiler
Evaluator(Polytime)
Queries
Knowledge Compilation
A. Darwiche
Knowledge Compilation Map What’s the space of possible target
compilation languages? Can it be synthesized in a
semantically systematic way?
How do the languages compare? Succinctness (relative size) Operations they support in polytime
A. Darwiche
Diagnosis Is this a normal behavior? What are the possible faults?
Planning Can this goal be achieved? Generate a set of plans
Probabilistic reasoning What is the probability of X given Y
Non-monotonic reasoning (penalty logics) Does X follow preferentially from Y
Formal verification / CAD: Is it possible that the design will exhibit behavior X? Are two designs equivalent?
Applications
A. Darwiche
Knowledge Compilation Map
For a given application: identify needed operations
Choose most succinct language that supports desired operations
Compile knowledge base into chosen language
A. Darwiche
Succinctness
Polytime OperationsConsistency (CO)Validity (VA)Clausal entailment (CE)Sentential entailment (SE)Implicant testing (IP)Equivalence testing (EQ)Model Counting (CT)Model enumeration (ME)
Projection (exist. quantification)ConditioningConjoin, Disjoin, Negate
DecomposabilityDeterminismSmoothness
FlatnessDecision
Ordering
Negation Normal Form
A B B A C D D C
and and and and and and and and
or or or or
and and
or
A Knowledge Compilation MAP
A. Darwiche
A B B A C D D C
and and and and and and and and
or or or or
and and
or
rooted DAG (Circuit)
Negation Normal Form
A. DarwicheA B B A C D D C
and and and and and and and and
or or or or
and and
orDecomposability
DeterminismSmoothness
FlatnessDecision
Ordering
Negation Normal Form
A. DarwicheA B B A C D D C
and and and and and and and and
or or or or
and and
or
A,B C,D
Decomposability
A. Darwiche
A B B A C D D C
and and and and and and and and
or or or or
and and
or
Determinism
A. Darwiche
X X
and
or
and
X
Decision
A. Darwiche
X1
X2 X2
X3X3
1 0
or
and and
X1 X1or or
and and andand
X2 X2 X2 X2
and and andand
X3 X3 X3 X3
or or
true false
Binary Decision Diagrams(BDDs)
Decision + decomposability = FBDD
A. Darwiche
X1
X2 X2
X3X3
1 0
or
and and
X1 X1or or
and and andand
X2 X2 X2 X2
and and andand
X3 X3 X3 X3
or or
true false
Binary Decision Diagrams(BDDs)
Decision + decomposability + ordering = OBDD
A. Darwiche
NNF
d-NNF s-NNF f-NNF
sd-DNNF
DNNF
CO, CE, ME
d-DNNF
VA,IP,CT
EQ?
CNFDNF
IP PI
CO,CE,MEVA,IP,SE,EQVA,IP, SE,EQ
BDD
FBDD EQ?
OBDD
SE,EQ
MODSSE,EQ
NNF Subsets (2002)
A. Darwiche
OBDD
FBDD
d-DNNF
DNNF
Space Efficiency (succinctness)
Tractable OperationsNNF
decomposability
determinism
decision
ordering
Diagnosis,Non-mon
Probabilisticreasoning
Tractability & Succinctness
A. Darwiche
Inference by Compiling to d-DNNF
Deterministic Conformant Planning Blai Bonet and Hector Geffner (KR 2006)
Probabilistic Conformant Planning Jinbo Huang (AIPS 2006)
Model-based diagnosis Paul Elliott and Brian Williams (AAAI 2006) Anthony Barrett (IJCAI 2005)
Databases (query re-write) Yolife Arvelo, Blai Bonet and Maria Esther Vidal (AAAI 2006)
Inference in Bayesian Networks (2006 competition) Mark Chavira, Adnan Darwiche (IJCAI 2005)
Inference in Probabilistic Relational Models Mark Chavira, Adnan Darwiche and Manfred Jaeger (IJAR 2006)
c2d compiler: http://reasoning.cs.ucla.edu/c2d
A. Darwiche
x y ¬x ¬z
¬w z ¬vv w z
Terminating condition for recursion:
empty set (satisfied), or empty clause (contradiction)
SAT?
x y ¬x ¬z
w z
v = false
SAT?x y
¬x ¬z¬w z
v = true
SAT?
SAT by DPLL Search
•Unit resolution•Conflict-directed backtracking•Clause learning•Branching heuristics•Restarts
A. Darwiche
Recent Trend: Exhaustive DPLL
Count number of models: Model counters, e.g., relsat, cachet
Generate all/subset of models: Image computation in model checking SMTs (non-propositional reasoning)
Variations on DPLL Search
A. Darwiche
KnowledgeCompiler
ExhaustiveDPLL
Record Trace
Variations Languages
The Language of Search
A. Darwiche
Trace of DPLL
X
Y
Z
unsat
unsat
sat
X Y
X Y Z
X Y Z
0
0 1
01
A. Darwiche
X
YY
Z Z
unsat
sat
unsat
unsat
satsat
0 1
0 1
01
0
01
1
X Y
X Y Z
X Y Z
Run to Exhaustion
Exhaustive DPLL
A. Darwiche
X
or
X
and
Y Y0
and
andand
or
Y Y
andand
or
1Z Z
X
YY
Z Z
unsat
sat
unsat
unsat
satsat
Trace of DPLL:a Formula
A. Darwiche
X
or
X
and
Y Y0
and
andand
or
Y Y
andand
or
1Z Z
Equivalent to original CNF
Tractable (e.g., count models)
Trace of DPLL: a Formula
A. Darwiche
X
YY
Z Z
unsatunsat
unsat sat
satsat
Level One: Do not record redundant portions of trace
Level Two: Try not to solve equivalent subproblems
Dealing with Redundancy
A. Darwiche
X
YY
Z Z
unsatunsat
unsat
sat
Dealing with Redundancy
A. Darwiche
X
YY
Z Z
unsat sat
Do not createSimply point to existing node
Dealing with Redundancy
A. Darwiche
X
YY
Z
0 1
This is an OBDD!
A. Darwiche
X
YY
Z
0 1
X
or
X
and
0
and
andand
or
YY
andand
or
1Z
This is an OBDD!
NNF + decision, decomposability, ordering
A. Darwiche
X Y
X Y Z
X Y Z
Compile
0
X
Y Y
Z
1
A Non-traditional OBDD Compiler
Exhaustive DPLL,Fixed variable order,Unique nodes
New complexity guarantees
A. Darwiche
0
X
Y Z
Z
1
Y
FBDD
Compile
Exhaustive DPLL,Dynamic variable order,Unique nodes
X Y
X Y Z
X Y Z
NNF + decision, decomposability
A. Darwiche
FBDD more succinct than OBDD (dynamic var ordering in sat)
Top-down vs bottom-up algorithms
OBDD: equivalence test (canonical) FBDD: probabilistic equivalence test Both allow model counting
FBDD vs OBDD
A. Darwiche
Level One: Unique nodes (done)
Level Two: Avoid redundant compilation (searches)
Dealing with Redundancy
A. Darwiche
Redundant Compilation
x5 x6
x4 x5 x6
x1 x3 x4 x5
x2 x3
x1 x2 x3
X1
X2X2
X3 X3
0 1
1
1
0
1
x5 x6
x4 x5 x6
x5 x6
x4 x5 x6
Formula Caching: complexity guarantees
A. Darwiche
Formula Caching
Majercik and Litmman, 1998 Darwiche, 2002 Bacchus et al, 2003, 2004 Huang, 2004 Sang, Kautz, Beam, 2004, 2005 Thurley, 2006
A. Darwiche
Plain DPLL FBDD
Fixed Variable Ordering OBDD
Beyond BDDs…
A. Darwiche
Combine as AND node
d-DNNF
Decomposition (Component Analysis)
Solve disjoint subproblems independently
A. Darwiche
A B C A B CA D E A D E
B CD E
D EB C
and
0
A
B
1
and
D B
C
D
E
Deterministic Decomposable Negation Norm Form
(d-DNNF)
A. Darwiche
or
and
A
and
Aand and
or
and
B
C
or
and
D
E
or or
B D
and and
Deterministic Decomposable Negation Norm Form
(d-DNNF)
A. Darwiche
d-DNNF more succinct than FBDD (effectiveness of decomposition)
Deterministic equivalence test open
Probabilistic equivalence test apply Other queries same…
FBDD vs d-DNNF
A. Darwiche
Plain DPLL FBDD
Fixed Variable Ordering OBDD
Allowing Decomposition d-DNNF
The Language of Search
Other languages: deterministic DNF
A. Darwiche
Relation to AND/OR Search (CP)
AND/OR graphs are deterministic and decomposable
AND/OR search algorithms are doing enough work to compile networks into (multi-valued equivalent of) d-DNNF
Capable of more than answering a single query (model counting, belief revision, etc)
A. Darwiche
Implications SAT techniques harnessed for
knowledge compilation c2d compiler based on
Rsat Solver (SAT-race 06)
Language properties (succinctness/tractability) help characterize power and limitations of search
A. Darwiche
Understanding DPLL
Take any program X that runs exhaustive DPLL-style search
Examine traces, if traces L, then
X can answer all queries tractable for L
X is hopeless on any input having no polynomial-size representation in L
A. Darwiche
Power of DPLL
Traces of several model counters (Relsat, Cachet, e.g.) are in d-DNNF
Are doing enough work to compile formulas into d-DNNF solve tasks beyond model counting
(e.g., minimum cardinality, probabilistic equivalent testing)
A. Darwiche
or
and
X
and
X
Decision nodes(d-DNNF’)
Deterministic nodes(d-DNNF)
or
A B C
and and
andand
or
A B A B
Limitation of DPLL:General determinism
A. Darwiche
Beyond DPLL:Decomposability (D) without determinism (d)
or
or
and
and
X1 X2
X3
DNNF:CO, CE, ME, exist quant
A. Darwiche
Summary
Overview of recent results in knowledge compilation
Overview of recent trends in exhaustive DPLL search
A connection between SAT and knowledge compilation (search trace): SAT techniques harnessed for compilation
into various languages Language properties (succinctness,
tractability) characterize power and limitations of search algorithms
A. Darwichehttp://reasoning.cs.ucla.edu
A. Darwiche
•Knowledge Compilation Map, with Pierre Marquis•DPLL with a Trace, •Language of Search, with Jinbo Huang
A. Darwiche
Multi-Linear Functions Arithmetic Circuits
ababaababaababaababaf ||||
A B
**
* *
+
+ +
* * * *
a ab ba aab| ab | ab| ab |
Factoring
A. Darwiche
a c + a b c + cMulti-linear function:Propositional theory:
c ^ (a b) Encode
c
b 1
a 1Arithmetic Circuit
Decode
c
b b
a aSmooth d-DNNF
Compile
MLFsACsCNFsd-DNNF