2.85k likes | 3.08k Views
Knowledge Compilation. Jinbo Huang NICTA and ANU. S l ides made by Adnan Darwiche and Jinbo Huang. B. C. A. Y. X. A okX B A okX B B okY C B okY C. KB =. Propositional Logic. Is A, C a normal device behavior?. A okX B
E N D
Knowledge Compilation Jinbo Huang NICTA and ANU A. Darwiche Slides made by Adnan Darwiche and Jinbo Huang
B C A Y X A okX B A okX B B okY C B okY C KB = Propositional Logic Is A, C a normal device behavior? A. Darwiche
A okX B A okX B B okY C B okY C A, C, okX, okY A okX B A okX B B okY C B okY C Satisfiability Algorithm Propositional Reasoning Is A, C a normal device behavior? A. Darwiche
Satisfiability (SAT) • SAT Solvers: Significant growth in last decade; many solvers publicly available (source code); millions of clauses not uncommon. • Applications: Verification, planning, diagnosis, CAD, non-propositional reasoning (e.g., SMT), … A. Darwiche
Compiled Structure Compiler A okX B A okX B B okY C B okY C Queries Evaluator(Polytime) Knowledge Compilation A. Darwiche
? Compiler A okX B A okX B B okY C B okY C Queries Evaluator (Polytime) Knowledge Compilation A. Darwiche
A okX B A okX B B okY C B okY C Queries Evaluator (Polytime) Knowledge Compilation ..... Prime Implicates OBDD … Compiler 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
Applications • Diagnosis • Is this a normal behavior? • What are the possible faults? • Planning • Can this goal be achieved? • Generate plan with highest reward • Generate plan with highest success probability • Probabilistic reasoning • What is the probability of X given Y • Formal verification / CAD: • Is it possible that the design will exhibit behavior X? • Are two designs equivalent? 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
Agenda • Part I: Languages • Part II: Operations • Part III: Compilers • Part IV: Applications A. Darwiche
Part I: Languages A. Darwiche
Polytime Operations Consistency (CO) Validity (VA) Clausal entailment (CE) Sentential entailment (SE) Implicant testing (IP) Equivalence testing (EQ) Model Counting (CT) Model enumeration (ME) Projection (exist. quantification) Conditioning Conjoin, Disjoin, Negate Succinctness A Knowledge Compilation MAP Negation Normal Form or Decomposability Determinism Smoothness Flatness Decision Ordering and and or or or or and and and and and and and and A B B A C D D C A. Darwiche
Propositional Logic • Literal • Clause • Term • CNF: Conjunctive Normal Form • DNF: Disjunctive Normal Form A. Darwiche
Propositional Logic • Truth assignment (TA) • TA satisfies sentence (model) • Following TA is not a model A. Darwiche
Polytime Operations Consistency (CO) Validity (VA) Clausal entailment (CE) Sentential entailment (SE) Implicant testing (IP) Equivalence testing (EQ) Model Counting (CT) Model enumeration (ME) Projection (exist. quantification) Conditioning Conjoin, Disjoin, Negate Succinctness A Knowledge Compilation MAP Negation Normal Form or Decomposability Determinism Smoothness Flatness Decision Ordering and and or or or or and and and and and and and and A B B A C D D C A. Darwiche
Queries • Consistency (CO) • Validity (VA) • Sentential entailment (SE) • Clausal entailment (CE): KB implies clause • Implicant testing (IP): term implies KB • Equivalence testing (EQ) • Model Counting (CT) • Model enumeration (ME) A. Darwiche
Transformations • Projection (existential quantification) • Conditioning • Conjoin • Disjoin • Negate A. Darwiche
Representation vs Compilation Languags • Representation Language (intuitive):CNFDNF • Target Compilation Language (tractable): Binary Decision Diagrams (BDDs)DNNF A. Darwiche
or and and or or or or and and and and and and and and A B B A C D D C Negation Normal Form rooted DAG (Circuit) A. Darwiche
or and and or or or or and and and and and and and and A B B A C D D C Negation Normal Form Decomposability Determinism Smoothness Flatness Decision Ordering A. Darwiche
Decomposability or and and A,B C,D or or or or and and and and and and and and A B B A C D D C A. Darwiche
NNF Subsets NNF CO, CE, ME DNNF A. Darwiche
Determinism or and and or or or or and and and and and and and and A B B A C D D C A. Darwiche
Smoothness or and and or or or or and and and and and and and and A B B A C D D C A. Darwiche
NNF Subsets NNF CO, CE, ME d-NNF s-NNF DNNF VA,IP,CT d-DNNF EQ? sd-DNNF A. Darwiche
or and and and and X Y Z X Y Z Flatness Nested vs Flat languages A. Darwiche (XY Z)(ZXY) (YZX) (XY Z)
Simple Conjunction or and and and and X Y Z X Y Z Simple conjunction implies decomposability A. Darwiche
Simple Disjunction and or or or X Y Z X A. Darwiche
NNF Subsets NNF CO, CE, ME d-NNF s-NNF DNNF f-NNF VA,IP,CT d-DNNF EQ? DNF CNF sd-DNNF A. Darwiche
Resolution Prime Implicates (PI) • A CNF such that: • No clause subsumes another • If a clause is implied by the CNF, it must be implied by a clause in the CNF • CNF: • PI: A. Darwiche
Consensus Prime Implicants (IP) • A DNF such that: • No term subsumes another • If a term implies the DNF, it must imply a term in the DNF • DNF: • IP: A. Darwiche
NNF Subsets NNF CO, CE, ME d-NNF s-NNF DNNF f-NNF VA,IP,CT d-DNNF EQ? DNF CNF sd-DNNF CO,CE,MEVA,IP,SE,EQ VA,IP, SE,EQ IP PI A. Darwiche
Decision or and and X a X b a, b: Are decision nodes A. Darwiche
Decision or and and X1 X1 or or and and and and X2 X2 X2 X2 or or and and and and X3 X3 X3 X3 true false A. Darwiche
X a b Decision or and and X a X b A. Darwiche
or X1 and and X1 X1 or or X2 X2 and and and and X2 X2 X2 X2 X3 X3 or or and and and and X3 X3 X3 X3 1 0 true false Binary Decision Diagrams(BDDs) Decision implies determinism A. Darwiche
NNF Subsets NNF CO, CE, ME d-NNF s-NNF DNNF f-NNF VA,IP,CT BDD d-DNNF EQ? DNF CNF sd-DNNF CO,CE,MEVA,IP,SE,EQ VA,IP, SE,EQ IP PI A. Darwiche
or X1 and and X1 X1 or or X2 X2 and and and and X2 X2 X2 X2 X3 X3 or or and and and and X3 X3 X3 X3 1 0 true false Test once property Decision + decomposability = FBDD Binary Decision Diagrams(BDDs) A. Darwiche
NNF Subsets NNF CO, CE, ME d-NNF s-NNF DNNF f-NNF VA,IP,CT BDD d-DNNF EQ? DNF CNF FBDD EQ? sd-DNNF CO,CE,MEVA,IP,SE,EQ SE,EQ VA,IP, SE,EQ MODS IP PI A. Darwiche
or X1 and and X1 X1 or or X2 X2 and and and and X2 X2 X2 X2 X3 X3 or or and and and and X3 X3 X3 X3 1 0 true false Binary Decision Diagrams(BDDs) Decision + decomposability + ordering = OBDD A. Darwiche
NNF Subsets NNF CO, CE, ME d-NNF s-NNF DNNF f-NNF VA,IP,CT BDD d-DNNF EQ? DNF CNF FBDD EQ? sd-DNNF CO,CE,MEVA,IP,SE,EQ SE,EQ SE,EQ VA,IP, SE,EQ MODS IP OBDD PI A. Darwiche
OBDD Example: Odd Parity X1 X2 X2 X3 X3 X4 X4 1 0 A. Darwiche Symmetric Functions
L1 at least as succinct as L2 L1 <= L2 L1 is more succinct than L2 L1 < L2 Language Succinctness Size p(n) Size n A. Darwiche
or and and A or or or or B B C C and and and and and and and and D D A B B A C D D C 1 0 Odd Parity Function A. Darwiche
PI <= DNNF DNF <= OBDD OBDD <= DNF DNNF <=? PI NNF DNNF CNF * = sd-DNNF d-DNNF DNF FBDD PI IP OBDD MODS
Tractable Operations DNNF d-DNNF FBDD OBDD Tractability & Succinctness NNF decomposability Diagnosis, Non-mon Probabilistic reasoning determinism decision ordering Space Efficiency (succinctness) A. Darwiche
Separating Functions • OBDD/FBDD: • Hidden weighted bit function hwb(x1,..,xn) • DNNF/DNF: • odd parity function parity(x1,..,xn) • DNNF/OBDD: • Distinct integers function distinct(x1,..,xn) A. Darwiche
Agenda • Part I: Languages • Part II: Operations • Part III: Compilers • Part IV: Applications A. Darwiche
Part II: Operations A. Darwiche