Presentation is loading. Please wait.

Presentation is loading. Please wait.

A. Darwiche Knowledge Compilation Jinbo Huang NICTA and ANU Slides made by Adnan Darwiche and Jinbo Huang.

Similar presentations


Presentation on theme: "A. Darwiche Knowledge Compilation Jinbo Huang NICTA and ANU Slides made by Adnan Darwiche and Jinbo Huang."— Presentation transcript:

1 A. Darwiche Knowledge Compilation Jinbo Huang NICTA and ANU Slides made by Adnan Darwiche and Jinbo Huang

2 A. Darwiche Propositional Logic X Y A C B A  okX   B  A  okX  B B  okY   C  B  okY  C KB = Is A,  C a normal device behavior?

3 A. Darwiche Propositional Reasoning A  okX   B  A  okX  B B  okY   C  B  okY  C Is A,  C a normal device behavior? A  okX   B  A  okX  B B  okY   C  B  okY  C A,  C, okX, okY Satisfiability Algorithm

4 A. Darwiche 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), … Satisfiability (SAT)

5 A. Darwiche A  okX   B  A  okX  B B  okY   C  B  okY  C Compiled Structure Compiler Evaluator (Polytime) Queries Knowledge Compilation

6 A. Darwiche ? Compiler Evaluator (Polytime) Queries Knowledge Compilation A  okX   B  A  okX  B B  okY   C  B  okY  C

7 A. Darwiche..... Prime Implicates OBDD … Compiler Evaluator (Polytime) Queries Knowledge Compilation A  okX   B  A  okX  B B  okY   C  B  okY  C

8 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

9 A. Darwiche 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? Applications

10 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

11 A. Darwiche Agenda Part I: Languages Part II: Operations Part III: Compilers Part IV: Applications

12 A. Darwiche Part I: Languages

13 A. Darwiche Succinctness 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 Decomposability Determinism Smoothness Flatness Decision Ordering Negation Normal Form AA B  B AC  D D  C and or and or A Knowledge Compilation MAP

14 A. Darwiche Propositional Logic Literal Clause Term CNF: Conjunctive Normal Form DNF: Disjunctive Normal Form

15 A. Darwiche Propositional Logic Truth assignment (TA) TA satisfies sentence (model) Following TA is not a model

16 A. Darwiche Succinctness 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 Decomposability Determinism Smoothness Flatness Decision Ordering Negation Normal Form AA B  B AC  D D  C and or and or A Knowledge Compilation MAP

17 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)

18 A. Darwiche Transformations Projection (existential quantification) Conditioning Conjoin Disjoin Negate

19 A. Darwiche Representation vs Compilation Languags Representation Language (intuitive): CNF DNF Target Compilation Language (tractable): Binary Decision Diagrams (BDDs) DNNF

20 A. Darwiche AA B  B AC  D D  C and or and or rooted DAG (Circuit) Negation Normal Form

21 A. Darwiche AA B  B AC  D D  C and or and or Decomposability Determinism Smoothness Flatness Decision Ordering Negation Normal Form

22 A. Darwiche AA B  B AC  D D  C and or and or A,B C,D Decomposability

23 A. Darwiche NNF DNNF CO, CE, ME NNF Subsets

24 A. Darwiche AA B  B AC  D D  C and or and or Determinism

25 A. Darwiche AA B  B AC  D D  C and or and or Smoothness

26 A. Darwiche NNF d-NNFs-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT NNF Subsets EQ?

27 A. Darwiche XXX YYY ZZZ and or and Nested vs Flat languages (X  Y  Z)  (Z  X  Y)  (Y  Z  X)  (  X  Y  Z) Flatness

28 A. Darwiche XXX YYY ZZZ and or and Simple conjunction implies decomposability Simple Conjunction

29 A. Darwiche XXXYZ or and or Simple Disjunction

30 A. Darwiche NNF d-NNFs-NNFf-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT EQ? CNF DNF NNF Subsets

31 A. Darwiche 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: Resolution

32 A. Darwiche 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: Consensus

33 A. Darwiche NNF d-NNFs-NNFf-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT EQ? CNF DNF IP PI CO,CE,ME VA,IP,SE,EQ VA,IP, SE,EQ NNF Subsets

34 A. Darwiche X XX  and or and Decision  Are decision nodes

35 A. Darwiche or and X1  X1 or and X2  X2 and X3  X3 or truefalse Decision

36 A. Darwiche X XX  and or and   X Decision

37 A. Darwiche X1 X2 X3 1 0 or and X1  X1 or and X2  X2 and X3  X3 or truefalse Binary Decision Diagrams (BDDs) Decision implies determinism

38 A. Darwiche NNF d-NNFs-NNFf-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT EQ? CNF DNF IP PI CO,CE,ME VA,IP,SE,EQ VA,IP, SE,EQ BDD NNF Subsets

39 A. Darwiche X1 X2 X3 1 0 or and X1  X1 or and X2  X2 and X3  X3 or truefalse Binary Decision Diagrams (BDDs) Decision + decomposability = FBDD Test once property

40 A. Darwiche NNF d-NNFs-NNFf-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT EQ? CNF DNF IP PI CO,CE,ME VA,IP,SE,EQ VA,IP, SE,EQ BDD FBDD EQ? MODS SE,EQ NNF Subsets

41 A. Darwiche X1 X2 X3 1 0 or and X1  X1 or and X2  X2 and X3  X3 or truefalse Binary Decision Diagrams (BDDs) Decision + decomposability + ordering = OBDD

42 A. Darwiche NNF d-NNFs-NNFf-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT EQ? CNF DNF IP PI CO,CE,ME VA,IP,SE,EQ VA,IP, SE,EQ BDD FBDD EQ? OBDD SE,EQ MODS SE,EQ NNF Subsets

43 A. Darwiche OBDD Example: Odd Parity X1 X2 X3 X4 1 X2 X3 X4 0 Symmetric Functions

44 A. Darwiche Language Succinctness Size n Size p(n) L1 <= L2 L1 at least as succinct as L2 L1 < L2 L1 is more succinct than L2

45 A. Darwiche AA B  B AC  D D  C and or and or Odd Parity Function A B C D 1 B C D 0

46 NNF DNNF CNF d-DNNF DNF PI FBDD OBDD IP MODS sd-DNNF PI <= DNNF DNNF <=? PI DNF <= OBDD OBDD <= DNF = *

47 A. Darwiche OBDD FBDD d-DNNF DNNF Space Efficiency (succinctness) Tractable Operations NNF decomposability determinism decision ordering Diagnosis, Non-mon Probabilistic reasoning Tractability & Succinctness

48 A. Darwiche Separating Functions OBDD/FBDD: Hidden weighted bit function hwb(x 1,..,x n ) DNNF/DNF: odd parity function parity(x 1,..,x n ) DNNF/OBDD: Distinct integers function distinct(x 1,..,x n )

49 A. Darwiche Agenda Part I: Languages Part II: Operations Part III: Compilers Part IV: Applications

50 A. Darwiche Part II: Operations

51 A. Darwiche KB Compiled Structure Compiler Evaluator (Polytime) Queries Knowledge Compilation

52 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)

53 A. Darwiche Transformations Projection (existential quantification) Conditioning Conjoin Disjoin Negate

54 A. Darwiche Decomposability

55 A. Darwiche AA B  B AC  D D  C and or and or A,B C,D Decomposability

56 A. Darwiche X Y A C B A  okX   B  A  okX  B B  okY   C  B  okY  C Example Knowledge Base

57 A. Darwiche Decomposable or and or AC ~A ~C ~okX~okY B~B

58 A. Darwiche Decomposable or and or AC ~A ~C ~okX~okY B~B B A, okX C, okY

59 A. Darwiche Decomposable or and or AC ~A ~C ~okX~okY B~B

60 A. Darwiche Satisfiability or and or AC ~A ~C ~okX~okY B~B y y y y y y y y y y y y y y y SAT(A or B) iff SAT(A) or SAT(B) SAT(A and B) iff SAT(A) and SAT(B) SAT(X) is true SAT(~X) is true SAT(True) is true SAT(False) is false

61 A. Darwiche Satisfiability or and or AC ~A ~C ~okX~okY B~B

62 A. Darwiche Satisfiability or and or false C ~C false ~okY B~B n y y y y n n y n n n y n y n

63 A. Darwiche Partial Decomposability or and or AC ~A ~C ~okZokZ B~B Decomposable except on okZ

64 A. Darwiche KB entails L 1 v L 2 v … v L n ? KB   L 1   L 2  …   L n SAT ? Clausal Entailment

65 A. Darwiche or and or AC ~A ~C ~okX~okY B~B and A Literal Conjoin

66 A. Darwiche or and or AC ~A ~C ~okX~okY B~B A Literal Conjoin

67 A. Darwiche or and or true C ~C ~okX~okY B~B A false Literal Conjoin Conditioning

68 A. Darwiche or and or true C ~C ~okX~okY B~B and A false Literal Conjoin

69 or and or AC ~A ~C ~okX~okY B~B A~CokXokY X Y A C B

70 or and or false B~B A and ~CokXokY X Y A C B false true

71 or and or false B~B A and ~CokXokY X Y A C B false true y n y y n n n y n n n n y y n n

72 A. Darwiche Partial Decomposability or and or AC ~A ~C ~okZokZ B~B Decomposable except on okZ Clausal entailment test works as long as clause mentioned all variables on which we don’t have decomposability!

73 or and or AC ~A ~C ~okZokZ B~B

74 or and or AC ~A ~C falsetrue B~B and okZ

75 or and or AC ~A ~C truefalse B~B and ~okZ

76 A. Darwiche Projection: Existential Quantification Knowledge Base Existentially quantifying B,C Forgetting B,C Projecting on A,D

77 A. Darwiche Projection: Existential Quantification Formal Definition If Knowledge base is a CNF: Close under resolution Remove all clauses that mention X

78 A. Darwiche Projection: Existential Quantification or and or AC ~A ~C ~okX~okY B~B X Y A C B

79 A. Darwiche Projection: Existential Quantification or and or A ~A true ~okX B~B true X Y A C B A  okX   B  A  okX  B

80 I1 I2 I3 I4 I5 I6 O + {O}  project(, I1..I6)

81 A. Darwiche Minimum Cardinality okY ABC true false true. false. true. false. false. okX A  okX   B  A  okX  B B  okY   C  B  okY  C

82 A. Darwiche Minimum Cardinality or and or AC ~A ~C ~okX~okY B~B

83 A. Darwiche Minimizing: Requires Smoothness AA B  B AC  D D  C and or and or

84 A. Darwiche Minimizing AA B  B AC  D D  C and or and or

85 A. Darwiche Minimizing AA B  B AC  D D  C and or and or

86 A. Darwiche Minimizing AA B  B AC  D D  C and or and or

87 A. Darwiche Minimizing AA B  B AC  D D  C and or and or  A,B,C,D

88 A. Darwiche Minimizing AA B  B AC  D D  C and or and or A,  B,C,D

89 A. Darwiche Minimizing AA B  B AC  D D  C and or and or A, B,C,  D

90 A. Darwiche Minimizing AA B  B AC  D D  C and or and or A, B,  C,D

91 A. Darwiche Decomposability QueryDNNF CO: ConsistencyYes VA: Validity CE: Clausal entailmentYes SE: Sentential entailment IP: Implicant testing EQ: Equivalence testing MC: Model Counting ME: Model enumerationYes

92 A. Darwiche Decomposability TransformationDNNF CD: ConditioningYes SFO: Single variableYes FO: Multiple variableYes &: Conjoin B&: Bounded Conjoin |: DisjoinYes B|: Bounded DisjoinYes ~: Negate

93 A. Darwiche Determinism

94 A. Darwiche AA B  B AC  D D  C and or and or Determinism

95 A. Darwiche Satisfiability ABCokXokY TTTTT TTTTF ……...…… …………… …………… FFFFF A  okX   B  A  okX  B B  okY   C  B  okY  C A,  C, okX, okY Satisfiability Algorithm Is there a satisfying assignment?

96 A. Darwiche Model Counting ABCokXokY TTTTT TTTTF ……...…… …………… …………… FFFFF A  okX   B  A  okX  B B  okY   C  B  okY  C A,  C, okX, okY Counting Algorithm How many satisfying assignments?

97 A. Darwiche Counting Models AA B  B AC  D D  C and or and or

98 A. Darwiche Counting Graph ******** ++++ ** AA B  B AC  D D  C

99 A. Darwiche Counting Models AA B  B AC  D D  C and or and or S={A,  B}

100 A. Darwiche Counting Models false true C  D D  C and or and or S={A,  B}

101 A. Darwiche Counting Graph ******** ++++ ** false true C  D D  C S={A,  B}

102 A. Darwiche Counting Graph AA B  B AC  D D  C ******** ++++ ** +

103 A. Darwiche Counting Graph VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** +

104 A. Darwiche Counting Graph VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** + S={A,  B}

105 A. Darwiche Counting Graph VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** +

106 A. Darwiche Counting Graph VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** + S={A,  B,C}

107 A. Darwiche Asserting Literals VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** + S={A,  B,C}  {  D} 1 + (-1)1 = 0 0

108 A. Darwiche Retracting Literals VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** + S={A,  B,C} \ {  B} 1 + (+1)1 = 2 1

109 A. Darwiche Flipping Literals VAVA VBVB V  B VAVA VCVC V  D VDVD V  C ******** ++++ ** + S={A,  B,C} \ {  B}  { B } 1 + (+1)1 + (-1)1 = 1 1 0

110 A. Darwiche Testing Equivalence p okY ABC TTTTF T..T.. F..F.. T..T.. F..F.. F..F.. okX A  okX   B  A  okX  B B  okY   C  B  okY  C Pr(A)=.4 Pr(B)=.7 Pr(C)=.1 Pr(okX)=.9 Pr(okY)=.8

111 A. Darwiche Testing Equivalence Pr(A)=.50 Pr(B)=.05 Pr(C)=.74 Pr(okX)=.33 Pr(okY)=.80 KB1(A,B,C,okX,okY) KB2(A,B,C,okX,okY) : p : q If p <> q, then KB1 and KB2 not equivalent If p = q, then Pr(KB1 and KB2 are equivalent)> 1/2 Run test 100 times  error is <

112 AA B  B AC  D D  C and or and or

113 A. Darwiche Probabilistic Equivalence Testing Given propositional theories F & G Compute p(F), p(G) If p(F)  p(G), F & G are not equivalent Otherwise, equivalent with probability > ½

114 A. Darwiche Equivalence Testing Map x y z to {1,2,3,4,5,6} x  2, y  3, z  5 x y zF(xyz) = -15(1-2) 3 5 = -202 (1-3) 5 = 12(1-2) 3 (1 - 5) = 10(1-2) (1-3) 5 Add: p(F) = -13 p(F) = p(G)  F & G are equivalent with probability ≥ (m – 1) n / m n ( > ½ for m ≥ 2n)

115 A. Darwiche Projection under determinism or and or AC ~A ~C ~okX~okY B~B

116 A. Darwiche Projection under determinism or and or AC ~A ~C ~okX~okY true

117 A. Darwiche Determinism Queryd-DNNF CO: ConsistencyYes VA: ValidityYes CE: Clausal entailmentYes SE: Sentential entailment IP: Implicant testingYes EQ: Equivalence testing? MC: Model CountingYes ME: Model enumerationYes

118 A. Darwiche Determinism Transformationd-DNNF CD: ConditioningYes SFO: Single variable FO: Multiple variable &: Conjoin B&: Bounded Conjoin |: Disjoin B|: Bounded Disjoin ~: Negate?

119 A. Darwiche Decision

120 A. Darwiche X1 X2 X3 1 0 or and X1  X1 or and X2  X2 and X3  X3 or truefalse Decision

121 A. Darwiche Decision QueryFBDD CO: ConsistencyYes VA: ValidityYes CE: Clausal entailmentYes SE: Sentential entailment IP: Implicant testingYes EQ: Equivalence testing? MC: Model CountingYes ME: Model enumerationYes

122 A. Darwiche Decison TransformationFBDD CD: ConditioningYes SFO: Single variable FO: Multiple variable &: Conjoin B&: Bounded Conjoin |: Disjoin B|: Bounded Disjoin ~: NegateYes

123 A. Darwiche Ordering

124 A. Darwiche Ordering QueryOBDD CO: ConsistencyYes VA: ValidityYes CE: Clausal entailmentYes SE: Sentential entailmentYes IP: Implicant testingYes EQ: Equivalence testingYes MC: Model CountingYes ME: Model enumerationYes

125 A. Darwiche Ordering TransformationOBDD CD: ConditioningYes SFO: Single variableYes FO: Multiple variable &: Conjoin B&: Bounded ConjoinYes |: Disjoin B|: Bounded DisjoinYes ~: NegateYes

126 A. Darwiche Agenda Part I: Languages Part II: Operations Part III: Compilers Part IV: Applications

127 A. Darwiche Succinctness 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 Decomposability Determinism Smoothness Flatness Decision Ordering Negation Normal Form AA B  B AC  D D  C and or and or A Knowledge Compilation MAP

128 A. Darwiche NNF d-NNFs-NNFf-NNF sd-DNNF DNNF CO, CE, ME d-DNNF VA,IP,CT EQ? CNF DNF IP PI CO,CE,ME VA,IP,SE,EQ VA,IP, SE,EQ BDD FBDD EQ? OBDD SE,EQ MODS SE,EQ NNF Subsets

129 A. Darwiche Part III: Compilers

130 A. Darwiche Building Compilers To-down approaches: Based on exhaustive search Bottom-up approaches: Based on transformations

131 A. Darwiche x  y ¬x  ¬z ¬w  z  ¬v v  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

132 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 SMT (non-propositional reasoning) Variations on DPLL Search

133 A. Darwiche Knowledge Compiler Exhaustive DPLL Record Trace VariationsLanguages The Language of Search

134 A. Darwiche Trace of DPLL X Y Z unsat sat X  Y X   Y   Z  X  Y   Z

135 A. Darwiche X YY ZZ unsat sat unsat sat X  Y X   Y   Z  X  Y   Z Run to Exhaustion Exhaustive DPLL

136 A. Darwiche XX or X and YY Y0 or YY Y and or 1 ZZ ZZ X YY ZZ unsat sat unsat sat Trace of DPLL:a Formula

137 A. Darwiche XX or X and YY Y0 or YY Y and or 1 ZZ ZZ Equivalent to original CNF Tractable (e.g., count models) Trace of DPLL: a Formula

138 A. Darwiche X YY ZZ unsat sat Level One: Do not record redundant portions of trace Level Two: Try not to solve equivalent subproblems Dealing with Redundancy

139 A. Darwiche X YY ZZ unsat sat Dealing with Redundancy

140 A. Darwiche X YY ZZ unsatsat Do not createSimply point to existing node Dealing with Redundancy

141 A. Darwiche X YY Z 01 This is an OBDD!

142 A. Darwiche X YY Z 01 XX or X and 0 or YY Y and or 1 ZZ This is an OBDD! NNF + decision, decomposability, ordering

143 A. Darwiche X  Y X   Y   Z  X  Y   Z Compile 0 X YY Z 1 A Non-traditional OBDD Compiler Exhaustive DPLL, Fixed variable order, Unique nodes New complexity guarantees

144 A. Darwiche 0 X YZ Z 1 Y FBDD Compile Exhaustive DPLL, Dynamic variable order, Unique nodes X  Y X   Y   Z  X  Y   Z NNF + decision, decomposability

145 A. Darwiche FBDD more succinct than OBDD (dynamic var ordering in SAT) OBDD: equivalence test (canonical) FBDD: probabilistic equivalence test Both allow model counting FBDD vs OBDD

146 A. Darwiche Level One: Unique nodes (done) Level Two: Avoid redundant compilation (search) Dealing with Redundancy

147 A. Darwiche Redundant Compilation x 5  x 6 x 4   x 5  x 6 x 1  x 3  x 4  x 5 x 2  x 3 x 1  x 2   x 3 X1X1 X2X2 X2X2 X3X3 X3X x 5  x 6 x 4   x 5  x 6 x 5  x 6 x 4   x 5  x 6 Formula Caching: complexity guarantees

148 A. Darwiche Formula Caching Majercik and Litmman, 1998 Darwiche, 2002 Bacchus et al, 2003, 2004 Huang & Darwiche, 2004 Sang, Kautz, Beam, 2004, 2005 Thurley, 2006

149 A. Darwiche Caching for DPLL v1v1 OBDD(Δ| v1=0 ) OBDD(Δ| v1=1 ) OBDD(Δ)= v2v2 OBDD(Δ| v1=0,v2=0 ) OBDD(Δ| v1=1,v2=1 ) = = … Recursive calls may be made on equivalent CNFs

150 A. Darwiche Caching for DPLL Δ = {v 5 + v 6 v 4 +  v 5 + v 6 v 1 + v 3 + v 4 + v 5 v 2 + v 3 v 1 + v 2 +  v 3 } OBDD(Δ) …… ……………… v1v2v3v1v2v3 Δ’Δ’ 0 0 0contradiction 0 0 1contradiction v 5 + v 6, v 4 +  v 5 + v 6, v 4 + v v 5 + v 6, v 4 +  v 5 + v contradiction v 5 + v 6, v 4 +  v 5 + v v 5 + v 6, v 4 +  v 5 + v v 5 + v 6, v 4 +  v 5 + v 6

151 A. Darwiche Caching for DPLL v1v2v3v4v5v6v1v2v3v4v5v6 Cutset_3 c 1 : v 1 + v 2 +  v 3 c 3 : v 1 + v 3 + v 4 + v 5 c 2 : v 2 + v 3 c 4 : v 4 +  v 5 + v 6 c 5 : v 5 + v 6 After instantiation of v 1 v 2 v 3, Δ’ is either contradictory, or determined by clause c 3 alone. c 3 can only be in one of two states: satisfied or shrunk to v 4 v 5

152 A. Darwiche Caching for Basic DPLL In general, cutset_i is set of clauses mentioning a variable  v i and one > v i After instantiation of v 1 v 2 …v i, Δ’ is either contradictory, or determined by states of clauses cutset_i Number of distinct Δ’ is  2 |cutset_i| + 1 Maintain a cache for each i, and use the value of cutset_i—a bit vector—as key

153 A. Darwiche CNF to OBDD OBDD(Δ, i){ if(contradiction) return 0-sink if(satisfied) return 1-sink key = value(cutset i-1 ) lookup = cache i-1 [key] if(lookup ≠ nil) return lookup result = getnode_node(v i, OBDD(Δ| vi=0, i+1), OBDD(Δ| vi=1, i+1)) cache i-1 [key] = result return result }

154 A. Darwiche Complexity For each i, 2 |cutset_i| bounds number of recursive calls OBDD(Δ, i+1) number of entries in cache i number of OBDD nodes labeled with v i Size of largest cutset is known as cutwidth of variable order Time and space complexities of algorithm and size of OBDD are all linear in number of variables, and exponential only in cutwidth Variable orders with small cutwidth can help

155 A. Darwiche Complexity Theorems size(OBDD)  n2 w + 2 n: number of variables w: cutwidth of variable order (size of largest cutset) Time complexity = O(sn2 w ) s: size of CNF Also hold for w = pathwidth, using a slightly different caching scheme Cutwidth and pathwidth are incomparable

156 A. Darwiche Plain DPLL FBDD Fixed Variable Ordering OBDD Beyond BDDs…

157 A. Darwiche Combine as AND node d-DNNF Decomposition (Component Analysis) Solve disjoint subproblems independently

158 A. Darwiche A  B  C  A   B  C A  D  E  A   D  E B  C D  E B  C and 0 A B 1 DB C D E Deterministic Decomposable Negation Norm Form (d-DNNF)

159 A. Darwiche or and AA A or and BB C or and DD E or BD and Deterministic Decomposable Negation Norm Form (d-DNNF)

160 A. Darwiche Dynamically detect disjoint components Most effective, but very expensive Static structural analysis Constructs a decomposition tree (dtree) Does not detect all decompositions Low overhead at runtime Decomposition Methods

161 A. Darwiche d-DNNF more succinct than FBDD (effectiveness of decomposition) Deterministic equivalence test open Probabilistic equivalence test applies Other queries same… FBDD vs d-DNNF

162 A. Darwiche Plain DPLLFBDD Fixed Variable Ordering OBDD Allowing Decomposition d-DNNF The Language of Search Other languages: deterministic DNF

163 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)

164 A. Darwiche Implications SAT techniques harnessed for knowledge compilation c2d compiler based on Rsat Solver (SAT Competition 2007): uses dtrees Language properties (succinctness/tractability) help characterize power and limitations of search

165 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

166 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)

167 A. Darwiche or and XX X Decision nodes (d-DNNF’) Deterministic nodes (d-DNNF) or A  B C and or  A  B A B Limitation of DPLL: General Determinism

168 A. Darwiche Beyond DPLL: Decomposability (D) Without Determinism (d) or and X1X1 X2X2 X3X3 DNNF: CO, CE, ME, exist quant

169 A. Darwiche Approximate DNNF  dnnf(  l )  r ) and  l  r U = XY

170 A. Darwiche Approximate Compilation   l  r U dnnf(  l )  r ) and XY |XY or and ~X~YX~Y~XY

171 A. Darwiche Approximate Compilation   l  r U dnnf(  l )  r ) and XY |XY or and ~X~YX~Y~XY  Sound, but not complete

172 A. Darwiche Approximate Compilation dnnf(  l )  r ) and ~X dnnf(  l )  r ) and or X |X |~X   l  r U   Complete, but not sound

173 A. Darwiche sat  ? sat   sat  n y sat  y n n y ? Sound Incomplete Unsound Complete

174 A. Darwiche Bottom-up Compilation

175 A. Darwiche 01 z y DEAD NODES x y x x CNF: (x + y) (y + z) Variable order: x, y, z The Apply algorithm: combines two OBDDs using any one of the 16 binary Boolean operators x + y y + z Final OBDD Bottom-up OBDD Construction

176 A. Darwiche Bottom-Up OBDD Construction OBDD packages, such as CUDD implement Apply (conjoin, disjoin, etc) garbage-collect dead nodes Apply is efficient: quadratic in operand size Problem: intermediate OBDDs can be much larger than final one—many dead nodes uf (32 models): OBDD has 176 nodes under MINCE order; 30,640,582 intermediate nodes using CUDD; taking 25 mins

177 A. Darwiche DPLL Based Construction Δ| x=0 = yΔ| x=1 = y + z 01 z y y x Δ = (x + y) (y + z)

178 A. Darwiche Missing Opportunities Bottom up construction methods for DNNF and d-DNNF

179 A. Darwiche Agenda Part I: Languages Part II: Operations Part III: Compilers Part IV: Applications

180 A. Darwiche Part IV: Applications

181 A. Darwiche Applications Model-based diagnosis Planning Probabilistic reasoning

182 A. Darwiche C D A Y X B System model  : okX  (A   C) okY  (B  C)  D Health variables: okX, okY Observables: A, B, D Nonobservable: C Model-based Diagnosis

183 A. Darwiche C D A Y X B Abnormal observation  :  A  B   D Diagnosis: Values of (okX, okY) consistent with    : (0, 0), (0, 1), (1, 0) Model-based Diagnosis System model  : okX  (A   C) okY  (B  C)  D

184 A. Darwiche C D A Y X B Abnormal observation  :  A  B   D Minimum cardinality Diagnoses: (0, 0), (0, 1), (1, 0) Model-based Diagnosis System model  : okX  (A   C) okY  (B  C)  D

185 A. Darwiche Model-based Diagnosis Methods for characterizing diagnoses: Conflicts Kernel diagnoses Methods for manipulating diagnoses: Find minimal diagnoses Find minimum-cardinality diagnoses Characterize lost functionality

186 A. Darwiche A C E B D F G Characterizing Diagnoses

187 A. Darwiche A C E B D F G Characterizing Diagnoses

188 A. Darwiche A C E B D F G Characterizing Diagnoses low high low

189 A. Darwiche Minimal Conflicts An instantiation of ok1,…ok5 is a diagnosis iff it is consistent with (conjunction of) minimal conflicts

190 A. Darwiche Kernel Diagnoses An instantiation of ok1,…ok5 is a diagnosis iff it is consistent with (disjunction of) kernel diagnoses

191 A. Darwiche Characterizing Diagnosis Device Model Observables Health Variables Others Health Condition

192 5 ok OBDD

193 DNNF

194 A. Darwiche CNF/PI Minimal Conflicts

195 A. Darwiche DNF/IP Kernel Diagnoses

196 A. Darwiche Characterizing Diagnosis Device Model Observables Health Variables Others Health Condition Compile Model

197 System Model Compile ? Succinctness Efficient computation of diagnoses

198 System Model Compile OBDD vs. DNNF Succinctness Efficient computation of diagnoses

199 A. Darwiche DNNF is more succinct: can lead to smaller compilation Smaller compilation of system model does not imply faster on-line diagnosis Although less succinct, OBDD is more powerful (DNNF is a weaker form) Is this extra power relevant? Compiling System Models

200 A. Darwiche C D A Y X B Observation:  A  B   D TF FFTT TT System model  : okX  (A   C) okY  (B  C)  D Diagnosis Using DNNF

201 A. Darwiche C D A Y X B Observation:  A  B   D or  okX  okY Diagnosis Using DNNF System model  : okX  (A   C) okY  (B  C)  D

202 A. Darwiche Set observables Linear time Project out nonobservables Linear time Projection exponential for OBDD (can be made linear with particular orders) Diagnosis Using DNNF

203 A. Darwiche Number of diagnoses can be large Some may be more preferable than others Minimize number of faulty components in diagnosis Again, easy for DNNF Minimum Cardinality Diagnoses

204 A. Darwiche or  okX  okY Smoothing: make disjuncts mention same set of variables; O(|  ’| |H|)  Minimum Cardinality Diagnoses

205 A. Darwiche or  okX  okY   Minimizing the DNNF

206 A. Darwiche or and  okX  okY okXokY Minimum Cardinality Diagnoses

207 A. Darwiche Create “filter” OBDD that asserts a given cardinality k Conjoin it with OBDD that represents set of diagnoses Repeat for k = 0, 1, 2... until result is nonempty Minimum Cardinality Diagnoses Using OBDDs

208 A. Darwiche OperationOBDDDNNF Condition(  ’,  )O(|  ’|) Project( , H) exponential O(|  |) Minimize(  d )O(mc |  d | |H| 2 )O(|  d | |H|) Comparison

209 A. Darwiche Characterizing Lost Functionality

210 A. Darwiche Hierarchical Diagnosis

211 A. Darwiche Scalability Requires a health variable for each component c1908 has 880 gates; basic encoding fails to compile New technique to reduce number of health variables Preserves soundness and completeness w.r.t. min- cardinality diagnoses Requires only 160 health variables for c1908

212 A. Darwiche Hierarchical Diagnosis

213 A. Darwiche Hierarchical Diagnosis

214 A. Darwiche Hierarchical Diagnosis

215 A. Darwiche Identifying Cones Gate G dominates gate X if any path from X to output of circuit contains G All gates dominated by G form a cone Dominators found by breath-first traversal of circuit Treat maximal cones as blackboxes

216 A. Darwiche Abstraction of Circuit  C = {T, U, V, A, B, C}

217 A. Darwiche Top-level Diagnosis Diagnosis: {A, B, C}

218 A. Darwiche Diagnosis of Cone Need to set inputs/output of cone according to top-level diagnosis Rest is similar, but not a simple recursive call (to avoid redundancy) Once cone diagnoses found, global diagnoses obtained by substitution

219 A. Darwiche Diagnosis of Cone Top-level diagnosis: {A, B, C} 3 diagnoses for cone A: {A}, {D}, {E} 3 global diagnoses by substitution: {A, B, C} {D, B, C} {E, B, C}

220 A. Darwiche Soundness Top-level diagnoses have same cardinality. Substitutions do not alter cardinality (cones do not overlap). Remains to show that cardinality of these diagnoses, d, is smallest. Proof by contradiction: Suppose there is diagnosis |P| < d. Replace every gate in P with its highest dominator to obtain P’. P’ is a valid top-level diagnosis, contradicting soundness of baseline diagnoser

221 A. Darwiche Completeness Need to show every min-cardinality diagnosis is found Given diagnosis P of min cardinality d, replace every gate in P with its highest dominator to obtain P’ P’ has cardinality d, and only mentions gates in top-level abstraction, and hence will be found by top-level diagnosis (by completeness of baseline diagnoser) P itself will be found by substitution (by completeness of cone diagnosis)

222 A. Darwiche Sequential Diagnosis

223 A. Darwiche Sequential Diagnosis Set of min-cardinality diagnoses may still be large Faults not identified with certainty Take measurements, one at a time, until faults identified Would like to minimize number of measurement Use heuristic based on amount of information gain

224 A. Darwiche Sequential Diagnosis Assume a probabilistic model of the system Failure probabilities for components Output behavior of faulty component (e.g., 1 and 0 with equal probability) These implicitly define a joint probability distribution over all system variables Encoding and compilation described later Pick component with highest posterior probability of failure, measure variable with highest entropy in that component

225 θJθJ or and okA okJ and θAθA  okA and θJθJ  okJ and J PDA

226 A. Darwiche Hierarchical Sequential Diagnosis To improve scalability, previous idea of abstraction applies Treat each cone (blackbox) as a single “big” component Need to compute a single failure probability that “summarizes” the failure behavior of the cone Create copy of cone with all gates healthy, feed outputs of two cones into XOR gate, compute Pr(output = 1)

227 A. Darwiche Planning

228 A. Darwiche Slippery Gripper Probabilistic action effects: Paint: paints block w. p. 1; makes gripper dirty w. p. 1 if it holds block, w. p. 0.1 if not Pick-up: succeeds w. p. 0.5 if gripper wet, 0.95 if gripper dry Dry: dries wet gripper w. p. 0.8; doesn’t affect dry gripper Probabilistic initial state: block not painted, not held gripper clean, but dry with probability 0.7 Goal: block painted and held, gripper clean

229 A. Darwiche Conformant Probabilistic Planning Probabilistic initial state and action effects Conformant: action effects not observable Can’t decide next action by observing environment Needs straight-line plan with max probability of success, for given horizon (number of steps) Example 2-step plan: [paint, pickup] (succeeds with probability )

230 A. Darwiche Brute-force Approach Compute success probability for all plans of length one Given success probabilities of plans of length i, compute probability of success for plans of length i + 1 Iterate to planning horizon n Pick n-step plan with max success probability Exponential in planning horizon

231 A. Darwiche Why is it hard? Consider decision version Does there exist plan of success probability > p, for given horizon Given plan, deciding if success probability > p is PP-complete Can be reduced to MAJ-SAT: does majority of assignments satisfy CNF Alternatively: Is CNF satisfiable with probability > ½ Finding plan with given property (that is free to test) is NP-complete, for given horizon Conformant probabilistic planning for given horizon is NP PP -complete NP  PP  NP PP

232 A. Darwiche Propositional Encoding: Initial State State space: BP (block-painted), BH (block-held), GC (gripper-clean), GD (gripper-dry) Probabilistic initial state: {  BP,  BH, GC, p  GD} Chance variable: p (labeled with 0.7) p = 1: {  BP,  BH, GC, GD} probability 0.7 p = 0: {  BP,  BH, GC,  GD} probability ( ) Encoded as propositional sentence; some variables labeled with numbers (probabilities)

233 A. Darwiche Propositional Encoding: Action Effects Dry: dries wet gripper w. p. 0.8; doesn’t affect dry gripper  dry  GD  (q  GD’),  dry   GD  GD’ Frame axiom  dry  (BP  BP’),  dry  (BH  BH’),  dry  (GC  GC’) Each setting of chance variable selects one effect probability of effect is label of chance variable, or 1 minus that depending on value of variable multiple chance variables: multiply the numbers Define Pr(e) where e is an event (setting of chance vars)

234 A. Darwiche Propositional Encoding: Goal Goal: {BP’, BH’, GC’}

235 A. Darwiche Propositional Encoding: Horizon n State variables: S 0, S 1, S 2, …, S n Chance variables: P -1, P 0, P 1, …, P n-1 Action variables: A 0, A 1, A 2, …, A n-1 Initial state: I(P -1, S 0 )Goal: G(S n ) Plan step: A k  A(S k, A k, P k, S k+1 ) Δ n  I(P -1, S 0 )  A 0  A 1  …  A n-1  G(S n )

236 A. Darwiche Plan Assessment Given propositional encoding Δ n and n-step plan  What’s probability of success Pr(Δ n,  )? Plan  is instantiation of action vars Pr(Δ n,  ) is sum of Pr(e) for e consistent with Δ n   Computation intractable (has to enumerate models)

237 A. Darwiche Brute-force Algorithm Search through all plans  (instantiations of action vars) For each plan , compute Pr(Δ n,  ) Return plan  with max Pr(Δ n,  ) Improve in two ways Efficient plan assessment Search space pruning Both achieved by compiling Δ n to d-DNNF

238 A. Darwiche Compilation to d-DNNF Use existing compiler c2d, Compilation intractable in general For structured problems, exponential only in treewidth Treewidth does not grow with horizon in this encoding Can scale to large horizons

239 A. Darwiche d-DNNF or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’

240 A. Darwiche [paint, pickup’] or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’ Plan Assessment on d-DNNF

241 A. Darwiche or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’ Plan Assessment on d-DNNF [paint, pickup’]

242 A. Darwiche [paint, pickup’] or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’ Plan Assessment on d-DNNF

243 A. Darwiche or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’ Plan Assessment on d-DNNF [paint, pickup’]

244 A. Darwiche [paint, pickup’] or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’ Plan Assessment on d-DNNF

245 A. Darwiche [paint, pickup’] or and pp t’t’ s’s’p  dry paint  pickup rr  dry’  paint’ pickup’ Plan Assessment on d-DNNF

246 A. Darwiche Set action vars to constants according to plan  Set all state vars to 1 (existential quantification) Turn chance vars and their negations into numbers Turn or into summation, and into multiplication Evaluate resulting arithmetic circuit Value at root is Pr(Δ n,  ) Plan Assessment on d-DNNF

247 A. Darwiche Assessment of Partial Plan Partial plan  : instantiation of a subset of action vars Pr(Δ n,  ): success probability of best completion of  Maximize over uninstantiated action vars Special d-DNNF: Turn corresponding or node into max β  x or and x γ

248 A. Darwiche Assessment of Partial Plan Summations over state vars, followed by maximizations over action vars All max must be performed after sum Not guaranteed in d-DNNF Max and sum nodes mixed in any order Some max performed too early: Result incorrect!

249 A. Darwiche Depth-first Branch-and-Bound Key observation: performing max too early can only increase result Result is upper bound on true value Partial plan can be pruned if upper bound <= value of best plan already found Depth-first branch-and-bound: will find optimal plan Tighter bounds leads to more pruning

250 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T

251 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score: 0.151

252 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

253 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

254 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

255 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

256 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

257 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

258 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

259 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

260 A. Darwiche Plan Search C B C BB t’cb.023 t’cb’.051 t’c’b.031 t’c’b’.055 B tc’b’.053 tc’b.117 tcb’.079 tcb.009 T Best Score:

261 A. Darwiche Probabilistic Reasoning

262 A. Darwiche Bayesian Networks Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio LightsEngine Turn Over Gas Gauge Gas Fuel Pump Fuel Line Distributor Spark Plugs Engine Start

263 A. Darwiche Bayesian Networks Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio LightsEngine Turn Over Gas Gauge Gas Fuel Pump Fuel Line Distributor Spark Plugs Engine Start ON OFF OK WEAK DEAD Lights Battery Power If Battery Power = OK, then Lights = ON (99%) ….

264 A B C θ b|a θaθa θ c|a ABCPr(.) abcθ a θ b|a θ c|a ab~cθ a θ b|a θ ~c|a a~bcθ a θ ~b|a θ c|a a~b~cθ a θ ~b|a θ ~c|a...…

265 A. Darwiche Pr(a) = =.3 false B A true false Pr(.) false true Joint Distributions

266 A. Darwiche Pr(~b) = =.41 false B A true false true Pr(.) Joint Distributions

267 A. Darwiche.03λ a λ b +.27λ a λ ~b +.56λ ~a λ b +.14λ ~a λ ~b false B.03 A true false true λ a* λ b *.03 λ a* λ ~ b *.27 λ ~ a* λ b *.56 λ ~ a* λ ~ b*.14 F (λ ~a, λ ~b, λ a, λ b ) = Pr(.) Joint Distributions

268 =.03λ a λ b +.27λ a λ ~b +.56λ ~a λ b +.14λ ~a λ ~b F (λ ~a, λ ~b, λ a, λ b ) Pr(a,~b) = F (λ ~a :0, λ ~b :1, λ a :1, λ b :0) =.27 Pr(a) = F (λ ~a :0, λ ~b :1, λ a :1, λ b :1) =

269 A B C θ b|a θaθa θ c|a ABCPr(.) abcθ a θ b|a θ c|a ab~cθ a θ b|a θ ~c|a a~bcθ a θ ~b|a θ c|a a~b~cθ a θ ~b|a θ ~c|a...…

270 A B C θ b|a θaθa θ c|a ABCPr(.) abc λ a λ b λ c θ a θ b|a θ c|a ab~c λ a λ b λ ~c θ a θ b|a θ ~c|a a~bc λ a λ ~b λ c θ a θ ~b|a θ c|a a~b~c λ a λ ~b λ ~c θ a θ ~b|a θ ~c|a...…

271 F = λ a λ b λ c θ a θ b|a θ c|a + λ a λ b λ ~c θ a θ b|a θ ~c|a + λ a λ ~b λ c θ a θ ~b|a θ c|a + λ a λ ~b λ ~c θ a θ ~b|a θ ~c|a …. A B C

272 F = λ a λ b λ c λ d θ a θ b|a θ c|a θ d|bc + λ a λ b λ c λ ~d θ a θ b|a θ c|a θ ~d|bc + …. A B C D Each term has 2n variables (n indicators, n parameters) Each variable has degree one (multi-linear function) θaθa θ b|a θ c|a θ d|bc

273 A. Darwiche Multi-Linear Functions  Arithmetic Circuits AB * * ** + ++ * ** * Factoring

274 A. Darwiche Compiler: d-DNNF CNF Multi-Linear Function Arithmetic Circuit Encode Decode Reduction to Logic

275 A. Darwiche a c + a b c + c Multi-linear function:Propositional theory: c ^ (a   b) Encode   c   b 1  a 1 Arithmetic Circuit Decode   c  b bb  a aa Smooth d-DNNF Compile MLFs  ACs CNFs  d-DNNF

276 A. Darwiche Propositional Encoding of Multi-Linear Functions Propositional theory: Δ = c ^ (a   b) Encodes: F = a c + a b c + c abcEncodes TTT abc TTFab TFT ac TFFa FTTbc FTFb FFT c FFF1

277 A. Darwiche A B F = λ a λ b θ a θ b|a + λ a λ ~b θ a θ ~b|a + λ ~a λ b θ ~a θ b|~a + λ ~a λ ~b θ ~a θ ~b|~a λ a  λ ~a ¬ λ a  ¬ λ ~a λ b  λ ~b ¬ λ b  ¬ λ ~b ↔↔ λ a ↔ θ a λ ~a ↔ θ ~a ↔↔↔↔ λ a ^ λ b ↔ θ b|a λ a ^ λ ~ b ↔ θ ~ b|a λ ~ a ^ λ b ↔ θ b|~a λ ~ a ^ λ ~ b ↔ θ ~ b|~a Encoding Network as CNF

278 A. Darwiche Why Logic? Encoding local structure is easy: Determinism encoded by adding clauses: CSI encoded by collapsing variables:

279 A. Darwiche Global Structure: Treewidth w

280 A. Darwiche Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio LightsEngine Turn Over Gas Gauge Gas Fuel Pump Fuel Line Distributor Spark Plugs Engine Start Local Structure: CSI and Determinism

281 A. Darwiche Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio LightsEngine Turn Over Gas Gauge Gas Fuel Pump Fuel Line Distributor Spark Plugs Engine Start Context Specific Independence (CSI) Local Structure: CSI and Determinism

282 A. Darwiche Local Structure: CSI and Determinism Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio LightsEngine Turn Over Gas Gauge Gas Fuel Pump Fuel Line Distributor Spark Plugs Engine Start ON OFF OK WEAK DEAD Lights Battery Power If Battery Power = Dead, then Lights = OFF Determinism

283 A. Darwiche ABC S 0.95 c abc A Pr(S|A,B,C) BC a a a a a a a b b b b b b b c c c c c c Tabular CPT -Functional constraints -Context-specific independence  s|abe Local Structure

284 A. Darwiche 0.95 c abc A Pr(S|A,B,E) BC a a a a a a a b b b b b b b c c c c c c Tabular CPT ↔ λ ~a  λ b  λ c  λ s ↔ θ s|~abc ¬ λ ~a  ¬ λ b  ¬ λ c  ¬ λ s Determinism

285 A. Darwiche 0.95 c abc A Pr(S|A,B,C) BC a a a a a a a b b b b b b b c c c c c c Tabular CPT ↔ λ a  λ b  λ s ↔ θ s|ab ↔ λ a  λ b  λ c  λ s ↔ θ s|abc ↔ λ a  λ b  λ ~c  λ s ↔ θ s|ab~c Context-Specific Independence

286 A. Darwiche X Y Belief network x    x x    x x  y  x|y  …. CNF Smooth d-DNNF     x  y   x|y   x     x  y   x|y   Arithmetic Circuit The Ace System:

287 A. Darwiche 1 st International Evaluation of Exact Probabilistic Reasoning Systems (UAI’06, Boston) 135 problem instances from speech, coding, bioinformatics, circuits, medical diagnosis,… Each team given 4 days of computation time UCLA: Only team to solve all problems in allotted time (solved all problems in 1 hr) Failure rates of other teams: 10%-40%

288 A. Darwiche Inference by Compiling to d-DNNF Deterministic Planning Blai Bonet and Hector Geffner (KR 2006) Probabilistic Conformant Planning Jinbo Huang (ICAPS 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:


Download ppt "A. Darwiche Knowledge Compilation Jinbo Huang NICTA and ANU Slides made by Adnan Darwiche and Jinbo Huang."

Similar presentations


Ads by Google