280 likes | 399 Views
Non-minimal Diagnoses. Philippe Dague and Yuhong Yan NRC-IIT Philippe.dague@lipn.univ-paris13.fr Yuhong.yan@nrc.gc.ca. {A, B, C}. {A, B}. {A, C}. {B, C}. {A}. {B}. {C}. {}. Diagnosis.
E N D
Non-minimal Diagnoses Philippe Dague and Yuhong Yan NRC-IIT Philippe.dague@lipn.univ-paris13.fr Yuhong.yan@nrc.gc.ca
{A, B, C} {A, B} {A, C} {B, C} {A} {B} {C} {} Diagnosis • Consider only assignment AB(c) and ¬AB(c) for diagnoses, the size of diagnostic space is 2n, n= number of components • Diagnostic space is structure by set inclusion as a lattice
A principle of parsimony has been adopted by Reiter: considering only minimal (for set inclusion) diagnoses • Question: Do these minimal diagnoses characterize all diagnoses? • Expected answer: yes, any superset of a diagnosis is a diagnosis as well (Minimal Diagnosis Hypothesis) • This is verified for the polybox with correct mode, and the 3-inverter with correct and faulty modes (but with the unknown mode).
Counter Example(1):exhaustive fault modes I1 I2 • Assume the only fault modes are stuck at 0 and shorted (no unknown mode): Inverter(x)AB(x) S0(x) Short(x) S0(x) out(x)=0 Short(x) out(x) = in(x) Diagnoses = minimal diagnoses = {I1} (stuck at 0 or shorted) {I2} (shorted) But the superset {I1,I2} is not a diagnosis Reason: I2 can’t be stuck at 0, so it should be shorted, but in this case out(I1)=1 and I1 can’t be stuck at 0 nor shorted 1 0 Example 1.a)
Counter Example(1):exhaustive fault modes • Suppose that in addition to correct modes, we have AB(adder) adder acts as multiplier • Same observation as before {F=10, G=12} • {M1} is still a minimal diagnosis but the superset {M1, A2} is not any more Example 1,b) Polybox
Counter example (2): Exoneration • Exoneration: correct mode expressed as necessary and sufficient condition of correctness • 2-inverter: Inverter(x) (¬AB(x) [In(x) = 0 Out(x)=1][In(x) = 1 Out(x)=0]) • Minimal diagnosis = {} • But the supersets {I1} and {I2} are not diagnoses. Each inverter exonerates the other (is an alibi for the other) 0 0 Example 2.a)
Counter example (2): Exoneration • 3 light bulbs Bulb(x) voltage(x, on) [¬AB(x) lit(x)] • Observation: only B3 is lit • {B1, B2} is a minimal diagnosis. The superset {B1, B2, B3} is not • Reason: B3 can’t be faulty, as it is lit. Example 2.b)
Conclusion: • The minimal diagnosis hypothesis is not satisfied in general, as soon as exhaustive fault modes or sufficient condition of correctness exists • So in the diagnostic space lattice, diagnoses are not characterized by minimal diagnoses • Questions: does a logical characterization of the diagnoses in the general case exist? • Answer: yes. • For this, the notion of conflict has to be generalized
Recall: • Notation: for Components, D() = [AB(c)|c ] [AB(c)|c Components\] • Definition: a diagnosis is a D() such that SD OBS {D()} is satisfiable • Definition: minimal diagnosis is a diagnosis D() such that for no proper subset ’ of is D(’) a diagnosis • Definition: a conflict as defined by Reiter (named from now a R-conflict) is a subset C of Components such that SD OBS {AB(c)|c C} |= • Logically it is equivalent to SD OBS |= {AB(c)|c C} ( a disjunct of AB(c) is entailed by SD OBS)
What appears in the counter example? 1.a (2-inverter) SD OBS |= AB(I1)AB(I2) But also SD OBS |= ¬AB(I1)AB(I2) 1.b (polybox) SD OBS |= AB(M1)AB(M2) and SD OBS |= AB(M1)AB(M3) But also SD OBS |= AB(M2)AB(M3)¬AB(A2) 2.a SD OBS doesn't entail disjunct of AB but SD OBS |= AB(I1)AB(I2) SD OBS |= AB(I1)AB(I2) 2.b SD OBS |= AB(B1) and SD OBS |= AB(B2) but also SD OBS |= AB(B3)
Extension: conflict • So the idea is to extend a conflict to any conjunct of AB(c) and ¬AB(c) entailed by SD OBS . • Definition: An AB-literal is AB(c) or ¬AB(c) for some c Components. • An AB-clause is a disjunction of AB-literals containing no complementary pair of AB-literals. • A positive AB-clause is an AB-clause all of its literals are positive • Definition: A conflict of (SD, Components, OBS) is an AB-clause entailed by SD OBS. • A positive conflict is a conflict which is a positive AB-clause • Remark: one can identify a positive conflict with an R-conflict
Extension: conflict (2) • Definition: a minimal conflict is a conflict no proper sub-clause of which is a conflict • Example: see 1.a) 1.b) 2.a) 2.b) (the right side formulas in slide 10 are the minimal conflicts) • Remark: one can identify a minimal positive conflict with a minimal R-conflict
Extension: conflict (3) • Suppose is a set of first order sentences, a ground clause is an implicate of iff entails c. c is a prime implicate of iff no proper sub-clause of c in entailed by • Minimal conflicts are AB-clauses which are prime implicates of SD OBS. • Minimal conflicts can be computed by theorem prover or ATMS
Extension: conflict (4) • Reiter’s property relating minimal diagnosis to minimal R-conflict can be reformulated. • Property: let + be the set of positive minimal conflicts of (SD, Components, OBS) and Components, then D() is a minimal diagnosis iff is a minimal subset such that +{D()} is satisfiable • This property generalizes as Property: let be the set of minimal conflict of (SD, Components, OBS) and Components, then D() is a diagnosis iff {D()} is satisfiable
Characterizing minimal diagnoses from positive minimal conflicts • Def: Suppose is a set of propositional formulas, a conjunction of literals (containing no pair of complementary literals) is an implicant of iff entails each formula of . is a prime implicant of iff no proper sub conjunction of is an implicant of .
Characterizing minimal diagnoses from positive minimal conflicts (2) • The Reiter’s characteristics of minimal diagnoses as minimal hitting sets of the collection of minimal R-conflicts can be reformulated as: • Theorem: D() is a minimal diagnosis of (SD, Components, OBS) iff [AB(c)|c ] is a prime implicant of the set of the positive minimal conflicts of (SD, Components, OBS).
When minimal diagnoses are enough to characterizing all diagnoses? • Theorem: Minimal diagnosis hypothesis holds (i.e. D(’) is a diagnosis iff ’ with D() a minimal diagnosis) iff all minimal conflicts are positive • Unfortunately there is no equivalent condition on the syntactic form of SD and OBS. But it exists sufficient conditions. We consider 2 of them
the Ignorance of Abnormal Behaviour (IAB) • Def: the Ignorance of Abnormal Behaviour (IAB) condition holds iff in the clause form of SDOBS every occurrence of an AB-predicate is positive • Theorem: If (SD, Components, OBS) satisfies the IAB condition, then MDH holds
IAB(2) • IAB is ensured, for example, if all sentence of SD where AB appears follow the schema: AB(x)P1(x)P2(x)… Pn(x)G1(x)… Gm(x) Where literals Pi(x) and Gj(x) do not mention AB • i.e. when only necessary condition of correct behaviour are expressed • Example: AB(x)transistor(x)On(x)off(x)saturated(x) AB(x)resistor(x)ports(x,[a b])resistance(x)=r v(x, a, b) = r * i(x,a)
Limited Knowledge of Abnormal Behaviour (LKAB) • Def: the Limited Knowledge of Abnormal Behaviour (LKAB) condition holds iff (Cp, Cn, c), CpComponents, Cn Components, CpCn =, cComponents, cCp,cCn, SDOBS{[AB(x)|xCp] [AB(x)|xCn]} satisfiable, SDOBS{AB(c)} satisfiable SDOBS{[AB(x)|xCp{c}] [AB(x)|xCn]} • Remark: IAB LKAB
LKAB(2) • LKAB is ensured, for example, if all sentences of SD where AB appears have one of the following two forms: AB(x)P1(x)P2(x)… Pn(x)G1(x)… Gm(x) AB(x)P1(x)P2(x)… Pn(x)F1(x)… Fm(x)U(x) Where Gi(x) describes a possible correct behaviour for x, Fi(x) describes a possible faulty behaviour for x, U(x) an unknown behaviour (Gi(x), Fi(x), U(x) only occur negatively in other clauses and U(x) only occurs in clauses expressing it is distinct of any Gi(x) and any Fi(x).) • i.e. when only necessary conditions of correct behaviours and necessary condition of non-exhaustive faulty behaviours (with unknown mode) are expressed.
LKAB(3) • (see example in lecture “diagnoses with fault modes”). • Theorem: if (SD, Components, OBS) satisfies the LKAB condition and D() is a diagnosis, then D(’) is a diagnosis for every ’ , such that for each c, SDOBS {AB(c)} is satisfiable
Charactering Diagnoses from Minimal Conflicts • Compact representation of diagnoses • Example: 1.b) AB(M1) AB(A2) K1(M2) K2(M3) K3(A1), where Ki={AB or AB} they can be coded as AB(M1) AB(A2)
Compact representation of diagnoses • Definition: A partial diagnosis for (SD, Components, OBS) is a satisfiable conjunction P of AB-literals such that for every satisfiable conjunction P’ of AB-literals containing P as sub-conjunction, SDOBS {P’} is satisfiable • Remark: if C, of size k, is the set of all components mentioned in P, the P [K(c)|cComponents\C] is a diagnosis, where each K(c) is AB(c) or AB(c). So P codes 2n-k diagnoses
Kernel diagnosis • It is natural to consider the minimal such partial diagnoses: • Definition: A kernel diagnosis is a partial diagnosis whose no proper sub-conjunction is a diagnosis • Property (Characterization of Diagnoses) D() is a diagnosis iff there is a kernel diagnosis which is a sub-conjunction of it
Kernel Diagnoses (2): Examples 1.a) 2 kernel diagnoses AB(I1)AB(I2) and AB(I1)AB(I2) 1.b) 4 kernel diagnoses: AB(M1)AB(A2) AB(M1)AB(M2) AB(M1)AB(M3) AB(M2)AB(M3) 2.a) 2 kernel diagnoses AB(I1)AB(I2) AB(I1)AB(I2) 2.b) 1 kernel diagnosis AB(B1)AB(B2)AB(B3)
Theorem • Theorem (Characterization of partial and kernel diagnoses from minimal conflicts) • The partial diagnoses of (SD, Components, OBS) are the implicants of the minimal conflicts of (SD, Components, OBS) • The kernel diagnoses of (SD, Components, OBS) are the prime implicants of the minimal conflicts of (SD, Components, OBS) • The minimal diagnoses are the prime impliants of positive minimal conflicts • Remark: if all minimal conflicts are positive, there is a 1 to 1 correspondence between kernel diagnoses and minimal diagnoses [AB(c)|cK] [AB(c)|cK] [AB(c)| cComponents\K]
Exercise • Full adder in Reiter’s paper (figure 1). • Use kernel diagnosis to find diagnosis • Use two-direction imply () in the model to find kernel diagnosis • Add the axiom that all variables are Boolean (x=0x=1), find kernel diagnosis