Professional Documents
Culture Documents
DX14 Tue PM S1 Paper3
DX14 Tue PM S1 Paper3
DX14 Tue PM S1 Paper3
Abstract
The hypothesis space approach to model-based
diagnosis (MBD) of discrete-event systems
(DESs) finds out candidates by checking each hypothesis, this being a subset of all the possible
faults of the system. The hypothesis is a candidate if, assuming that all - and only - the faults
in the hypothesis itself are affecting the system,
is consistent with the system description and the
observation. In this paper first we address DES diagnosis by taking advantage of the regular structure of partially ordered hypothesis spaces. Second, we consider the problem of generating (only)
physically possible hypotheses, given the DES
model and independently of the specific observation. The hypothesis generation problem is encoded as a planning problem.
Introduction
observation. In this paper we address the problem of generating only PP hypotheses given a DES model and without
taking into account any specific observation. This allows for
off-line reasoning and possible knowledge compilation, that
is, such PP hypotheses can be generated off-line once and
exploited at run time every time that is necessary. Or, alternatively, such PP hypotheses can be generated on-line and
then saved, so as to be reused in the next diagnosis sessions.
We show how to generate new PP hypotheses by encoding
the problem as a planning problem.
The hypothesis space approach is a general method to
perform MBD of DESs, thus being an alternative to previous approaches in the literature. An asset of the hypothesis
space approach is that, instead of exploiting ad hoc diagnosis engines, it enables to solve DES MBD problems by
invoking existing efficient solvers, such as SAT solvers or
planners. The modeling encompassed in Section 2, which
is based on synchronous composition, is general enough to
represent also distributed DESs whose components communicate asynchronously, as explained in [Lamperti and
Zanella, 2013], to which the reader can refer also for complexity issues inherent to the considered task. Thus, altogether, the method dealt with in this paper does not constrain
the class of DESs to be diagnosed.
Context
This section presents the notion of a DES diagnosis problem and the foundation of the hypothesis space approach.
Subsections from 2.1 to 2.4 basically survey (with some minor additions) previous contributions in the literature. Section 2.5 is instead a novelty, the same as Definition 2 in Section 2.6.
A diagnosis problem consists in a DES D and a finite
partially temporally ordered observation O, the latter representing what has been observed while D was running during
a time interval of interest.
2.1
System
2.2
Observation
2.3
Hypothesis Space
2.4
Preferred Hypotheses
generic set S H, denoted as min (S), is defined as follows: {h S|h0 S, h0 h h0 = h}. In particular,
the set min (H) includes all and only the so-called most
preferred hypotheses in H.
In [Grastien et al., 2011], some relations are introduced:
2.5
a, b
a, c
b, c
a, b, c
2.6
We want to compute the preferred diagnosis at a certain abstraction level, represented by a hypothesis space H that is a
posed under relation , that is, given the diagnosis problem
(D, O), we want to compute min ((D, O, H)) without
computing id .
Several methods to compute min () are proposed in
[Grastien et al., 2011; 2012], among which pfs and pfs+e.
Since such methods are relevant to whichever H, be it a
poset or not, they cannot rely on a layered structure of H,
thus they use just one open list of hypotheses, instead of the
two queues (corresponding to two adjacent layers) used by
our algorithm, and, although the first hypothesis to be processed is the same as in our algorithm, the following ones
are different since the insertion of the successors of a hypothesis in the open list is not guided by any specific order.
The method we propose here, instead, exploits the regular
structure of hypothesis spaces that are posets, and generates hypotheses layer by layer, where the hypotheses in each
layer are ordered according to an implicit total order over the
faults in f , which makes it easier to discard irrelevant hypotheses. The algorithm can be regarded as a generalization
of the generation and testing of candidates in best-first order
proposed in [de Kleer and Williams, 1989], however here
we deal with DESs instead of static systems and our notion
of preference relation is broader as we consider all the partial orders. Moreover, we can further prune space H based
on a kind of look-ahead within such a space every time a
hypothesis is checked, provided that a solver that is capable
of performing such a look-ahead is available. This resembles the speed-up of the search performed in [Williams and
Ragno, 2007].
Our method to compute min () consists in setting an
empty set of preferred candidates and iteratively gen-
erating a hypothesis h according to a non-increasing preference order, starting from the most preferred hypothesis.
This generation order guarantees that any newly generated
hypothesis is not more preferable than any candidate in the
set of candidates found so far, thus candidates never need
to be removed from it. Note that generating H layer by
layer, starting from layer 0, provides this guarantee. Once
a candidate h has been found, we do not generate any of
its successors, since they are all less preferable than it. The
pseudo-code of the algorithm relevant to Hset under set
is provided here below. The algorithms for the other poset
spaces are analogous.
1. algorithm preferred_diagnosis(D,O)
2.
h most preferred hypothesis
3.
current h h i
4.
5.
repeat
6.
next empty queue
7.
repeat
8.
h dequeue(current)
9.
result check(h, D, O)
10.
if result = pass
11.
then {h}
12.
if result = pass or result = fail_all
13.
then remove any hypothesis in succng (h) from next
14.
else if result = fail
15.
then h0 succg (h) do
16.
if all immediate predecessors (distinct from h)
of h0 are in current
17.
then enqueue(next, h0 )
18.
until current is empty
19.
current next
20. until current is empty
21. return
At any moment there are two queues, current and next,
that are meant to include hypotheses belonging to the current and next layer of the graph, respectively. Initially, current includes the most preferred hypothesis only (line 3),
while next is empty (line 6). Then two nested loops are run:
at each iteration of the outer loop, a layer of the graph is
considered as the current one (in a top-down order) until an
empty layer is found; at each iteration of the inner loop, a
new hypothesis in the current layer is considered (according
to the order from left to right in Figure 1). The call check(h)
(line 9) invokes a solver that checks whether h is a candidate, returning pass, if it is, fail otherwise.
Optionally, a more powerful solver can be adopted at
line 9 in order to perform a look-ahead. Such a solver returns pass, if h is a candidate, fail if h is not a candidate
but some of its (immediate or non immediate) successors is
a candidate, and fail_ all, in case neither h nor any of its
(immediate or non immediate) successors is a candidate. If
this powerful solver is adopted, the only difference in the
pseudo-code is in line 12, which, in such a case continues
with operator or and the condition that follows it. This small
pseudo-code change may translate into a substantial reduction of the execution time since, in case fail_ all is returned,
it determines the pruning of all the (immediate or non immediate) successors of h in H. Some experimental results to
show cases when this happens can be found at link [Ceriani,
2014].
If h is a candidate, then it is added to the (initially empty)
The generation of the hypotheses in H as done by previous approaches in the literature as well as by algorithm preferred_diagnosis, does not take into account that some hypotheses in H may be inconsistent with the system model
D, regardless of any possible observation O. In particular,
if the solver that is called at line 9 of the algorithm returns
fail, the reason for it may be twofold: either hypothesis h is
not PP or it is PP but it is inconsistent with the observation.
3
As shown in [Sohrabi et al., 2010], a partially ordered observation O expressed as a TEG can be compiled into a classical
planning "final state" goal G.
a, b
a, c
Encoding
We assume that DES D and the hypothesis space H we are
considering are implicitly known from the context.
Each automaton transition is represented as an invariant
fact asserted in the problem initial state and never falsified:
predicate (edge ?s ?d ?e ?m) relates a source state ?s to
a destination state ?d by a label ?e representing the event
that triggers the transition in automaton ?m. To reduce the
model description in terms of number of predicates, each
edge is bound to a specific automaton mi . A full system
description typically requires to encode a number x of
different models mi , where x nc, nc being the number
of components in the system. If x < nc, then several
components share the same behavioral model. For each
component ci , two additional predicates (is ?ci ?m) and
(current ?ci ?s) represent the model and the current state,
respectively. The component model never changes while
the component state may change as a consequence of an
action. Interactions among components are represented as
synchronous events. A synchronous event ej labeling a
transition relevant to component ci is represented by the
invariant fact (synch ci ej ): all the transitions associated
with the same event ej across different components ci
must occur simultaneously, thus constraining the possible
evolutions of the system. A planner is enforced to find
solutions where, for each synchronous transition triggered
by an event ej , a correspondent atomic sequence of actions
appears in the plan : an action for each component ci such
that (synch ci ej ) holds. Predicate (faulty ?e) marks an
event ?e as faulty, and no additional predicate is needed to
mark observable and unobservable events.
The following part of the encoding is dependent on the
selected hypothesis space. In case Hset is considered, we
:parameters
(?c - comp ... ?e - event)
:precondition
(and (not (consumed ?c ?e)) (allowed ?e)
((not (extra-fault)) (faulty ?e) ...))
:effect
(and (consumed ?c ?e) (extra-fault)...)
)
Note that the details of the operators above are not reported and other operators are not shown at all. In general,
the precondition of an operator assures that each state transition of a component occurs in the proper model by checking
that (isinstance ?c ?m) holds for the actual action parameters
ci and mj , representing the component where the transition
takes place and the model of the component, respectively.
Furthermore, the existence of a state transition (edge ?s ?d
?e ?m) from a source state parameter ?s to a destination
state parameter ?d is also ascertained. The effect changes
the current state of component ?c from ?s to ?d.
The encoding described so far is an implementation of Definition 3. The implementation of Definition 4 can be obtained by extending such an encoding as follows: the additional predicate (last-observable) is joined to the goal G
of the planning problem, while a fact (observable oi ) is
added in the problem initial state, for each observable event
oi o . The following (mutually exclusive) conditional
effects are added to each domain operator:
:effect
(and ...
(when (observable ?e) (last-observable))
(when (not (observable ?e))
(not (last-observable)))
)
This operator keeps enabled all the faulty transitions labeled by an event that is not consumed after the extra-faulttransition has finished, thus allowing the planner to (possibly) find an observable transition according to Definition 4.
Without such an operator, hypothesis h0 = he would be refined PP only if there exists a continuation of the trace ending with extra fault e that does not contain other faults and
ends with an observable event. This definition would be too
restrictive.
Finally, given a PP hypothesis h such that n = |h|, both
encodings described above are relevant to computing a PP
hypothesis h0 , which is an immediate successor of h, that
is, such that |h0 | = |h| + 1. Moreover, given algorithm
preferred_diagnosis, the goal is to generate a PP hypothesis
h0 H as an immediate successor of a given hypothesis
h such that h0 succg (h). In Hset , this is achieved by
adding to h a single fault event out of an implicitly known
set 0f f .
Conclusions
As shown in the paper, the generation of the PP hypotheses of a hypothesis space can easily be encoded as an AI
planning problem. A critical point in such encoding is represented by synchronous transitions in distributed DES.
In this paper we have considered just three hypothesis
spaces and basically focused on one of them, Hset , which
is relevant to the abstraction according to which a candidate
is a set of faults. Facing the first question on-line, by integrating the generation of PP hypotheses in Hset with the
production of diagnosis results, while at the same time exploiting the regularity of Hset , is not simple. In fact, if a
hypothesis is not PP, its successors may be PP. Therefore
the hypothesis that is not PP is removed from the space but
we cannot remove its successors without further processing.
Instead, if a hypothesis is a candidate, then all its successors
have to be removed. Since the hypothesis space is implicit,
and we can just generate new hypotheses and check whether
they are candidates or not, these two different kinds of pruning make the generation of new hypotheses more complex
as such hypotheses have not to be the successors of any candidate but they can be the successors of non PP hypotheses.
Actually, the integrated generation of PP hypotheses and
diagnosis results is much more promising in Hseq , the space
where a candidate is a sequence of faults, since, if a sequence is not PP, then all the sequences that include it as
a prefix are not PP themselves, which means that if we
prune a hypothesis h that is not PP, then all its hypotheses
in succg (h) have to be pruned as well. We think that a gain
in efficiency can be achieved in this space, as we will ascertain through future experiments. A closer investigation will
be performed also for space Hms , given not only the preference relations encompassed in this paper but also further
ones.
Finally, we are going to investigate the second question
too, that is, we aim at exploiting on-line the given observation so as to rule out every hypothesis that cannot be consistent with it, possibly without performing any check of the
hypothesis against the observation itself.
References
[Cassandras and Lafortune, 2008] C.G. Cassandras and
S. Lafortune. Introduction to Discrete Event Systems.
Springer Science+Business Media, LLC, New York, NY,
second edition, 2008.
[Ceriani, 2014] L.
Ceriani.
https://github.com/lucacerio84/DX14. 2014.
[de Kleer and Williams, 1989] J. de Kleer and B.C.
Williams. Diagnosis with behavioral modes. In 11th
International Joint Conference on Artificial Intelligence
IJCAI89, pages 13241330, Detroit, MI, 1989.
[Enderton, 1977] H.B. Enderton. Elements of Set Theory.
Academic Press, first edition, 1977.
[Grastien and Haslum, 2011] A. Grastien and P. Haslum.
Diagnosis as planning: two case studies. In Scheduling
and Planning Applications Workshop SPARK11, pages
3744, Freiburg, D, 2011.
[Grastien et al., 2007] A. Grastien, Anbulagan, J. Rintanen,
and E. Kelareva. Diagnosis of discrete-event systems
using satisfiability algorithms. In 22nd National Conference on Artificial Intelligence AAAI07, pages 305
310, Vancouver, BC, 2007.