- Dagnoss I - Insttute for Software Technology Inffeldgasse 16b/2 A-8010 Graz Austra 1
References Skrptum (TU Wen, Insttut für Informatonssysteme, Thomas Eter et al.) ÖH-Copyshop, Studenzentrum Stuart t Russell und Peter Norvg. Artfcal Intellgence - A Modern Approach. Prentce Hall. 2003. 2
Motvatng Example MBD a b c d M1 * M2 * M3 A1 + A2 + f g f * 3
Motvatng Example MBD M1 a 3 6 * A1 10 b 2 12 c 2 d f 3 M2 * 6 + A2 3 12 M3 * 6 + f g 4
Motvatng Example MBD M1 a 3 6 * A1 10 b 2 12 M2 4 + c 2 6 * A2 10 d 3 12 f 3 M3 * 6 + f g 5
Omn-drectonal Robot 6
Applcaton Domans 7
Prncples MBD System Descrpton (Model) Dagnoss Physcal System Desered Behavor Dscrepancy Observed Behavor 8
Requrements Prncples MBD Model (Component-Connecton-Behavor Model) Powerful Computer Benefts General Methodology Easy to mantan Easy adaptable to other problems Cost reducton 9
Defntons 1. Dagnoss System: A dagnoss system (SD,COMP) conssts of a system descrpton SD,.e., a set of FOL sentences descrbng the components behavor and the system structure, and a set of dagnoss components COMP. Alexander - Felferng and Gerald Stenbauer 1 0-10
Example: AND gates Defntons and(c) ( ab(c) out(c)=n 1 (C) n 2 (C)) and(a 1 ) and(a 2 ) out(a 1 )=n 1 (a 2 ) n 1 out n 1 & & n 2 n 2 out a 1 a 2 11
Defntons 2. Dagnoss: Let (SD,COMP) be a dagnoss system and OBS a set of observatons. A set COMP s a dagnoss ff SDUOBSU{ ab(c) CCOMP\ }U{ab(C) C } s consstent. 12
Example: AND gates Defntons OBS={n 1 (a 1 )=true n 2 (a 1 )=true n 2 (a 2 )=true out(a 2 )=false} true true n 1 n 2 & a 1 out true n 1 n 2 & out false a 2 13
Proposton 1. A dagnoss exsts for (SD,COMP,OBS) OBS) ff SDUOBS s consstent. Proof: If SDUOBS s nconsstent, then obvously t s mpossble for all COMP to fulfll the dagnoss condton. So there exsts no dagnoss. On the other hand f SDUOBS s consstent at least COMP s a dagnoss. 14
Proposton 2. {} s a dagnoss for (SD,COMP,OBS) OBS) ff SDUOBSU{ ab(c) CCOMP} s consstent. 3. Every superset of a dagnoss s a dagnoss. 4. If s a dagnoss for (SD,COMP,OBS), then for each C, SDUOBSU{ ab(c) CCOMP\ } ab(c ) 15
Proposton Proof: If ={} the result s vacuously. Suppose then that ={C 1,,C k } and that the proposton p s false. Then there exsts a C such that SDUOBSU{ ab(c) CCOMP\ } ab(c ). From the defnton of follows that there must be a logcal Model M L wth the property M L SDUOBSU{ ab(c) CCOMP\ } ab(c ). M L Now we can conclude ab(c ) whch s n M contradcton wth our ntal L assumpton C. 16
Proposton 5. s a dagnoss for (SD,COMP,OBS) ff SDUOBSU{ ab(c) CCOMP\ } { ( } s consstent. 17
Defnton 3. A conflct set for (SD,COMP,OBS) s a set COCOMP such that SDUOBSU{ ab(c) CCO} s nconsstent. A conflct set s mnmal f no proper subset s a conflct set. 18
Proposton 6. COMP s a dagnoss for (SD,COMP,OBS) ff s a mnmal set such that COMP/ s not a conflct set. 19
Defnton 4. Suppose C s a collecton of sets. A httng set for C s a set HU SCS such that H SØ for each SC. A httng set s mnmal f no proper subset s a httng set. 20
Theorem 7. COMP s a (mnmal) dagnoss for (SD,COMP,OBS) ff s a (mnmal) httng set for the collecton of conflcts set. Proof: (1) By proposton 6 COMP\ s not a conflct set for (SD,COMP,OBS). Hence, every conflct set contans an element of, so that s a httng set for the collecton of conflct sets. (2) We now show that COMP\ s no conflct. If t s a conflct set would not ht t, contradctng the fact that s a httng set. 21
Computng Httng Sets F collecton of conflcts 1.Let D represent a growng dag. Generate a node whch wll be the root of the dag. 2.Process the nodes n D n breath-frst order. To process a node n: a. Defne H(n) ) to be the set of edge labels l on the path n D from root to node n. b. If for all xf, x H(n)Ø then label n by. Otherwse, label n by where s the frst member of F whch x H(n)=Ø. c. If n s labeled by a set F, for each σ, generate a new downward arc labeled wth σ. Ths arc leads to a new node m wth H(m)=H(n)U{σ}. The new node m wll be processed after all nodes n the same generaton as n have been processed. 3.Return the resultng dag D. 22
Prunng Rules Reusng nodes: Ths algorthm wll not generate a new m as a descendant of node n. There are two cases to consder: 1. If there s a node n n D such that H(n )=H(n) U{σ}, then let the σ-arc under n pont to ths extng node n. Hence, n wll have more than one parent. 2. Otherwse, generate a new node m at the end of ths σ-arc as descrbed n the basc HS-DAG algorthm. Closng: If there s a node n n D whch s labeled by and H(n )H(n) then close the node n. A label s not computed for n nor any successor nodes are generated. 23
Prunng Rules Prunng: If the set s to label a node n and t has been used prevously, then attempt to prune D as descrbed n the followng: 1. If there s a node n whch has been labeled by the set S of F where S, then relabel n wth. For any n S \, the edge under n s no longer allowed. The node connected by ths edge and all ts descendants are removed, except those nodes wth another ancestor whch s not beng removed. Note that t ths step may elmnate the node whch h s currently processed. 2. Interchange the sets S and n the collecton. Note that ths has the same effect as elmnatng S from F. 24
Example HS-DAG F={{a,b},{b,c},{a,c},{b,d},{b}} {b {a {b {b}} n0: {},{a,b} b n2: {b},{a,c} a c n3: {a,b}, n5: {b,c}, Alexander -- Felferng and Gerald Stenbauer 25
Drawback HS-DAG Need to know or compute conflct sets n advance Idea: Compute conflct set ncrementally when they are requred by the HS-DAG algorthm Theorem Prover: TP(SD,CH,OBS) denotes a theorem prover call returnng a (not necessarly mnmal) conflct set f one exsts,.e., SDUOBSU{ ab(c) CCH} s nconsstent, and otherwse. 26
Computng Dagnoses Dagnose(SD,COMP,OBS) OBS) 1.Generate a pruned hs-dag D for the collecton F of conflct sets for (SD,COMP;OBS) as descrbed prevously, except that whenever, n the process of generatng D a node n of D needs access to F to compute ts label, label that node by TP(SD,COMP\H(n),OBS). 2.Return {H(n) n s a node of D labeled by }. 27
Example 1 Bt Full Adder X1 X2 A1 O1 A2 OBS: A=1, B=0, C n =1, S=1, C out =0 28
Example Dagnose n0: {}, TP(SD,COMP,OBS) OBS) {X1,A1,A2,O1} X1 A1 A2 O1 n1: {X1}, TP(SD,COMP/{X1},OBS) n4: {O1}, TP(SD,COMP/{O1},OBS) {X1,X2} X1 X2 n2: {A1}, TP(SD,COMP/{A1},OBS) {X1,X2} X1 n5: {A1,X1}, TP(SD,COMP/{A1,X1},OBS) X2 n3: {A2}, TP(SD,COMP/{A2},OBS) {X1,X2} n6: {A1,X2}, TP(SD,COMP/{A1,X2},OBS) {X1,A2,O1} X1 X2 n7: {A2,X1}, TP(SD,COMP/{A2,X1},OBS) n9: {O1,X1}, TP(SD,COMP/{O1,X1},OBS) OBS) n10: {O1,X2}, TP(SD,COMP/{O1,X2},OBS) n8: {A2,X2}, TP(SD,COMP/{A2,X2},OBS) OBS) 29
Conflcts 1 Bt Full Adder X1 X2 C 2 C 1 A1 O1 A2 C 3 30
Multple Dagnoss Canddates Problem: How to dstngush between several dagnoses canddates (dscrmnaton)? Idea: Use addtonal measurements? Addtonal measurements e e s are.e. costly. How to select the most valuable addtonal measurement? 31
Measurement Selecton Defnton 5: A dagnoss for (SD,COMP,OBS) OBS) predcts ff SDUOBSU{ab(C) C }U{ ab(c) CCOMP\ }.e., on the assumpton that the components of are all faulty, and the remanng components are all functonng normally, the system behavor must hold. Proposton 8: A dagnoss for (SD,COMP,OBS) predcts ff SDUOBSU{ ab(c) CCOMP\ } 32
Measurement Selecton Theorem 9: Suppose every dagnoss of (SD,COMP,OBS) predcts one of,. Then: 1. Every dagnoss whch predcts s a dagnoss for (SD,COMP,OBSU{}). 2. No dagnoss whch predcts s a dagnoss for (SD,COMP,OBSU{}). 3. Any dagnoss for (SD,COMP,OBSU{}) whch s not a dagnoss for (SD,COMP,OBS) OBS) s a strct t t superset of some dagnoss for (SD,COMP,OBS) whch predcts. Any new dagnoss resultng from the new measurement wll be a strct superset of some old dagnoss whch predcted. 33
Measurement Selecton Corollary 10: Suppose that {} s not a dagnoss for (SD,COMP,OBS). Then under the assumpton of theorem 9, any new dagnoss arsng from the new measurement wll be a multple fault dagnoss. Corollary 11: Suppose that {} s not a dagnoss for (SD,COMP,OBS). OBS) Then under the assumpton of theorem 9, the sngle fault dagnoses for (SD,COMP,OBSU{}) OBSU{ are precsely those of (SD,COMP,OBS) whch predct. 34
Example Measurement Selecton a 3 b c d M1 * A1 10 2 12 2 f 3 M2 * 5 + A2 3 12 M3 * + f g ={{M1},{A1},{M2,A2},{M2,M3}} {A1} {M2 A2} {M2 M3}} ={{M1M2A2}{M2M3A1}{M2A1A2}} {{M1,M2,A2},{M2,M3,A1},{M2,A1,A2}} 35
Next Measurement Pont Gven: dagnoss canddates (mnmal dagnoses and ther superset), fault probabltes for each component p(c), possble measurements x =v k where x denotes the quantty and v k a value. R k canddates whch reman f x s measured to be v be v k S k canddates whch x must be v k U canddates whch do not predct a value for x R k =S k UU and S k U =Ø 36
Next Measurement Pont The best measurement s one whch mnmzes the expected entropy of canddate probabltes resultng form measurement: H e ( x ) m k1 p( x v k ) H ( x v k ) where v 1,.,v m are possble values. 1 m p 37
Next Measurement Pont p ( x v ) p ( S ),0 p ( U ) m k1 p d k ( ) k p( U C k ), p( S p( C) k ) k S k p (1 C COMP\ d k ( ), p( C)) p( U ) U k p d ( ) Assume: Each v k s equal lkely ff a canddate does not predct a value x,.e., k =p(u )/m 38
Next Measurement Pont ) ( ) ( ) / ( ) ( ) ( e e k k x H H x H m U p S p v x p )) ( ln( ) ( ) ( ) ( ) ( k k n e e e v x p v x p x H ) ( ln ) ( )) ( ln( ) ( 1 k k k e U p U p n U p U p values predcted of number ln )) ( ln( ) ( S n m m U p U p )) ( ( mn )) ( ( mn values predcted number of, e e k x H x H S n 39
a b c d f 3 Example Measur. Select. M1 * M2 x 1 A1 2 10 2 3 3 * M3 * x 2 x 3 + A2 + 12 f g p(m1)=p(m2)=p(m3)=p(a1)=p(a2)=0.1 (M2) (M3) (A1) (A2) 1 40
Dagnoss p( ) x 1 x 2 x 3 M1 0.06561 4 6 6 M1,M2 0.00729 4 6 6 M1,M2,M3M2 M3 0.0008100081 - - - M1,M2,M3,A1 0.00009 - - - M1,M2,M3,A1,A2 0.00001 - - - M1,M2,M3,A2 0.00009 - - - M1,M2,A1 0.00081-6 6 M1,M2,A1,A2M2 A2 0.0000900009 - - 6 M1,M2,A2 0.00081 - - 6 M1,M3 0.00729 4 6 6 M1,M3,A1 0.00081-6 6 M1,M3,A1,A2 0.00009-6 - M1,M3,A2 0.00081 4 6 - M1,A1 0.00729-6 6 M1,A1,A2 0.00081-6 6 M1,A2 0.00729 4 6 6 41
Dagnoss p( ) x 1 x 2 x 3 A1 0.06561 6 6 6 A1,M2 0.00729 6 6 6 A1,M2,M3 0.00081 6 - - A1,M2,M3,A2 0.00009 6 - - A1,M2,A2 0.00081 6-6 A1,M3 0.0072900729 6 6 6 A1,M3,A2 0.00081 6 6 - A1,A2 0.00729 6 6 6 M2,M3 0.00729 6 4 8 M2,M3,A2 0.00081 6 4 - M2,A2 0.00729 6 4 6 42
Lne X p(x) X 1 S 1[4] 0.08829 S 1[6] 0.10539 U 1 0.0117101171 X 1 =4 0.094145 X 1 =6 0.111245 X 2 S 2[4] 0.01539 S 2[6] 0.18639 U 2 0.00361 X 2 =4 0.017195 X 2 =6 0.188195 X 3 S 3[6] 0.19368 S 3[8] 0.00729 000 U 3 0.00442 X 3 =6 0.19589 X 3 =8 0.00950 43
Example Measurement Selecton X 1 X 2 X 3 Entropy -0.458637-0.381701-0.360562 44
Problem Computng Measurements Prevous algorthm fts not for large systems, use of supersets Practcal Soluton Use only computed dagnose canddates, no subersets 45
Revsed Algorthm D set of dagnoses for (SD,COMP,OBS) p( x v k where v k ) p d D cond ( ) ( ) SD OBS v,, v undef 1 k ab( C) C COMP H ( x ) p( x vk ) ln( p( x vk )) v k \ ( x v k ) cond( ) Search for mn H(x ) 46
Example Measurment Selecton Lne X p(x) X 1 X 1 =4 0.06561 X 1 =6 0.0801908019 X 2 X 2 =4 0.01458 X 2 =6 0.13122 X 3 X 3 =6 0.13851 X 3 =8 0.06561 X 1 X 2 X 3 Entropy -0.381071-0.328138-0.452532 47
Thank You! Alexander -- Felferng and Gerald Stenbauer 48