Declarative Merging of and Reasoning about Decision Diagrams Thomas Eiter Thomas Krennwallner Christoph Redl {eiter,tkren,redl}@kr.tuwien.ac.at September 12, 2011 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 1 / 26
Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 2 / 26
Motivation Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 3 / 26
Motivation Motivation Decision Diagrams Important means for decision making Intuitively understandable Not only for knowledge engineers Examples ATGCAGGCCTAGCCGCCTAGATGG v=(f 1,..., f 20 ) feature1>12,50 Severity ratings (e.g. TNM system) Diagnosis of personality disorders DNA classification feature8<0,06 feature3>7,50 feature20<1,42 feature20>1,42 feature20<1,42 coding noncoding coding noncoding coding noncoding feature8<0,06 feature20>1,42 feature3>7,50 noncoding coding feature20<1,42 feature20>1,42 noncoding coding coding noncoding Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 4 / 26
Motivation Multiple Diagrams Reasons Different opinions Randomized machine-learning algorithms Statistical impreciseness Question: How to combine them? Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 5 / 26
Motivation Multiple Diagram Integration The DDM System Integration process declaratively described Ingredients: 1 input decision diagrams 2 merging algorithms (predefined or user-defined) Focus: process formalization experimenting with different (combinations of) merging algorithms declarative reasoning for controlling the merging process We do not focus: concrete merging strategies accuracy improvement Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 6 / 26
Preliminaries: MELD Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 7 / 26
Preliminaries: MELD MELD Task Collection of knowledge bases: KB = KB 1,..., KB n Associated collections of belief sets: BS(KB 1 ),..., BS(KB n ) B Σ Goal: Integrate them into a single set of belief sets Method: Merging Operators ( n,m : 2 B Σ ) n Example }{{} collections of belief sets A 1... A }{{ m 2 } BΣ operator arguments Operator definition: 2,0 (B 1, B 2 ) = {B 1 B 2 B 1 B 1, B 2 B 2, A : {A, A} (B 1 B 2 )}, Application: B 1 = {{a, b, c}, { a, c}}, B 2 = {{ a, d}, {c, d}} 2,0 (B 1, B 2 ) = {{a, b, c, d}, { a, c, d}} Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 8 / 26
Preliminaries: MELD MELD Merging Plan Hierarchical arrangement of merging operators Example \ BS(KB 1 ) BS(KB 2 ) BS(KB 3 ) BS(KB 4 ) BS(KB 5 ) Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 9 / 26
Preliminaries: MELD MELD Merging Tasks User provides belief bases with associated collections of belief sets merging plan optional: user-defined merging operators MELD: automated evaluation Advantages Reuse of operators Quick restructuring of merging plan Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 10 / 26
Merging of Decision Diagrams Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 11 / 26
Merging of Decision Diagrams Decision Diagrams Definition (Decision Diagram) A decision diagram over D and C is a labelled rooted directed acyclic graph D = V, E, l C, l E V... nonempty set of nodes with unique root node r D V E V V... set of directed edges l C : V C... partial function assigning a class to all leafs l E : E Q... assign queries Q(z) : D {true, false} to edges Query language: O 1 O 2 with operands O 1, O 2 and {<,, =,,, >} or else Example D = {1, 2, 3, 4, 5} C = {c 1, c 2 } r D z < 3 else v 1 z < 4 v 2 z < 2 else v 3 c 1 else c 2 v 4 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 12 / 26
Merging of Decision Diagrams Decision Diagrams Definition (Decision Diagram) A decision diagram over D and C is a labelled rooted directed acyclic graph D = V, E, l C, l E V... nonempty set of nodes with unique root node r D V E V V... set of directed edges l C : V C... partial function assigning a class to all leafs l E : E Q... assign queries Q(z) : D {true, false} to edges Query language: O 1 O 2 with operands O 1, O 2 and {<,, =,,, >} or else Example D = {1, 2, 3, 4, 5} C = {c 1, c 2 } Classify: 4 r D z < 3 else v 1 z < 4 v 2 z < 2 else v 3 c 1 else c 2 v 4 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 12 / 26
Merging of Decision Diagrams Decision Diagrams Definition (Decision Diagram) A decision diagram over D and C is a labelled rooted directed acyclic graph D = V, E, l C, l E V... nonempty set of nodes with unique root node r D V E V V... set of directed edges l C : V C... partial function assigning a class to all leafs l E : E Q... assign queries Q(z) : D {true, false} to edges Query language: O 1 O 2 with operands O 1, O 2 and {<,, =,,, >} or else Example D = {1, 2, 3, 4, 5} C = {c 1, c 2 } Classify: 4 r D z < 3 else v 1 z < 4 v 2 z < 2 else v 3 c 1 else c 2 v 4 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 12 / 26
Merging of Decision Diagrams Decision Diagrams Definition (Decision Diagram) A decision diagram over D and C is a labelled rooted directed acyclic graph D = V, E, l C, l E V... nonempty set of nodes with unique root node r D V E V V... set of directed edges l C : V C... partial function assigning a class to all leafs l E : E Q... assign queries Q(z) : D {true, false} to edges Query language: O 1 O 2 with operands O 1, O 2 and {<,, =,,, >} or else Example D = {1, 2, 3, 4, 5} C = {c 1, c 2 } Classify: 4 c 2 r D z < 3 else v 1 z < 4 v 2 z < 2 else else v 3 c 1 c 2 v 4 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 12 / 26
Merging of Decision Diagrams Decision Diagrams Definition (Decision Diagram) A decision diagram over D and C is a labelled rooted directed acyclic graph D = V, E, l C, l E V... nonempty set of nodes with unique root node r D V E V V... set of directed edges l C : V C... partial function assigning a class to all leafs l E : E Q... assign queries Q(z) : D {true, false} to edges Query language: O 1 O 2 with operands O 1, O 2 and {<,, =,,, >} or else Example D = {1, 2, 3, 4, 5} C = {c 1, c 2 } Classify: 4 c 2 r D z < 3 else v 1 z < 4 v 2 z < 2 else else v 3 c 1 c 2 v 4 Note: D may consist of composed objects, e.g. Q(z) = z.tsh > 4.5mU/l Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 12 / 26
Merging of Decision Diagrams Decision Diagram Merging Instantiation of MELD How to use MELD for decision diagram merging? Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 13 / 26
Merging of Decision Diagrams Decision Diagram Merging Instantiation of MELD How to use MELD for decision diagram merging? 1 Encode decision diagrams as belief sets 2 Merging by special operators Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 13 / 26
Merging of Decision Diagrams Decision Diagram Merging Instantiation of MELD How to use MELD for decision diagram merging? 1 Encode decision diagrams as belief sets 2 Merging by special operators 1. Encoding Define nodes root(n), inner(n), leaf (n, l) Arcs between nodes, labelled with conditions cond(n 1, n 2, o 1, c, o 2 ), else(n 1, n 2 ) Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 13 / 26
Merging of Decision Diagrams 1. Encoding of Decision Diagrams Example Decision Diagram D: r D z < 3 else v 1 z < 4 v 2 z < 2 else v 3 c 1 else c 2 v 4 E(D) = { root(r D ); inner(r D ); inner(v 1 ); inner(v 2 ); leaf (v 3, c 1 ); leaf (v 4, c 2 ); cond(r D, v 1, z, <, 3); else(r D, v 2 ); cond(v 1, v 3, z, <, 2); else(v 1, v 4 ); cond(v 2, v 3, z, <, 4); else(v 2, v 4 )} Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 14 / 26
Merging of Decision Diagrams 2. Merging of Decision Diagrams Merging Belief sets = encoded diagrams X Y Z W BS(KB 1 ) BS(KB 2 ) BS(KB 3 ) BS(KB 4 ) BS(KB 5 ) Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 15 / 26
Merging of Decision Diagrams 2. Merging of Decision Diagrams Merging Belief sets = encoded diagrams X Y Z W E(D 1 ) E(D 2 ) E(D 3 ) E(D 4 ) E(D 5 ) Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 15 / 26
Merging of Decision Diagrams 2. Merging of Decision Diagrams Merging Belief sets = encoded diagrams X Y Z W E(D 1 ) E(D 2 ) E(D 3 ) E(D 4 ) E(D 5 ) Special merging operators W, X, Y, Z required! Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 15 / 26
Merging of Decision Diagrams 2. Merging of Decision Diagrams Some Examples of Predefined Operators User Preferences Give some class label preference over another D 1 D 2 X > 3 X 3 Y > 2 Y 2 c 1 c 2 c 1 c 2 pref (D 1, D 2, c 2 > c 1 ) X > 3 X 3 Y > 2 Y 2 Y > 2 Y 2 c 1 c 2?? Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 16 / 26
Merging of Decision Diagrams 2. Merging of Decision Diagrams Some Examples of Predefined Operators User Preferences Give some class label preference over another D 1 D 2 X > 3 X 3 Y > 2 Y 2 c 1 c 2 c 1 c 2 pref (D 1, D 2, c 2 > c 1 ) X > 3 X 3 Y > 2 Y 2 Y > 2 Y 2 c 1 c 2 c 2 c 2 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 16 / 26
Merging of Decision Diagrams 2. Merging of Decision Diagrams Some Examples of Predefined Operators User Preferences Give some class label preference over another Majority Voting Majority of input diagrams decides upon an element s class Simplification Decrease redundancy MORGAN merging strategy see later... Note: Operators may produce multiple results! Example: Majority voting for classes with equal number of votes Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 16 / 26
Reasoning about Decision Diagrams Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 17 / 26
Reasoning about Decision Diagrams Reasoning about Decision Diagrams Goal Compute diagram properties e.g. height, variable occurrences, redundancy Properties may control the merging process by filtering Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 18 / 26
Reasoning about Decision Diagrams Reasoning about Decision Diagrams Goal Compute diagram properties e.g. height, variable occurrences, redundancy Properties may control the merging process by filtering Realization Special unary operator... set of decision diagrams P... ASP program P := P Ê(D) D asp (, P), Extended Encoding Ê: Multiple diagrams within one set of facts: leaf (L, C) leaf in (I, L, C) Evaluate P under ASP semantics Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 18 / 26
Reasoning about Decision Diagrams Reasoning about Decision Diagrams Example: Node Count Minimization maj ( ) D 1 D 2 asp (, P min ) simp ( ) maj ( ) asp (, P min ) simp ( ) maj ( ) D 3 D 4 P min = {cnt(i, C) LC = #count{l : leaf in (I, L, C)}, IC = #count{n : inner in(i, N)}, root in(i, R), C = LC + IC c(i) root in(i, R), not c(i) c(i) c(j) root in(i, R), root in(j, S), I J leaf (L, C) c(i), leaf in (I, L, C)... else(n 1, N 2) c(i), else in(i, N 1, N 2) M = #min{nc : cnt(i, NC)}, c(i), cnt(i, C), C > M} Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 19 / 26
Application: DNA Classification Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 20 / 26
Application: DNA Classification DNA Classification Motivation Given: Sequence over {A, C, G, T} Question: Is it coding or junk DNA? Usual Approach Training 1 Annotated training set 2 Compute statistical features 3 Machine-learning algorithms Classification 1 Compute the same features 2 Apply decision diagram Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 21 / 26
Application: DNA Classification DNA Classification Advanced Approach [Salzberg et al., 1998] Train multiple diagrams varying training sets, algorithms, features, etc. Merge them afterwards Benefits Parallelization Increase accuracy (cf. genetic algorithms) Smaller training set suffices Hardcoded implementation: MORGAN system Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 22 / 26
Application: DNA Classification DNA Classification MORGAN s strategy in MELD MORGAN s strategy plugged into MELD as merging operator M Benefits identified in [5] confirmed MORGAN vs. MELD-based system Not hardcoded but modular Clear separation: merging operation / other system components reuse / exchange of the merging operator Experiment with different merging strategies Produce multiple diagrams and reason about them Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 23 / 26
Conclusion Outline 1 Motivation 2 Preliminaries: MELD 3 Merging of Decision Diagrams 4 Reasoning about Decision Diagrams 5 Application: DNA Classification 6 Conclusion Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 24 / 26
Conclusion Conclusion Summary MELD: Integration of multiple collections of belief sets Instantiation for decision diagram merging: 1 Encoding of decision diagrams as belief sets 2 Special merging operators for decision diagrams Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 25 / 26
Conclusion Conclusion Summary MELD: Integration of multiple collections of belief sets Instantiation for decision diagram merging: 1 Encoding of decision diagrams as belief sets 2 Special merging operators for decision diagrams Advantages Reuse of operators Evaluate different operators empirically Automatic recomputation of result Release user from routine tasks Download URL: http://www.kr.tuwien.ac.at/research/dlvhex/ddm.html Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 25 / 26
Conclusion References Dov M. Gabbay, Odinaldo Rodrigues, Gabriella Pigozzi Connections between Belief Revision, Belief Merging and Social Choice In: Journal of Logic and Computation 19(3) (2009) Konieczny, S., Pérez, R.P.: On the logic of merging. In: KR 98. (1998) 488 498 Redl, C.: Merging of Biomedical Decision Diagrams Master s thesis, Vienna University of Technology (October 2010) http://www.ub.tuwien.ac.at/dipl/2010/ac07808795.pdf Eiter, T., Ianni, G., Schindlauer, R., Tompits, H.: dlvhex: A system for integrating multiple semantics in an answer-set programming framework. In: WLP 06. (2006) 206 210 Salzberg, S., Delcher, A.L., Fasman, K.H., Henderson, J.: A decision tree system for finding genes in DNA. Journal of Computational Biology 5(4) (1998) 667 680 Eiter T., Krennwallner T., Redl C. (TU Vienna) Dec. Merging of and Reasoning about Decision Diagrams September 12, 2011 26 / 26