Vous êtes sur la page 1sur 4

www.iji-cs.

org

International Journal of Information and Computer Science (IJICS) Volume 4, 2015


doi: 10.14355/ijics.2015.04.005

Automatic Diagnosis with Constraint Solver


Xuenong Zhang*1, Wei Lu2
Department of E-commerce, GuangDong Pharmaceutical University, Guangzhou, China
zxnxlq@163.com

*1

Abstract
A constraint-based model of diagnostic problem is proposed and the classical diagnostic problem can be transformed to a
problem of constraint solving. Then, a depth first search with branch and bound approach to reduce the complexity of traveling
through the diagnostic space is proposed. Its soundness and completeness is proved. And its complexity is also analyzed.
Keywords
Automatic Diagnosis; Constraint Solving; Diagnostic Model

Introduction
Generally, a diagnostic problem is characterized by a set of observations to account for the differences between the
systems actual behaviors and its expected behaviors. Because of its generality and its dramatic importance in
many application domains, automated diagnosis has been receiving considerable attention in the field of AI
research.
The classical diagnostic method is built on the well-known consistency-based theory [1] and the classical model
describes the system's structure and behavior usually by the first-order language. This theory was extended by de
Kleer et al. [2] in 1992. Another logical theory of diagnosis, developed by Console et al. [3] and others, was called
abductive diagnosis. They used logical implications from causes to effects to represent causal knowledge. The
diagnostic process is formulized as reasoning from effects to causes.
The computational complexity of diagnosis is one of the well-known problems that need to be tackled in order to
deploy the real-world applications of Model-based diagnosis. Several relevant contributions can be found in the
literatures [4, 5].
In recently years, some effective constraint solvers [6] have been proposed. For utilizing constraint solving
technology, we propose a constraint-based model of diagnostic problem and a diagnostic algorithm in this paper.
Constraint-Based Model
In this section we introduce the diagnostic model based on constraint.
Definition 1 Diagnostic Problem
Diagnostic problem is a triple (SD, COMPS, OBS) where:
(1) SD is a function : COMPS R, where R is a set of constraints corresponding to components. Var(R)=
Varinter(R) + Varobs(R) is the set of constraint variables, and Varinter(R) is the set of internal variables, Varobs(R)
is the set of external variables;
(2) COMPS is a set of components;
(3) OBS is a set of observes.
Definition 2 Diagnosis Space
SH=2COMPS is called diagnosis space, and diagnostic hypothesis hSH is a set of components.
Definition 3 Observe Space
Observe space SOBS=dom(v1) dom(vi) is a set of all possible observes, where viVarobs(R), dom(vi) is the domain of

30

International Journal of Information and Computer Science (IJICS) Volume 4, 2015

www.iji-cs.org

variable vi.
Definition 4 Diagnostic Solution
A solution D of a diagnostic problem (SD, COMPS, OBS) is a diagnostic hypothesis h where the constraint problem
{ (a1),, (an) | aiCOMPS-h} OBS is satiable.
Theorem 1 If a diagnostic hypothesis h is not a solution of a diagnostic problem (SD, COMPS, OBS), any hh is
also not a solution.
Proof: If a diagnostic hypothesis h is not a solution of a diagnostic problem (SD, COMPS, OBS), the constraint
problem { (a1),, (an) | aiCOMPS-h} OBS is not satiable. Therefore, { (a1),, (an) | aiCOMPS- h} OBS
is not satiable because of hh.
Definition 5 Minimal Diagnostic Solution
A solution D is minimal if and only if not exist any solution DD.
The intuitive mean of diagnostic solution is: because components in set D are abnormal, their outputs are
propagated by normal components and lead to the abnormal output of system.
On the basis of above, we can search minimal diagnostic solutions with a constraint solver.
Searching All Minimal Diagnostic Solutions
In this section, the idea of searching all minimal diagnostic solutions will be described with a simple example at
first. Then, we will present the algorithm and prove its soundness and completeness.
Example 1
The poly-box system depicted in Fig. 1 contains five components: M1, M2 and M3 are multipliers, and A1 and A2
are adders. The system's inputs are: A = 2, C = 2, E = 2, B =3, D = 3, F = 3; its outputs are: G =10, H =12. There are four
minimal diagnostic solutions: {(A1), {M1}, {M2, A2} ,{M2, M3}.

FIG 1: POLY-BOX SYSTEM

For finding all minimal diagnostic solutions, a nave approach works as follow circularly:
(1) Generate a hypothesis h;
(2) Test if (a1),, (an) | aiCOMPS-h} OBS is satiable by a constraint solver;
(3) If it is satiable then add h to solution and delete the supersets of h.
Because the diagnostic space includes 2COPMS hypothesizes, it is important to choose the candidate hypothesis. On
the basis of theorem 1 and definition 5, there are three facts which can be utilized for searching minimal diagnostic
solutions:
(1) all subsets of a minimal diagnostic solution are not minimal diagnostic solutions;
(2) all supersets of a minimal diagnostic solution are not minimal diagnostic solutions;
(3) all subsets of a diagnostic hypothesis which is not a diagnostic solution are not diagnostic solutions.

31

www.iji-cs.org

International Journal of Information and Computer Science (IJICS) Volume 4, 2015

With these facts, we will propose a depth first search with branch and bound approach to reduce the complexity of
traveling through the diagnostic space.
Algorithm 1
diagnosis (hypothesis, work-list, stack, prune-list)
lw:=work-list; s:=stack; pl:=prune-list;
s.push(hypothesis);
while stack is not empty do
{
h:= s.pop();
if h is not marked then
{
mark h;
if { (a1),, (an) | aiCOMPS-h} OBS is satiable then
{
removes all supersets of h from the solution;
if no subset of h is in solution then insert h to solution and lw
for all subsets h where |h|=|h |-1 do
{
if h is not a subset of any member in the prune-list pl then
{
if lw= then s.push(h) else
{ S:=lw.first;
if S h then
{for all subsets h where |h|=| h |-1 and S h do diagnosis (h, lw/{S}, s, pl)}
else diagnosis (h, lw/{S}, s, pl) }
}
}
else
{removes all subsets of h from pl;
if no superset of h is in pl then insert h to the pl; }
}
}
}
Theorem 2 Algorithm 1 is sound and complete.
Proof: Because any hypothesis h inserted to solution is satisfied with (a1),, (an) | aiCOMPS-h} OBS and
there is not a subset of h in solution, algorithm 1 is sound.
According to algorithm 1, all satiable hypothesizes are divided into three parts: (1) not be inserted to solution,
which is the superset of a member of solution; (2) be removed from solution, which is also the superset of a new
member of solution; (3) minimal diagnostic solution. Therefore, all minimal diagnostic solutions will be found. In
another word, algorithm 1 is complete.
Example 2
For finding all minimal diagnostic solutions of the problem in example 1, all tested hypothesizes in the diagnostic
space are depicted in Fig. 2. The underlined hypothesis is tested by constraint solver. Algorithm 1 only chooses 10
candidates from 32 hypothesizes to test and finds 4 minimal diagnostic solutions.
Complexity Analysis of Algorithm
The algorithm goes over through the hypothesis h where |h|=| h |-1 and s h. There are at most |S|-1 such
hypothesizes. For each one, the algorithm is recursively called with next m in lw as long as lw is not empty.
32

International Journal of Information and Computer Science (IJICS) Volume 4, 2015

www.iji-cs.org

Obviously, S is bounded by the number of components n and lw is bounded by |solution|. Therefore, the algorithm
will be invoked n |solution| times at most by itself. In each time of the invoked algorithm, it will add at most one
hypothesis to the stack. Thus, it provides at most n |solution|+1 trial hypothesizes until S is added to solution.
In the first time, only COMPS is in the stack and solution is empty and any S satisfied with (a1),, (an) |
aiCOMPS-S} OBS is a subset of COPMS. Therefore, there are at most |solution| n |solution|+1 hypothesizes will be
tested by constraint solver.
Therefore, the runtime complexity is O(|solution| n |solution|+1).

FIG 2: DIAGNOSTIC SPACE AND TESTED HYPOTHESIZES

Conclusions
For utilizing the effective constraint solver, a constraint-based model of diagnostic problem is proposed, and the
classical diagnostic problem can be transformed to a problem of constraint solving. On the basis of above, invoking
a constraint solver, a depth first search with branch and bound approach to reduce the complexity of traveling
through the diagnostic space is proposed. It can search all minimal diagnostic solutions effectively.
ACKNOWLEDGMENT

This paper is supported by Guangdong Natural Science Foundation (Grant No: S2011010002511).
REFERENCES

[1] R. Reiter, A theory of diagnosis from first principles. Artificial Intelligence, 1987, 32(1);57-96.
[2] J. de Kleer, A.K. Mackworth, R. Reiter, Characterizing diagnoses and systems, Artificial Intelligence, 1992, 52:197-222.
[3] Console L., Torasso P., A spectrum of logical definitions of model-based diagnosis. Computational Intelligence,
1991,7(3):133-141.
[4] Yannick Pencole. A formal framework for the decentralised diagnosis of large scale discrete event systems and its
application to telecommunication networks. Artificial Intelligence, 2005, 164: 121-170.
[5] Luigi Portinale, Diego Magro, Pietro Torasso. Multi-modal diagnosis combining case-based and model-based reasoning:a
formal and experimental analysis. Artificial Intelligence 2004,158:109153.
[6] Ji xiaohui, Zhang jian. Constraint processing. ACTA Automatica Sinica, 2007,33(2):125-131.

33

Vous aimerez peut-être aussi