30
1 Consistent-based Diagnosis Yuhong YAN NRC-IIT

1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper (Minimal) Diagnosis Conflict Set Proposition 3.3 Corollary 4.5

Embed Size (px)

Citation preview

Page 1: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

1

Consistent-based Diagnosis

Yuhong YANNRC-IIT

Page 2: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

2

Main concepts in this paper (Minimal) Diagnosis Conflict Set Proposition 3.3 Corollary 4.5 How to calculate minimal hitting set

(algorithm revised!) Not required: default logic (section 6) and

section 7

Page 3: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

3

Scope of this paper Only uses nominal/right/OK model

OK/right modes / right behaviour Faulty modes / faulty behaviour

Only consider minimal diagnosis (the minimal set of abnormal components)

Is logic foundation for using first order logic for diagnosis

Its revise Its extension

Page 4: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

4

Model

Behavioral model of each type of component:Adder(X) not AB(X) out(X) = inp1(X) + inp2(X)Multiplier(X) not AB(X) out(X) = inp1(X) * inp2(X)...

Structural model:

Multiplier(Mult1), Multiplier(Mult2),

Multiplier(Mult3), Adder(Add1),

Adder(Add2)

out(Mult1) = inp1(Add1)

out(Mult2) = inp2(Add1) = inp1(Add2)

out(Mult3) = inp2(Add2)

Mult1

Mult2

Mult3

Add2

23

23

23

Add1 A

B

Page 5: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

5

Diagnosis on models of structure and function

actualdevice

observedbehaviour

modelof the device

predicted behaviour

diagnosis

design textbook first principles ....

model of the structureof the device and of the (nominal) behaviourof each type ofcomponent

diagnosis = removing discrepanciesbetween the nominal predicted behaviourand the observed one

From Luca Console

Page 6: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

6

Symbols used for system SD: System description, a set of first-order

sentences COMPONENTS: a finite set of constants System: a pair (SD, COMPONENTS) AB(.): unary predicate, “abnormal” : “imply”, other forms: or , other

direction: , :-

Page 7: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

7

Symbol used for observation OBS: observations, a finite set of first-

order sentence, value assignments to some variables.

Observables: the variables can be observed/measured

Page 8: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

8

Consistent There is an interpretation that makes a set

of formulas true. Example:

Consistent: {AB, AB} Inconsistent: {AB,AB, AB, AB}

Connect formula sets with union operator Example: {AB, AB} {AB}

Page 9: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

9

Some explanations Consistency means “AND” of the formulas

in the sets Consistency of SDOBSAB(.)¬AB(.)

Page 10: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

10

Definition: diagnosisA diagnosis for (SD, COMPONENTS, OBS) is a

minimal set COMPONENTS such that

SDOBS{AB(c)|c}{¬AB(c)|cCOMPONENTS- }

is consistent

is the smallest set of components• SD is the right modes

Page 11: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

11

Diagnosis {} is a diagnosis if all components are in

right modes, i.e.SDOBS{¬AB(c)|cCOMPONENTS} is consistent Before computing diagnosis

Should have enough observables Is a NP-hard problem

Page 12: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

12

Proposition 3.3If is a diagnosis for (SD, COMPONENTS, OBS), then

for each ci.

SDOBS{¬AB(c)|cCOMPONENTS- }|=AB(ci)

faulty components are logically determined by the normal components

Page 13: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

13

Compute diagnoses Direct compute Compute conflict set (by using ATMS) then

compute diagnoses from conflict set

Page 14: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

14

Definition: Conflict setA conflict set for (SD, COMPONENTS, OBS) is

a set {c1, …,ck}COMPONENTS such thatSDOBS{¬AB(c1), …, ¬AB(ck)}

is inconsistent

A conflict set for (SD, COMPONENTS, OBS) is minimal iff no proper subset of it a conflict set for (SD, COMPONENTS, OBS)

Page 15: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

15

How to compute diagnosis Theorem4.4: COMPONENTS is a diagnosis for

(SD, COMPONENTS, OBS) iff is a minimal hitting set for the collection of conflict sets for (SD, COMPONENTS, OBS)

(A diagnosis is the minimal hitting set of conflict sets)

Corollary4.5: COMPONENTS is a diagnosis for (SD, COMPONENTS, OBS) iff is a minimal hitting set for the collection of minimal conflict sets for (SD, COMPONENTS, OBS)

Page 16: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

16

Minimal hitting setA hitting set for a collection of sets C is a set

H SCS such that HS{ } for each SC.

A hitting set is minimal iff no proper subset of it is a hitting set for C.

Page 17: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

17

Compute Minimal Hitting Set Hitting set tree (HS-tree): a smallest edge-labeled

and node-labeled tree for C a collection of sets The root is labeled by if C is empty, otherwise the root

is labeled by an arbitrary set of C For each node n of T, let H(n) be the set of edge labels

on the path in T from the root node to n. The label for n is any set C such that H(n) = {}, if such a set exists. Otherwise, the label for n is , If n is labeled by the set , then for each , n has a successor, n, joined to n by an edge labeled by

Page 18: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

18

Mult1

Mult2

Mult3

Add2

23

23

23

Add1 A

B

Prediction: A=12, B=12

12

12Observation A=10, B=12

10

12

A=10 generates two conflicts:{A1, M1, M2}{A1, M1, M3, A2}

Example

Page 19: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

19

HS Tree{M1,M2,A1}

{M3,A2,M1,A1}

M1M2

A1

M3A2 M1

A1

Page 20: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

20

Constructing HS-Tree Keep the HS-tree as small as possible Calculate only minimal hitting set Minimize the number of calls to the

underlying theorem prover

Page 21: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

21

Algorithm: outline Generate a HS-tree Return {H(n)|n is a node labeled }

Page 22: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

22

Algorithm: more detail Select a set from C as root node, label the

root node with this set For each , generate an arc labeled by For a new node n

Select the first member xC, such that H(n)x={}, label n by x. If such x doesn’t exist, label n by “ “.

If n is labeled by x, x , for each x, generate an arc labeled by . If m, H(m)=H(n){}, the arc points to m (a graph)

Page 23: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

23

Optimization Strategies Reusing Nodes:

If m, H(m)=H(n){}, the arc points to m (a graph)

Closing If n’, n’ labeled by “ “ and H(n’)H(n), then

close n. Pruning (Subset problem)

A old node n’, labeled S’; A new node n, labeled

If S’, relabel n’ with . Remove arcs S’- Interchange S’ and in collection

Page 24: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

24

New Measurements A diagnosis can predict some behavior

Example SD OBS {¬AB(c)|cCOMPONENTS-}|=

Confirming measurements preserve diagnoses (which predict )

Disconfirming measurements reject diagnoses (which predict ¬)

Page 25: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

25

Observation vs. Prediction

Mult1

Mult2

Mult3

Add2

2

3

23

23

Add1 A

B(12)

(12)10

12

SD OBS {M1}|={out(Mult1)=4, out(Mult2)=6}

Page 26: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

26

Summary of Reiter’s Paper The diagnosis is the minimal hitting set of

conflict sets An algorithm for computing minimal

hitting set

Page 27: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

27

Assignment 1Use the revised algorithm to compute minimal

hitting set Language: Java Inputs: F is conflict sets (vector of vectors) in a file Outputs: minimal hitting sets (vector of vectors) Option functions:

Display the tree on the screen (good for debug) The number of times visiting conflict sets (efficiency) Single fault diagnoses (only first level) Write result to a file

NO more than required

Page 28: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

28

Please notice The input vectors in different sequences Reduce the access times to conflict sets F Option functions can add points Functions beyond basic functions and

option functions can NOT add points

Page 29: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

29

My test cases 3-multi-2-adder

{{Add1, Mult1, Mult2},{Add1, Mult1, Mult3, Add2}}

Full adder {{X1,X2},{X1,A2,O1}}

Case A {{a,b},{b,c},{a,c},{b,d},{b}}

Case B {{2,4,5},{1,2,3},{1,3,5},{2,4,6},{2,4},{1,6}}

Page 30: 1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5

30

Oral Test Read paperRandall Davis, “Diagnostic Reasoning Based

on Structure and Behavior”, Artificial Intelligence 24 (1984), 347-410

Half hour presentation, half hour q&a Audit students are invited to present