14
Coloured Petri Nets Based Diagnosis on Causal Models Soumia Mancer and Hammadi Bennoui Computer science department, LINFI Lab. University of Biskra, Algeria [email protected], [email protected] Abstract. In the last decades, several approaches have been proposed in order to capture the problem of causal model-based diagnosis within Petri Nets (PNs) framework, where both the structural and behavioural analysis of the net model are exploited for reasoning. In fact, PNs are a useful tool, but most of the approaches suffer from the large size of the obtained models even for simple systems. This paper introduces a novel class of Coloured Petri Nets (CPNs) called Causal CPNs. Such a net model is motivated by representing the causal behaviour of the system to be diagnosed, as well as, simplifying the analysis methods. The diagnosis technique exploits backwardly the reachability graph of the net model. A case study is used to illustrate the usefulness of our proposal for fault diagnosis. Keywords: model-based diagnosis, causal models, coloured Petri nets, reachability graphs 1 Introduction Model-based approach as an alternative to heuristic based one, especially when the experimentations are missing, deals widely with fault diagnosis in such a manner that the examination of a given system is done on the basis of a model. It aims at explaining any observed behaviour that conflicts with the way the system is meant to behave. Among the diagnosis frameworks found in the literature, those based on causal models where the explanations would be given in terms of initial causes leading the system to a misbehaviour. In logical frameworks, a causal model-based diagnosis problem is traditionally solved through symbolic manipulations that are shown as a cumbersome task; and hence, numerous attempts to face this problem have been done. In partic- ular, Petri nets (PNs) have been used to represent the causal model, and so to exploit their analysis techniques to implement efficiently the diagnosis reason- ing mechanisms [1, 2]. For problems where the net model is large or composed of some identical parts, it is well known that Coloured PNs (CPNs) are well suited to use with respect to classical PNs. By means of data type primitives, it is possible to achieve a reduced model about the behaviour of the system under examination. The manipulation of the data values carried by tokens that

Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

Coloured Petri Nets Based Diagnosis on CausalModels

Soumia Mancer and Hammadi Bennoui

Computer science department, LINFI Lab.University of Biskra, Algeria

[email protected], [email protected]

Abstract. In the last decades, several approaches have been proposedin order to capture the problem of causal model-based diagnosis withinPetri Nets (PNs) framework, where both the structural and behaviouralanalysis of the net model are exploited for reasoning. In fact, PNs area useful tool, but most of the approaches suffer from the large size ofthe obtained models even for simple systems. This paper introduces anovel class of Coloured Petri Nets (CPNs) called Causal CPNs. Sucha net model is motivated by representing the causal behaviour of thesystem to be diagnosed, as well as, simplifying the analysis methods.The diagnosis technique exploits backwardly the reachability graph ofthe net model. A case study is used to illustrate the usefulness of ourproposal for fault diagnosis.

Keywords: model-based diagnosis, causal models, coloured Petri nets,reachability graphs

1 Introduction

Model-based approach as an alternative to heuristic based one, especially whenthe experimentations are missing, deals widely with fault diagnosis in such amanner that the examination of a given system is done on the basis of a model. Itaims at explaining any observed behaviour that conflicts with the way the systemis meant to behave. Among the diagnosis frameworks found in the literature,those based on causal models where the explanations would be given in termsof initial causes leading the system to a misbehaviour.

In logical frameworks, a causal model-based diagnosis problem is traditionallysolved through symbolic manipulations that are shown as a cumbersome task;and hence, numerous attempts to face this problem have been done. In partic-ular, Petri nets (PNs) have been used to represent the causal model, and so toexploit their analysis techniques to implement efficiently the diagnosis reason-ing mechanisms [1, 2]. For problems where the net model is large or composedof some identical parts, it is well known that Coloured PNs (CPNs) are wellsuited to use with respect to classical PNs. By means of data type primitives,it is possible to achieve a reduced model about the behaviour of the systemunder examination. The manipulation of the data values carried by tokens that

Page 2: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

reside in places of a CPN model is done through the arc expressions. Generally,those expressions are functions that define the added/removed tokens to/from aplace. Nevertheless, when analysing the CPN model backwardly, those expres-sions may exhibit a more complicated process because of the inversion task. Inorder to simplify this latter, and so, the analysis phase, we propose resorting tomatrices as a way of manipulating the token colours in the net model.

In this paper, we focus on the use of CPNs for causal model-based diagnosis.For that reason, we introduce a particular CPN called Causal-CPN (CCPN)that allows representing the causal behaviour of the system to be diagnosed bymeans of causal matrices that are attached to transitions of the net model. Causalmatrices are used to define the possible inputs and their associated outputs oftransitions as causal relationships. For solving a given diagnosis problem basedon CCPN, a backward analysis on the corresponding markings graph is definedin this paper to generate the possible diagnoses. In fact, such analysis can beseen as the coloured version of the BW-analysis that has been proposed in [2]for some simplified Petri nets called Behavioural Petri Nets.

The present paper starts in section 2 by outlining briefly some basic defini-tions on which we will rely throughout the paper. Section 3 introduces the CCPNmodel by which it is possible to restrict CPNs for representing causal models. Aformalisation of the model-based diagnosis problem by means of CCPNs is de-tailed in section 4, and solving such a problem is shown in section 5 by exploitingthe backward reachability analysis on reachable markings graph. Finally, section7 concludes the paper and outlines future work.

2 Preliminaries

In this section, we outline some basic definitions that we need in this paper.

2.1 Causal model

From [1], a causal model is a couple (V,E) where V is a set of entities, notedstates, and E is a set of cause-effect relationships among states. For the diagnosisreason, states are classified into Initial-causes, Internal states and Manifestations.The states of a causal model are used to represent the states (partial states) ofthe modelled system. Initial causes represent initial states from which any evo-lution in the system begins. Internal states describe the unobservable part of thesystem as consequences of initial states. Manifestations represent the observablestates of the system as consequences of internal states. Each of the states canbe instantiated by assigning a value to it from a finite and predefined set notedadmissible_values. It is important to keep in mind that each state must assumeat most one value at a given time and it can be present on the model or absent.

2.2 diagnosis problem

A diagnosis problem is defined logically in [3] as a triple DP = (BM, INIT,<Ψ+, Ψ− >) where BM is the behavioral model of the system to be diagnosed,

124 PNSE’17 – Petri Nets and Software Engineering

Page 3: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

INIT is the set of instances of initial causes in terms of which the obser-vations have to be explained, Ψ+ is a subset of observations to be entailedby a solution of DP and Ψ− is the set of all possible values that conflictwith the made observation (that are known to be absent in the case underexamination). Let OBS be the current set of observations, thus, Ψ+ ⊆ OBSand Ψ− = {m(x)|m(y) ∈ OBS, x 6= y} such that m is a manifestation andx, y ∈ admissible_values(m). A solution to DP is a set ∆ ⊆ INIT such that∆ predicts each parameter in Ψ+ and no parameter in Ψ−:

∀x ∈ Ψ+ BM ∪∆ ` x∀y ∈ Ψ− BM ∪∆ 0 y

Where ` is the derivation symbol.

2.3 Coloured Petri nets

Coloured Petri Nets [4] are high-level nets merging both Petri Nets and thefunctional programming language Standard ML in one model. CPNs still retain,as strong points of PNs, the foundation of the graphical notation and the basicprimitives for modelling concurrency, communication and synchronisation, whileStandard ML provides the primitives for data types definition and data valuesmanipulation.

As CPNs are basically PNs, it is important to keep in mind that a CPNmodel is defined by a finite set of places, a finite set of transitions and a finiteset of arcs as connections between places and transitions. Each place has anassociated type and may hold one or more tokens each of which carries a datavalue belonging to the place’s type. By convention, types are colour sets thus,tokens are token colours.

Each place has its own marking which is a multiset of token colours thatare present in such a place. The sum of individual place markings gives themarking of the CPN model. The marking changes during the execution of themodel by means of transition’s firing. As it is known, when a transition occursit removes tokens from its input places and it adds tokens to its output places.In CPN, the removed (resp. added) tokens are determined by an arc expressionassociated to the outgoing (resp. incoming) arc from (resp. to) a place. An arcexpression is built from typed variables, constants, operators, and functions andit evaluates to a multi-set of token colours. Moreover, it can be attached to eachtransition a boolean expression (with variables) called a guard which specifiesthe bindings for which it evaluates to true. A binding is an assignment of datavalues to the free variables appearing in the expression of an incoming arc ora guard of a transition. A binding of a transition can be written in the form:(v1 = d1, v2 = d2, ..., vn = dn) where for i ∈ 1..n : vi is a variable and di is thevalue assigned to vi.

A transition t is enabled, ready to occur, if there is a binding such that:1) the evaluation result of each of the input arc expressions is present on thecorresponding input place; and 2) the guard (if any) is satisfied. The firing of a

Mancer et.al.: Coloured Petri Nets Based Diagnosis on Causal Models 125

Page 4: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

t adds to each output place a multi-set of token colours to which the expressionon the corresponding output arc is evaluated.

Before recalling the formal definition of a CPN from [4], we recall the conceptof multi-sets. A multiset is a set where individual elements may occur more thanonce.

Definition 1. (Multi set) A multiset m, over a non-empty set S, is a functionm ∈ [S → N] represented formally by:

∑s∈Sm(s)′s.

• ∀s ∈ S : s ∈ m iff m(s) 6= 0.• SMS is set of all finite multi-sets over S.

A set of operations that can be applied on multisets are defined as follows:∀m,m1,m2 ∈ SMS and ∀n ∈ N:

|m| =∑s∈Sm(s).

m1 +m2 =∑s∈S(m1(s) +m2(s))

′s.m1 6= m2 = ∃s ∈ S : m1(s) 6= m2(s).m1 6 m2 = ∀s ∈ S : m1(s) 6 m2(s)

(defined analogously for >).

Thus, a CPN is given by:

Definition 2. A Coloured Petri net (CPN) is a 6-tuple N = (Σ,P, T,A,C,G)where:

• Σ is a non-empty set of types (colour sets).• P is a non-empty set of places.• T is a non-empty set of transitions.• P ∩ T = ∅, P ∪ T 6= ∅.• A is a non-empty set of arcs such that: A ⊆ (P × T ) ∪ (T × P ).• C : P → Σ is a colour function maps each place into a colour set.• G is a guard function maps each transition into a boolean expression.

Definition 3. A marked CPN is a pair (N,µ) where N is a CPN and µ is afunction defined on P such that:

µ(p) ∈ C(p)MS ,∀p ∈ P.

3 Causal-Coloured Petri nets

CPNs are used for representing and analysing a large variety of systems. Thecolour set concept allows us to obtain a reduced net model. While through theexpressions associated with transitions (guards) or the arcs we define the possiblecombinations of input and output token colours for a transition to fire, and so,describing the evolution of the system under study. All the analysis techniquesdefined for classical PNs are extended for CPNs. Among them, we are interestedin backward ones. The backward analysis of a CPN seems as an inversion of

126 PNSE’17 – Petri Nets and Software Engineering

Page 5: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

the net model [5] and hence realising the analysis forwardly. The main problemthat arises, here, is the backfiring of a transition. When inverting the arcs, theirexpressions have to be inverted too, and the same as the transition’s guard.Such an inversion depends on the input and the output arc expressions of thetransition. It may lead to a combinatorial explosion in some cases. In order to facethis problem, we propose associating with each transition a matrix describingthe possible combinations of input and output token colours. As a result, theexpressions of the input arcs of a transition are typed variables and the outputones are simple expressions that extract from a given matrix and according to theinput tokens the possible output ones. In the following, we introduce a particularclass of CPNs called Causal CPNs characterised by matrices associated with theirtransitions. CCPNs are used to represent the causal behaviour of the systemunder examination.

Definition 4. A Causal-Coloured Petri Net is a 6-tuple N = (Σ,P, T,A,C, FW )where:

• (Σ,P, T,A,C) is a CPN.• P = Ic ] Is ]Mn:

Ic = {p|p ∈ P, •p = ∅}1, Mn ⊆ {p|p ∈ P, p• = ∅} while Is = P \ (Ic ∪Mn).

• A+, denotes the transitive closure of A, is irreflexive.• FW : T −→MATn,m(

⋃ω∈Σ ω)

2 such that:◦ n is the number of transitions for which a transition t may be unfoldedin a classical PN (i.e, it is the number of ways that t may fire.)◦ m = |•t|+|t•| defines the number of places connected with t, either inputsor outputs.

Definition 5. A marked CCPN is a pair (N,µ) where N is a CCPN and µ isa marking such that:

∀p ∈ P : |µ(p)| 6 1.

Let µ0 be the initial marking of N such that: ∀p ∈ P : µ0(p) 6= ∅ → p ∈ Ic.

Definition 6. A marked CCPN (N,µ0) is said to be safe iff:

∀p ∈ P, ∀µ ∈ R(N,µ0) : |µ(p)| 6 1.

Where R(N,µ0) denotes the reachability set from µ0.

Let us introduce the following notations for the rest of the paper.

Note 1. ∀t ∈ T and ∀(x1, x2) ∈ A:

– A(t) denotes the set of the input arcs of t.1 •x = {y|(y, x) ∈ A} and x• = {y|(x, y) ∈ A} denote the input and output sets of xrespec. where x ∈ P ∪ T .

2 MATn,m(⋃ω∈Σ ω) defines the space of matrices of n lines and m colomns.

Mancer et.al.: Coloured Petri Nets Based Diagnosis on Causal Models 127

Page 6: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

– V ar(t) denotes the set of variables that appear in the input arc expressions oft and in its associated guard G(t) (it is also used for expressions V ar(expr)).In a CCPN model: V ar(G(t)) = V ar(t).

– E(x1, x2) denotes the expression attached to an arc (x1, x2).

Definition 7. A binding of a transition t is a function b defined on V ar(t) suchthat:

- ∀v ∈ V ar(t) : b(v) ∈ Type(v).- Let V ar(t) = {v1, ..., vn}: [b(v1) b(v2) ... b(vn)] be the ith sub-vector-line ofFW (t).

Expr < b > denotes the evaluation of the expression Expr in the binding b.

As a particularity of CCPN, in comparison with CPN, is the irreflexivityof A+; hence, the CCPN model is acyclic. Thus, it is possible to introduce apartial order, noted ≺, between its transitions. Such an order is inspired fromthat which is defined for BPNs in [2] as follows:

Let t1, t2 ∈ T : t1 ≺ t2 ⇔ t1A+t2.

Definition 8. Let µ be a marking, a transition t is enabled at µ iff:

∀p ∈ •t : E(p, t) < b > 6 µ(p) and @t′ ≺ t s.t t′ is enabled.

Definition 9. Let t be an enabled transition in a marking µ, the firing of tchanges the marking µ to anothor marking µ′ as follows:

∀p ∈ P : µ′(p) = µ(p)− E(p, t) < b > +E(t, p) < b > .

Definition 10. Given a marked CCPN (N,µ), we denote by a step the set ofenabled and concurrent transitions at µ.

Definition 11. Given a marked CCPN (N,µ) and a step s = {t1, .., tn}, thefiring of s at µ reaches the new marking µ′ such that µ′ =

⋃ni=1 µi, µ[ti > µi.

In a CCPN model, places are used to represent the entities of the causalmodel of the system to be diagnosed. As we have mentioned, it suffices to dis-tinguish, for diagnosis purposes, among three classes of entities: Initial causes,noted Ic, represented by source places, Internal states, noted Is, represented byplaces that have input transitions, andManifestations, notedMn, represented bysink places. Transitions represent the cause-effect relations among correspond-ing places. To each transition is attached a matrix given by FW (t) for which itslines represent the different ways that such a transition t can fire while each ofits columns is associated with a place p that surrounds t, and so, it determinesthe possible values that will be consumed/produced from/in p by the firing of t.Each transition matrix FW (t) can be divided into two sub-matrices FW_in(t)and FW_out(t). FW_in corresponds to the possible combining token colour

128 PNSE’17 – Petri Nets and Software Engineering

Page 7: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

inputs of t while FW_out is the output sub-matrix of t. Furthermore, each tran-sition t can be classified as joint or fork transition, it is noticed that the lineartransition is a particular fork or joint transition. A joint transition is used, asusual, to represent a conjunction of places, but also, it is used, in a CCPN, todeal with both cases where there are several concurrent possibilities for reach-ing a place or where there is an exclusive-or between, at least, two executionpaths for reaching that place. As the marking of a place and the evaluationof an arc expression is a multiset, we inspire the idea of exploiting the emptysets as components of a joint transition matrix to describe the mentioned casesabove for better and more logical representation of the system behaviour. In thecase where there are several concurrent evolutions starting from a place by thesame value, a fork transition will be used to duplicate the required place by thespecified marking for each path. For each transition t, the input arc expressionsare typed variables while the output arc expression is a function that holds asinputs a binding vector and the transition matrix and returns the output tokencolour that corresponds to such a binding. The net model is safe, that is, anyplace must be marked by, at most, one token colour.

Definition 12. Let (N,µ) be a marked CCPN, the marking µ may lead to aninconsistency iff: ∃ti, tj ∈ T, ∃µi, µj ∈ R(N,µ) :

µ[ti > µi ∧ µ[tj > µj ∧ ∃p ∈ P |µi(p) 6= µj(p).

Example 1. As an example of a CCPN model, we consider a simple modeladapted from an example given in [1] which is used to represent a partial faultmodel of a car engine. However, it is representative enough for introducing thebasic constructs of CCPNs. Fig.1 gives the graphical representation of the con-sidered model. Such a model is characterized by c1, c2 and c3 as initial-causes ofthe described causal model, and m1 and m2 as manifestations. The left placesrepresent the internal states. Each place has a type, attached to it, which de-termines the set of colours that the token on the place is allowed to have. As asample, the tokens residing in c1 will have an a or b as their token colour.

The transitions are used to model the cause-effect relationships among thecorresponding entities in the causal model. Each transition is labelled by a matrixthat defines its firing ways. t1 is a fork transition that is used to duplicate theinput place c1 by the marking a into c11 and c12 by the same token color. InFW (t1), the first column corresponds to the input place c1, while, the last twoones correspond to the output places c11 and c12. t2 will be enabled only if oneof the input places is marked by the colour a, and as a result, it produces ana or b colour in s1. The transition t3 is as the logical and while t5 and t8 areas the logical or. The transition t8 can be enabled in three cases (according tothe number of lines in its matrix), the two first ones represent the case wheneither s3 or s4 is marked by a color a while the last is that when both places aremarked by such a color. The transition t5 has the same interpretation as t8, butonly, with t8 the produced color is the same for all the cases (firing ways), andso, it is used to guard the safeness of the model (each place is marked at most byone color at a given time), while with t5 the produced color is defined according

Mancer et.al.: Coloured Petri Nets Based Diagnosis on Causal Models 129

Page 8: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

𝑚2

𝑠3 𝑠4

𝑚1

𝑠1

𝑠2

𝑐11

𝑐12 𝑐22

𝑐33

𝑐1

𝑡1

𝑡8

𝑡7 𝑡6

𝑡5 𝑡4

𝑡3

𝑡2

𝑎 𝑎 𝑎

𝑎 𝑎 𝑎 𝑏

𝑎 𝑎 𝑎𝑎 𝑏 𝑏

𝑎 𝑐

𝑏 𝑎 𝑎 𝑎

𝑏 𝑓

𝑏 𝑑𝑏 𝑏 𝑒

𝑎 𝑎 𝑎 𝑎𝑎 𝑎 𝑎

𝑎, 𝑏

𝑎, 𝑏, 𝑒 𝑎, 𝑏

𝑎, 𝑏 𝑎, 𝑏

𝑎, 𝑏, 𝑐

𝑎, 𝑏, 𝑐

𝑎, 𝑏, 𝑑 𝑎, 𝑒

𝑎, 𝑐, 𝑑, 𝑒, 𝑓 𝑎, 𝑏

Fig. 1. A CCPN example.

to the presence of colors in s2 and s4, and here, t5 guards the consistency of thenet model.

4 Formalising diagnosis with CCPNs

CCPNs, as particular CPNs for representing the causal behaviour of a system,are introduced mainly to deal with fault diagnosis. In this section, we show howthe diagnosis problem that is given in Definition 2.2 can be formalised in thebasis of a CCPN model. A diagnosis problem is pointed out when it appears adiscrepancy between the required behaviour of the examined system and its realone. In causal model-based diagnosis, the observed behaviour is given as a setof manifestations, noted OBS. In CCPNs, it consists of a final marking µOBSwhere the marked places are those belonging to Mn. Formally, it is given by:

Definition 13. Given a CCPN as a model of the system S, an observation is amarking µOBS such that:

∀p ∈ P : µOBS(p) 6= ∅ → p ∈Mn.

Definition 14. A diagnosis problem is defined in terms of a CCPN model bythe triple: DP = (N, INIT,< M+,M− >) where:

– N is the CCPN model.– INIT = {(p, c)|p ∈ Ic, c ∈ C(p)}.

130 PNSE’17 – Petri Nets and Software Engineering

Page 9: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

– M+ = {(p, c)|p ∈Mn, c ∈ C(p), µOBS(p) = c}.– M− = {(p, c)|p ∈Mn, c ∈ C(p), µOBS(p) 6= c}.

In this definition, N represents the causal behavioural model of the systemto be diagnosed. INIT is a set of couples (p, c) in terms of which diagnosis so-lutions would be given. It consists of a set of possible markings c of each placep that represents an initial cause in the causal model. < M+,M− > representsthe made observation. M+ consists of a set of couples (p, c) representing mani-festations that have to be entailed by a solution to DP , while M− is the set ofcouples (p′, c′) that conflict with the made observation (i.e, it is used to ensurethe required consistency).

Definition 15. Let N be a CCPN, p ∈ P , c ∈ C(p) and µ0 an initial marking;

(N,µ0) ` (p, c)↔ ∃µ ∈ R(N,µ0)|µ(p) = c.

While,(N,µ0) 0 (p, c)↔ ∀µ ∈ R(N,µ0)|µ(p) 6= c.

Definition 16. Let N be a CCPN, p ∈ P , c ∈ C(p) and µ0 an initial marking;A generalization of Definition 15 for a set Q = {(p, c)|p ∈ P, c ∈ C(p)} is givenby:

(N,µ0) ` Q↔ ∃µ ∈ R(N,µ0)|∀(p, c) ∈ Q : µ(p) = c.

While,(N,µ0) 0 Q↔ ∀µ ∈ R(N,µ0)|∀(p, c) ∈ Q : µ(p) 6= c.

The notion of diagnosis solution can be now captured by the following propo-sition.

Proposition 1. Given a diagnosis problem DP = (N, INIT,< M+,M− >),an initial marking µ0 is a solution to DP iff:

(N,µ0) `M+ and (N,µ0) 0M−.

This means that µ0 has to account for all observations in M+, while, no one inM− must be reached from µ0.

Proof. We proceed to prove this proposition by contradiction.

(→)Suppose that µ0 is a solution to DP and that [(N,µ0) `M+∧(N,µ0) 0M−]does not hold.By Definition 16: (∀µ ∈ R(N,µ0)∃(p, c) ∈ M+ : µ(p) 6= c) ∨ (∃µ ∈R(N,µ0)∃(p, c) ∈M− : µ(p) = c).And so, µ0 is not a solution, which contradicts with our first assumption.

(←)Suppose that [(N,µ0) `M+ ∧ (N,µ0) 0M−] and that µ0 is not a solution.By Definition 16: (∃µ ∈ R(N,µ0)|∀(p, c) ∈ M+ : µ(p) = c) ∧ (∀µ ∈R(N,µ0)|∀(p, c) ∈M− : µ(p) 6= c).As a result, µ0 is a solution, which is a contradiction.

ut

Mancer et.al.: Coloured Petri Nets Based Diagnosis on Causal Models 131

Page 10: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

5 diagnosis problem solving with CCPNs

In order to solve a diagnosis problem given by means of a CCPN, we are inter-ested in the backward reachability analysis. In this section, a formalisation ofthe method is given for analysing a CCPN model, and so, generating a set ofpossible diagnoses that explain a given malfunction.

Generally, a backward analysis on reachability graphs allows determining themarkings from which a given marking is reachable. It can be done by a simpledirection inversion of the arcs in classical PNs, while, the transition’s firing ruleremains the same as forwarding one. When dealing with CPNs, the inversionhas to be applied on arc expressions and transition guards that are, generally,functions. For linear transitions, the inversion process is trivial. For the case of afork or joint transitions, the inversion process becomes complicated. Thus, it ispossible to fall in a combinatorial explosion problems. In a CCPNs, in additionto direction inversion of the arcs, the inversion process can be achieved simplyby a re-ordering of the transition matrices FW . In such a way, the input sub-matrix FW_in becomes output, denoted b_FW_out. While, the output sub-matrix FW_out becomes input, denoted b_FW_in. As a result, FW becomesb_FW . And so, arc expressions have to be changed. As usual, each input arcexpression of a transition t is a typed variable; while, each output one equalsto the following expression f([vq1 ..vqm ], b_FW (t))(p) such that, p is added tospecify which place is (i.e, f([vq1 ..vqm ], b_FW (t)) is a vector, for which, each ofits components corresponds, backwardly, to an output place).

Definition 17. Let M be a marking, a transition t is backwardly enabled in Miff:

∀p ∈ t• : E(t, p) < b > 6M(p) and @t′ � t.

Such that t′is backwardly enabled and the binding b is defined over b_FW (t).

Assuming that a transition t is backwardly enabled, the backfiring of t makesthe execution process of the model returning back, where it removes token colors{ci}1≤i≤n from the output places of t and adds a set of others {c′j}1≤j≤m each ofwhich to its own place that belongs to the input ones of t. This set of colours canbe easily defined by the backward transition matrix of t. By the same manneras forwarding one, the new marking µ′ can be calculated from µ after firing thetransition t. Furthermore, µ may lead to an inconsistent marking (Definition 12).A marking µ is an inconsistent one for the case when there is a fork transition tin which its output places have different markings other than the empty set.

Definition 18. Let (N,µ) be a marked CCPN, µ is said to be inconsistent iff:

∃t ∈ T, ∃p, p′ ∈ t• : µ(p) 6= µ(p′).

Definition 19. Given a marked CCPN (N,µ), let t be a fork transition suchthat •t = {p} and t• = {p1, ..., pm}, t is forced backwardly at the marking µ iff:

• t is not backwardly enabled at µ.

132 PNSE’17 – Petri Nets and Software Engineering

Page 11: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

• ∃pi(1 ≤ i ≤ m)|µ(pi) 6= ∅.• µ is not inconsistent.• @t′ � t where t′ is backwardly enabled or forced at µ.

If t is forced at µ then ∀p, p′ ∈ t• such that µ(p) = ∅ and µ(p′) 6= ∅, considerµ(p) = µ(p′).

Solving a diagnosis problem given by DP consists of constructing backwardlya reachability graph. We start such a construction from a submarking µ of µOBSsuch that ∀(p, c) ∈ M+ : µ(p) = c, while the others are empty. The terminalnodes of the graph can be initial markings ranged in a set µini, inconsistentmarkings or markings leading to an inconsistency. The arcs of the graph arelabelled by steps (It should be noted that, in this case, a step is a set of back-wardly enabled transitions at the given marking). The set of initial markingsµini is a set of markings µi in such a manner that µ is a submarking of µ′ whereµ′ ∈ R(N,µi). The set µini represents the candidate solutions to the given prob-lem, thus, a consistent solution is a candidate marking that does not, by anyway, lead to any combination in M−. To ensure that, we build for each markingof µini the corresponding forward reachability graph. We select as consistentsolutions the markings that reach no element of M−.

Example 2. In order to show how diagnoses are computed, we consider theexample depicted in Fig. 1 with an observation given by the marking µOBS ,where µOBS(m1) = c and µOBS(m2) = a (For simplicity, we use the notationof sets in which the elements are couples of places with its markings, and so:µOBS = {(m1, c), (m2, a)}). A classification of those observed manifestations canbe that in which M+ = µOBS . According to the classification of the observedmanifestations, the diagnosis problem definition will be given as it has been dis-cussed in [3], where the authors suggest that for the same observation, we mayhave a spectrum of definitions varying from a pure consistency-based to a pureabductive diagnosis. Fig. 2 shows the backward reachability graph correspondingto the case that we have where µ = µOBS . Arcs of the graph are labelled by steps(the set of fired transitions in backward fashion). The framed transitions rep-resent forced ones. Notice that t1 is forced when the place c12 becomes markedwith a color a (that is present in b_FW (t1)). Moreover, there is a path in thebackward reachability graph whose terminal node is an inconsistent markingwhere the place s1 has two different markings.

The obtained solutions are µ1 = {(c1, a), (c2, a)} and µ2 = {(c1, a), (c2, a),(c3, a)}. It should be noticed that µ1 ⊂ µ2, thus, µini = {µ1} (a solution to adiagnosis problem have to be minimal). For our case, µ1 is a consistent solution.

6 Related work

During the last decade, several model-based approaches and frameworks havebeen proposed, as improved ones, to solve fault diagnosis problem. The major-ity of them perform such a reasoning on the basis of PNs and their different

Mancer et.al.: Coloured Petri Nets Based Diagnosis on Causal Models 133

Page 12: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

{(𝑚1, 𝑐), (𝑚2, 𝑎)}

{(𝑠2, 𝑎), (𝑠3, 𝑎)}

{(𝑠2, 𝑎), (𝑠4, 𝑎)} {(𝑠2, 𝑎), 𝑠3, 𝑎 , (𝑠4, 𝑎)}

{(𝑐12, 𝑎), 𝑐2, 𝑎 , (𝑠1, 𝑎), (𝑠1, b)}

{(𝑐12, 𝑎), 𝑐2, 𝑎 , (𝑠1, b)}

{(𝑐1, 𝑎), (𝑐2, 𝑎)}

{(𝑐12, 𝑎), 𝑐2, 𝑎 , (𝑐11, 𝑎)}

{(𝑐12, 𝑎), 𝑐2, 𝑎 , (𝑠1, 𝑎)}

{(𝑐12, 𝑎), 𝑐2, 𝑎 , (𝑐3, 𝑎)}

{(𝑐1, 𝑎), 𝑐2, 𝑎 , (𝑐3, 𝑎)}

𝑡4, 𝑡8 𝑡4, 𝑡8 𝑡4, 𝑡8

𝑡3, 𝑡6

𝑡3, 𝑡7

𝑡2

𝑡2

𝑡1

𝑡1

Inconsistent

𝑡3, 𝑡6, 𝑡7

Fig. 2. A backward reachability graph.

extensions as suitable formalisms because of their mathematical and graphicalrepresentation. Among the recent works, we recall those proposed in the contextof discrete event systems. The approach proposed in [6] exploits basis markingsfor an on-line diagnosis using labelled PNs. The main advantage of such an ap-proach is that the reachability space is more compact. In the field of CPNs, [7]presents a CPN version of the diagnoser introduced in [8]. It should be knownthat such a diagnoser is constructed on the basis of a labelled PN model ofthe diagnosed system. The approach is, then, extended to implement a modulardiagnoser for distributed and large systems. [9] deals with the problem of diag-nosis in workflow processes, where, the author defines a CPN fault model, inwhich the faults can be of two sources: faulty input places or faulty transitionmodes. Places represent the system variables that can be of a correct, faulty orunknown status. The diagnosis problem reasoning is accomplished backwardlyby solving its corresponding symbolic inequations system. The authors of [5]develop a backward reachability analysis method for CPNs. Such a method per-forms a structural inversion 3 of the CPN model, and so, analysing the CPNmodel backwardly becomes a forward analysis of its inverted one.

3 Such an inversion preserves the original model proprieties.

134 PNSE’17 – Petri Nets and Software Engineering

Page 13: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

Our proposal differs from these by focusing on a particular side, when mod-elling a system, that is the causal behaviour. In this scope, we are interested inthe approach presented in [2] for centralised diagnosis performed on the basis ofBPNs, and its corresponding distributed one defined in [10]. CCPNs are definedas a particular and simplified class of CPNs for describing the causal behaviour,as well as, simplifying the analysis methods.

7 Conclusion

In this paper, we have presented a new approach based on CCPNs as a particularclass of CPNs for representing and diagnosing systems given by means of causalmodels. In such a net model, we introduced for each of its transitions a matrixdescribing the functional dependencies among its corresponding places as a wayof avoiding the hard problems resulting from the inversion of the arc expressionswhen analysing the net model backwardly. In order to solve a diagnosis problemgiven by means of CCPNs, and so, generating the possible diagnoses of a givenmalfunction, a backward analysis on the reachability graph corresponding to thenet model is defined for the case when using matrices. Many issues remain tobe investigated. Among those we mention: the use of structural analysis as analternative of reachability graphs that are characterized by the combinatorialexplosion during the consistency checking of the generated initial markings; andextending the approach for the distributed systems where there is a set of sub-systems each of which is given by a CCPN having its local observation and solocal diagnoses, the main question is that how can interactions be managed toachieve global consistency between the different local diagnoses.

References

1. L. Portinale, “Verification of causal models using petri nets,” International Journalof Intelligent Systems, vol. 7, no. 8, pp. 715–742, 1992.

2. ——, “Behavioral petri nets: a model for diagnostic knowledge representation andreasoning,” IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cy-bernetics), vol. 27, no. 2, pp. 184–195, 1997.

3. L. Console and P. Torasso, “A spectrum of logical definitions of model-based diag-nosis,” Computational intelligence, vol. 7, no. 3, pp. 133–141, 1991.

4. K. Jensen, “Coloured petri nets and the invariant-method,” Theoretical computerscience, vol. 14, no. 3, pp. 317–336, 1981.

5. M. Bouali, P. Barger, and W. Schon, “Colored petri net inversion for backwardreachability analysis,” IFAC Proceedings Volumes, vol. 42, no. 5, pp. 227–232, 2009.

6. M. P. Cabasino, A. Giua, M. Pocci, and C. Seatzu, “Discrete event diagnosis usinglabeled petri nets. an application to manufacturing systems,” Control EngineeringPractice, vol. 19, no. 9, pp. 989–1001, 2011.

7. Y. Pencolé, R. Pichard, and P. Fernbach, “Modular fault diagnosis in discrete-eventsystems with a cpn diagnoser,” IFAC-PapersOnLine, vol. 48, no. 21, pp. 470–475,2015.

Mancer et.al.: Coloured Petri Nets Based Diagnosis on Causal Models 135

Page 14: Coloured Petri Nets Based Diagnosis on Causal Modelsceur-ws.org/Vol-1846/paper8.pdf · 2017. 6. 30. · model by which it is possible to restrict CPNs for representing causal models

8. M. Sampath, R. Sengupta, S. Lafortune, K. Sinnamohideen, and D. Teneketzis,“Diagnosability of discrete-event systems,” IEEE Transactions on automatic con-trol, vol. 40, no. 9, pp. 1555–1575, 1995.

9. Y. Li, “Diagnosis of large software systems based on colored petri nets,” Ph.D.dissertation, Université Paris Sud-Paris XI, 2010.

10. H. Bennoui, “Interacting behavioral petri nets analysis for distributed causal model-based diagnosis,” Autonomous agents and multi-agent systems, vol. 28, no. 2, pp.155–181, 2014.

136 PNSE’17 – Petri Nets and Software Engineering