A relative identification method for reactive systems

A relative identification method for reactive systems

May 30 - June 1, 2018.on Sorrento 14th IFAC Workshop Discrete Event Systems 14th IFAC Workshop DiscreteCoast, EventItaly Systems May 30 - June 1, 2018...

1MB Sizes 13 Downloads 91 Views

May 30 - June 1, 2018.on Sorrento 14th IFAC Workshop Discrete Event Systems 14th IFAC Workshop DiscreteCoast, EventItaly Systems May 30 - June 1, 2018.on Sorrento Coast, Italy May 30 June 1, 2018. Sorrento Coast, Italy 14th IFAC Workshop on Discrete Event Systems May 30 - June 1, 2018. Sorrento Coast, Italy

Available online at www.sciencedirect.com

May 30 - June 1, 2018. Sorrento Coast, Italy

ScienceDirect IFAC PapersOnLineidentification 51-7 (2018) 152–159 A relative method A A relative relative identification identification method method for reactive systems A relative identification method for reactive systems for reactive systems ∗ ∗ ∗∗ for reactive systems Clement Galetta ∗ Jean-Marc Roussel ∗ Jean-Marc Faure ∗∗

Clement Galetta ∗∗ Jean-Marc Roussel ∗∗ Jean-Marc Faure ∗∗ Clement Clement Galetta Galetta Jean-Marc Jean-Marc Roussel Roussel Jean-Marc Jean-Marc Faure Faure ∗∗ ∗ ∗ ∗ Clement Galetta Jean-Marc Roussel Jean-Marc Faure ∗∗ ∗ Automated Production Research Laboratory (LURPA), ENS Cachan, Automated Production Research Laboratory (LURPA), ENS Cachan, ∗ ∗ Automated Production Research Laboratory (LURPA), ENS Cachan, Univ. Paris-Sud, Universit´ ee Paris-Saclay, Cachan, Automated Production Research Laboratory 94235 (LURPA), ENSFrance Cachan, Paris-Sud, Universit´ Paris-Saclay, 94235 Cachan, France ∗ Univ. Univ. Universit´ ee Paris-Saclay, 94235 Cachan, France (e-mail: [email protected]). Automated Production Research Laboratory (LURPA), ENS Cachan, Univ. Paris-Sud, Paris-Sud, Universit´ Paris-Saclay, 94235 Cachan, France (e-mail: [email protected]). ∗∗ (e-mail: [email protected]). Production Research Laboratory (LURPA), ENS Cachan, Univ. Paris-Sud, Universit´ e Paris-Saclay, 94235 Cachan, France ∗∗ Automated (e-mail: [email protected]). Automated Production Research Laboratory (LURPA), ENS Cachan, ∗∗ ∗∗Univ. Automated Production Research Laboratory (LURPA), ENS Cachan, Paris-Sud, Supmeca, Universit´ e Paris-Saclay, 94235 Cachan, (e-mail: [email protected]). Automated Production Research Laboratory (LURPA), ENS Cachan, Paris-Sud, Supmeca, Universit´ e Paris-Saclay, 94235 Cachan, ∗∗Univ. Univ. Paris-Sud, Supmeca, Universit´ e Paris-Saclay, 94235 Cachan, France (e-mail: [email protected]). Automated Production Research Laboratory (LURPA), ENS Cachan, Univ. Paris-Sud, Supmeca, Universit´e Paris-Saclay, 94235 Cachan, France (e-mail: [email protected]). France [email protected]). Univ. Paris-Sud, Supmeca, Universit´e Paris-Saclay, 94235 Cachan, France (e-mail: (e-mail: [email protected]). France (e-mail: [email protected]). Abstract: This paper proposes a to build an identified model from an observed sequence Abstract: This paper proposes aa method method to build model an sequence Abstract: This paper paper proposes method toknowledge build an an identified identified model from from an observed observed sequence of input/output vectors and a model of on the system to identify. This method Abstract: This proposes a method to build an identified model from an observed sequence of input/output vectors and a model of knowledge on the system to identify. This method of input/output vectors and a model of knowledge on the system to identify. This method comprises two steps. The first one starts by checking whether the knowledge model is compatible Abstract: This paper proposes a method to build an identified model from an observed sequence of input/output vectors and a model of knowledge on the system to identify. This method comprises two steps. The first one starts by checking whether the knowledge model is compatible comprises two steps. The first one starts by checking whether the knowledge model is compatible with the observed sequence; when this is the case, the identified model is built automatically. of input/output vectors and a model of knowledge on the system to identify. This method comprises two steps. The first one starts by checking whether the knowledge model is compatible with the observed sequence; when this is the case, the identified model is built automatically. with the observed sequence; when this is the case, the identified model is built automatically. From this result, the observed and unobserved behaviors of the knowledge model are then comprises two steps. The first one starts by checking whether the knowledge model is compatible with the observed sequence; when this is the case,behaviors the identified model is builtmodel automatically. From this result, observed and unobserved of knowledge are Fromthe thisobserved result, the the observed and unobserved behaviors of the themodel knowledge model are then then explicitly determined, in a second step. with sequence; when this is the case, the identified is built automatically. From this result, the observed and unobserved behaviors of the knowledge model are then explicitly determined, in aa second step. explicitly step. From thisdetermined, result, the in observed unobserved behaviors of the knowledge model are then explicitly determined, in a second secondand step. © 2018, IFAC (International of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. explicitly determined, in aFederation secondSignal step. Keywords: System identification, Interpreted Petri Nets, Boolean functions, Keywords: System identification, Signal Interpreted Petri Nets, Boolean functions, Keywords: System identification, Signal Interpreted Petri Nets, Boolean functions, Reachability graph, Programmable Logic Controller Keywords: System identification, Signal Interpreted Petri Nets, Boolean functions, Reachability graph, Programmable Logic Controller Reachability graph, Programmable Logic Controller Keywords: System Signal Reachability graph,identification, Programmable LogicInterpreted Controller Petri Nets, Boolean functions, Reachability graph, Programmable Logic Controller 1. INTRODUCTION and explains why some researchers have considered 1. INTRODUCTION and explains explains why why some some researchers researchers have have considered considered aa a 1. and relative identification approach. When the identified model 1. INTRODUCTION INTRODUCTION and explains why some researchers have considered a relative identification approach. When the identified model relative identification approach. When the identified model 1. INTRODUCTION is represented by a PN, Giua and Seatzu (2005), for and explains why some researchers have considered a relative identification approach. When the identified model The overall objective of identification methods is to build is represented represented by by aa PN, PN, Giua Giua and and Seatzu Seatzu (2005), (2005), for for The overall overall objective objective of of identification identification methods methods is is to to build build is instance, proposes an algorithm for identication of freerelative identification approach. When the identified model is represented by a PN, Giua and Seatzu (2005), for The a behavioral model of a system from results of experiments instance, proposes proposes an an algorithm algorithm for for identication identication of of freefreeThe overall objective identification methods is to build instance, behavioral model of of aaofsystem system from results results of experiments experiments PN that that the places is is represented byassumes aanPN, Giua and Seatzu of (2005), for instance, proposes algorithm for number identication of freeaa behavioral model from of on the real system. work considers reactive systems The overall objective identification methods is to build labeled labeled PN that assumes that the number of places is a behavioral model ofThis aofsystem from results of experiments on the real system. This work considers reactive systems labeled PN that assumes that the number of places is known and the observed language is complete. This latter instance, proposes an algorithm for identication of freelabeled PN that assumes that the number of places is on the real system. This work considers reactive systems where a Programmable Logic Controller (PLC) controls a behavioral model of a system from results of experiments known and the observed language is complete. This latter on the real system. This work considers reactive systems where aa Programmable Programmable Logic Logic Controller Controller (PLC) (PLC) controls controls known and the observed language is complete. This latter assumption is not made in Dotoli et al. (2011), where labeled PN that assumes that the number of places is known and the observed language is complete. This latter where awhere this class of system can be modeled as closedonplant; the areal system. work considers reactive systems assumption is is not not made made in in Dotoli Dotoli et et al. al. (2011), (2011), where where Programmable Logic Controller (PLC) plant; this class of ofThis system can be modeled modeled as aa acontrols closed- assumption unobservable transitions are added to a labeled PN whose known and the observed language is complete. This latter assumption is not made in Dotoli et al. (2011), where aa plant; this class system can be as closedloop Discrete Event System (DES) where the inputs and where a Programmable Logic Controller (PLC) controls unobservable transitions transitions are are added added to to aa labeled labeled PN PN whose whose a plant; this class of System system (DES) can be where modeled a closedloop Discrete Event theasinputs inputs and unobservable observable is known. Nevertheless, the knowledge assumptionbehavior istransitions not made in added Dotoli al. (2011), where unobservable are toeta labeled PN whose loop Discrete Event (DES) where the and outputs of the controller are logic variables. a plant; this class of System system can be modeled a closedobservable behavior is known. Nevertheless, the knowledge loop Discrete Event System (DES) where theasinputs and observable outputs of the controller are logic variables. behavior is known. Nevertheless, the knowledge models that are proposed in these valuable works unobservable transitions are added to a labeled PN whose observable behavior is known. Nevertheless, the knowledge outputs of the controller are logic variables. loop Discrete System where the inputs and models that are proposed in these valuable works are are outputs ofresults theEvent controller are (DES) logicofvariables. The first in the domain identification of DES models that are proposed in these valuable works are not completely for the class of reactive systems observable behavior is known. Nevertheless, the knowledge models that aresuitable proposed in these valuable works are The first results in the domain of identification of DES outputs of the controller are logic variables. not completely suitable for the class of reactive systems The results in domain identification of (Gold (1967), were mainly related to not suitable for the class of reactive systems that we focus on because and outputs of the models that are proposed in these works are The first first resultsAngluin in the the (1987)) domain of of identification of DES DES not completely completely suitable forthe theinputs class valuable of reactive systems (Gold (1967), Angluin (1987)) were mainly related to that we focus on because the inputs and outputs of the (Gold (1967), Angluin (1987)) were mainly related to language identication. More recently, construction by identhat we focus on because the inputs and outputs of the The first results in the domain of identification of DES controller are not explicitly considered. not completely suitable for the class of reactive systems (Gold (1967), Angluin (1987)) were mainly related to that we focus on because the inputs and outputs of the language identication. identication. More More recently, recently, construction construction by by ideniden- controller are not explicitly considered. language tification of models in the form of automata or Petri are not considered. (Gold (1967), Angluin (1987)) were mainly related to controller that we focus on explicitly because the inputs and outputs of the language identication. More recently, construction by idencontroller are not explicitly tification of models in the form of automata or Petri Hence, this paper proposes aaconsidered. relative identification method tification of models in the form of automata or Petri nets (PN) has been addressed by several authors. Roth language identication. More recently, construction by idenHence, this paper proposes relative identification method method controller are not explicitly tification ofhas models in the form of automata or Roth Petri Hence, this paper proposes aconsidered. nets (PN) been addressed by several authors. relative identification (Fig. 1) which starts from both a knowledge model generHence, this paper proposes a relative identification method nets (PN) has been addressed by several authors. Roth et al. (2010) and Schneider et al. (2012), for instance, tification of models in the form of automata or Petri (Fig. 1) which starts from both a knowledge model genernets (PN) has been addressed by several authors. Roth et al. al. (2010) (2010) and and Schneider Schneider et et al. al. (2012), (2012), for for instance, instance, (Fig. 1) which starts from both a knowledge model generated by an expert and observed input/output sequences. Hence, this paper proposes a relative identification method (Fig. 1) which starts from both a knowledge model generet propose methods to build automata that are used later nets (PN) has been addressed by several authors. Roth ated by an expert and observed input/output sequences. et al. (2010) and Schneider et al. (2012), for instance, propose methods methods to to build build automata automata that that are are used used later later ated by an and observed sequences. The model is represented in the form of Signal (Fig. 1) which starts from both a input/output knowledge model ated knowledge by an expert expert and input/output sequences. propose on for diagnosis Meda-Campa˜ a and L´ oolater pezet al. (2010) and purposes. Schneider et al. (2012), for instance, The knowledge model is observed represented in the the form form of aa a generSignal propose methods to build automata thatn are used on for diagnosis purposes. Meda-Campa˜ n a and L´ pezThe knowledge model is represented in of Signal Interpreted Petri Net (SIPN), an appropriate formalism ated by an expert and observed input/output sequences. The knowledge model is(SIPN), represented in the form of a Signal on purposes. Meda-Campa˜ aaDotoli and oolater pezMellado (2005), Giua and Seatzu (2005), et al. propose methods to build automata thatn usedL´ Interpreted Petri Net an appropriate formalism on for for diagnosis diagnosis purposes. Meda-Campa˜ nare and L´ pezMellado (2005), Giua and Seatzu (2005), Dotoli et al. Interpreted Petri Net an formalism for class of reactive systems that considered in The the knowledge represented in theis of a Signal Interpreted Net is(SIPN), (SIPN), an appropriate appropriate formalism Mellado (2005), and Seatzu (2005), et al. (2011), Estrada-Vargas et al. (2015), Saives et al. (2015), on for diagnosis purposes. Meda-Campa˜ naDotoli L´ opezfor the classPetri ofmodel reactive systems that isform considered in Mellado (2005), Giua Giua and Dotoli et al. for (2011), Estrada-Vargas et al. al.Seatzu (2015),(2005), Saives etand al. (2015), (2015), the class of reactive systems that is considered in this work, and the I/O sequences have been obtained Interpreted Petri Net (SIPN), an appropriate formalism for the class of reactive systems that is considered in (2011), Estrada-Vargas et (2015), Saives et al. to name a few, focus on identification based on Petri nets. Mellado (2005), Giua and Seatzu (2005), Dotoli et al. this work, and the I/O sequences have been obtained (2011), Estrada-Vargas et al. (2015), Saives et al. (2015), to name name aa few, few, focus focus on on identification identification based based on on Petri Petri nets. nets. this work, and the I/O sequences have been obtained experimentally previously. From these data, the method for the class of reactive systems that is considered in this work, and the I/O sequences have been obtained to The latter two references place their works in the context (2011), Estrada-Vargas et al. (2015), Saives et al. (2015), experimentally previously. previously. From From these these data, data, the the method method to name a few, focus on identification based in onthe Petri nets. experimentally The latter two references place their works context determines first whether the knowledge model is compatithis work, and the I/O sequences have been obtained experimentally these data, method The latter two references place their in the context of reverse construction of model that is to name a engineering, few, oni.e. identification based on Petri nets. determines first previously. whether the theFrom knowledge modelthe is compaticompatiThe latter two focus references place their works works the context of reverse engineering, i.e. construction of aa a in model that is determines first whether knowledge model is ble with the observations, i.e., for every experimentally previously. From these observed data, method determines first whether the knowledge modelthe is sequence, compatiof reverse engineering, i.e. construction of model that is understandable by experts to revamp an existing machine; The latter two references place their works in the context ble with the observations, i.e., for every observed sequence, of reverse engineering, i.e. construction of a model that is understandable by by experts experts to to revamp revamp an an existing existing machine; machine; ble with the observations, i.e., for every observed sequence, there exists in the model a firing sequence which determines first whether the knowledge model is compatible with the observations, i.e., for every observed sequence, understandable this is also the applicative of this work. A good surof reverse i.e.context construction a model that is there exists in the model a firing sequence which can can understandable by experts to revamp anof existing machine; this is also also engineering, the applicative applicative context of this this work. A good good surthere exists in model aa for firing sequence which can generate the same vectors from the input vectors. ble with the observations, i.e., every observed sequence, there exists in the theoutput model firing sequence which can this is the context of work. A survey on DES identication can be found in Estrada-Vargas understandable by experts to revamp an existing machine; generate the same output vectors from the input vectors. this is also the applicative context of this work. A good survey on on DES DES identication identication can can be be found found in Estrada-Vargas Estrada-Vargas generate the same output vectors from the input vectors. When this is the model is provided there exists inthe thecase, model aidentified firing sequence which can generate the same output vectors from the input vectors. vey et al. (2010). This survey underlines in particular that this is also the applicative context of this work. A good surWhen this is the case, the identified model is provided veyal. on(2010). DES identication canunderlines be found in Estrada-Vargas et This survey particular that When this is the case, the identified model is provided in the form of an augmented reachability graph, a model generate the same output vectors from the input vectors. When this is the case, the identified model is provided et This survey in particular that an identification method may be absolute (or black-box), veyal. on(2010). DES identication canunderlines be in the the form form of of an an augmented augmented reachability reachability graph, graph, aa model model et al. (2010). This survey underlines in Estrada-Vargas particular that in an identification method may be found absolute (or black-box), black-box), where and are associated to the When this isof the case, combinations the identified model is provided in the input form anoutput augmented reachability graph, a model an identification method may be absolute (or when no a priori knowledge about the system behavior is et al. (2010). This survey underlines in particular that where input and output combinations are associated to the the an identification method may be absolute (or black-box), when no no aa priori priori knowledge knowledge about about the the system system behavior behavior is is where input and output combinations are associated to transitions and markings firings. Moreover, it is possible in the form of an augmented reachability graph, a model where input and output combinations are associated to the when available before identification, or relative otherwise. an identification method may be absolute (or black-box), transitions and markings firings. Moreover, it is possible when no a priori knowledge about the system behavior is available before before identification, identification, or or relative relative otherwise. otherwise. transitions and firings. Moreover, it is derive this graph the unobserved of where inputfrom and markings output combinations are associated to the transitions and markings firings. Moreover, itpart is possible possible available when no abefore prioriidentification, knowledge about the system behavior is to to derive from this graph the unobserved part of the available or relative otherwise. Absolute identification is surely more attractive because it derive this graph the part of knowledge model; these information can be the starting transitions and markings firings. Moreover, is possible to derive from from this graph the unobserved unobserved part of the the Absolute identification is surely surelyormore more attractive because it it to available before identification, relative otherwise. knowledge model; these information can be be itthe the starting Absolute identification is attractive because is only based on observations of the evolutions of the real knowledge model; these information can starting point for further active identification, an identification to derive from this graph the unobserved part of the Absolute identification is surely more attractive because it knowledge model; these information can be the starting is only only based based on on observations observations of of the the evolutions evolutions of of the the real real point for further active identification, an identification is system. Nevertheless, it be noted that the quality of for further active identification, an identification Absolute identification ismust surely attractive because it point approach where input values are to be forced during the knowledge model; these information can be the starting is only based on observations ofmore the evolutions of the real point for further active identification, an identification system. Nevertheless, it must be noted that the quality of approach where where input input values values are are to to be forced forced during during the system. Nevertheless, it be noted that of the identified model depends observation duration. is only based on observations of the evolutions the real experiments. point for where furtherinput active identification, an identification system. Nevertheless, it must must on be noted that the theofquality quality of approach approach values are to be be forced during the the the identified model depends on the observation duration. experiments. the identified model depends on the observation duration. A good identified model may require a long observation experiments. system. Nevertheless, it must be noted that the quality of approach where input values are to be forced during the the identified model depends on the observation duration. experiments. A good good identified identified model model may may require require aa long long observation observation A time; this may hinder the application of the method the identified model depends the observation duration. experiments. A good identified model mayon require a long observation time; this may hinder the application of the method time; may of method A goodthis identified model the mayapplication require a long observation time; this may hinder hinder the application of the the method time; this mayIFAC hinder the application of the method152 Copyright © 2018 Copyright © 2018 IFAC 152 2405-8963 © IFAC (International Federation of Automatic Control) Copyright © 2018 152 Copyright © 2018, 2018 IFAC IFAC 152Hosting by Elsevier Ltd. All rights reserved. Peer review under responsibility of International Federation of Automatic Copyright © 2018 IFAC 152Control. 10.1016/j.ifacol.2018.06.294

IFAC WODES 2018 Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159 May 30 - June 1, 2018. Sorrento Coast, Italy

Input

Reactive system

Output

PLC

Offline Online

Plant Finite-time I/O sequences observation

153

Knowledge model (KM)

Augmented reachability graph (ARG)

Relative identification

Observed behavior

Observed I/O sequence

Non observed behavior

Compatibility of KM with I/O sequence

Fig. 1. Objective of the work The formalism that was selected in this work to describe the knowledge model is presented in the next section. The proposed relative identification method is detailed and illustrated on the basis of small examples at Section 3. Section 4 is dedicated to an example and concluding remarks as well as perspectives for further work are given in section 5. 2. FORMALISM SIPN have been introduced in Minas and Frey (2002). This formalism is particularly appropriate to describe the evolutions of an interpreted PN according to those of input and output signals. The notations and assumptions that are used in this work are presented below. 2.1 Basics of Petri Nets An ordinary Petri net structure G is a bipartite digraph represented by the 4-tuple G = (P, T, P re, P ost) where: P = {p1 , p2 , ..., p|P | } 1 and T = {t1 , t2 , ..., t|T | } are finite sets of vertices named places and transitions respectively; P re(P ost) : P × T (T × P ) → {0, 1} is a function representing the edges going from places to transitions (from transitions to places). A marking function Mg : P → N represents the number of tokens residing inside each place where N is the set of positive integers; it is usually expressed as a |P |-entry vector. The net is said 1-bounded (or safe) when N is replaced by {0, 1}, i.e there is at most one token residing in every place. The incidence matrix of G is W = Post − Pre, where Pre = [preij ]; preij = P re(pi , tj ); and Post = [postij ]; postij = P ost(pi , tj ) are the pre-incidence and postincidence matrices respectively. A Petri net (PN) with the given initial marking is denoted by is the pair N = (G, M0 ), where G is a PN structure and M0 an initial marking. More details on the basics of Petri nets can be found in (Murata, 1989). In the case of this study where a control model is considered, every PN will be safe. 2.2 SIPN A Boolean algebra is defined on B = {0, 1} with (∧, ∨, ¬) the operators of conjunction, disjunction and negation respectively. 1

The cardinality of a set A is noted |A|

153

A Boolean function F is defined as: F : Bn −→ B X −→ F (X) Bn is the set of the n Boolean variables; if X ∈ Bn , X = (x1 , ..., xk , ..., xn ). Fn is the set of Boolean functions that can ben defined on Bn . The cardinality of this set is equal to 22 . Definition 1. A Signal Interpreted Petri Net system (SIPN) is a 6-uplet KM= (G, M0 , U, Y, λ, µ) with (G, M0 ) a Petri net to which are added: • U the set of Boolean input variables. • Y the set of Boolean output variables. • λ : T −→ F|U| the function of firing conditions tj −→ Ftj where Ftj is a Boolean function depicting sufficient conditions on the values of the inputs to fire tj . • µ : P → P(Y) the function of outputs activation of places where P(Y) is the power set of Y. A subset of outputs to activate (set to 1) when the place is marked is associated to every place. Example 1. An example of SIPN with 3 inputs and 4 outputs such as U = {a, b, c} and Y = {A, B, C, D} is shown in Fig. 2.

P1

t3

P2

P4

P3

a

t2

b c

{A}

t1

*

{C} t8

{B} t6

t7 P8

{D}

t4

B

{A,C}

P5

P7

A

C t5

P6

D

*No activated outputs

Fig. 2. Example of SIPN Two transitions of the net are in structural conflict when they share the same upstream place. As we are considering a control model, effective conflicts must not be possible to avoid non-determinism, however. This implies that the functions associated to transitions in structural conflict must be exclusive. This can be formalized as follows. Definition 2. A structural conflict for a given place pi exists if |D(pi )| > 1

IFAC WODES 2018 May 154 30 - June 1, 2018. Sorrento Coast, Italy Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159

3. PROPOSED METHOD

where D(pi ) is the function which returns the set of downstream transitions of a given place pi : 3.1 Principle

Definition 3. A SIPN is deterministic iff:

∀pi ∈ P such that |D(pi )| > 1, ∀X ∈ B|U| , ∀(tj , tj  ) ∈ D2 (pi ) Ftj (X) ∧ Ftj (X) = 0

(2)

Tf

fired simultaneously: Mg −→ Mg+1 , where Tf is the set of the simultaneously firable transitions.

To illustrate the last point, in Fig. 2, if P5 and P6 are both marked with b = 1, then a = 1 leads to the simultaneous firing of the transitions t7 and t6 . Hence, a firing sequence σ = t1 (t2 , t3 )t4 ...tj that leads from σ M0 to Mg , i.e M0 −→ Mg , may include firings of only one transition (t1 , t4 in σ) as well as simultaneous firings of several transitions (t2 and t3 in σ). Last, the value of an output yl for a marking Mg is :  1 if ∃pi ∈ P |[Mg (pi ) = 1] ∧ [yl ∈ µ(pi )] yl [Mg ] = 0 else For a given marking Mg , the set of the output values is given by the function gamma:

where:

γ : B|P | −→ B|Y| Mg −→ γ(Mg ) γ(Mg ) = (y1 [Mg ], ..., yl [Mg ], ...., y|Y| [Mg ])

(3)

The following two properties can then be stated. Property 1. There exists a unique set of output values γ(Mg ) associated to a given marking Mg . All the output values of the SIPN of Fig. 2 are equal to 0 for the initial marking, for instance. Property 2. Several markings can be associated to a given set of output values. Either P1 or P4 is the only marked place when all the output values are equal to 0, for instance. The current marking cannot be identified unambiguously from the observation of the outputs. 154

1 1

0 0 1 0 1

...

0 0 0 0 0

0 1 1

...

tj

leads to a new marking Mg+1 , written Mg −→ Mg+1 . The new marking is computed as Mg+1 = Mg +W.sg where sg (j) = 1; sg (i) = 0 with i = j. • All transitions that are simultaneously firable are

0 1 0

...

• A transition tj is enabled at marking Mg if and only if all its upstream places are marked, i.e ∀pi ∈ P, Mg (pi ) ≥ P re(pi , tj ). The set of enabled transitions for a given marking Mg is noted Te (Mg ). • A transition tj is fired immediately when its associated function is True: Ftj (X) = 1. The firing of tj

Observed I/O sequence ω ...

The evolution rules of a SIPN are the following ones:

KM

...

The SIPN of the example of Fig. 2 is deterministic: t1 and t2 are in structural conflict but their associated functions are exclusive. Only deterministic SIPN will be considered in what follows.

Relative identification Identified model in the form of an Augmented Reachability Graph (ARG)

Determination of the unobserved behavior

(1)

Identified model construction

D(pi ) = {tj |P re(pi , tj ) = 1}

0 1

ARG

Observed evolutions

Non observed evolutions

Compatibility of KM with I/O sequence

Fig. 3. Overview of the proposed method The relative identification method that is proposed (Fig.3) starts from a knowledge model designed by an expert and modelled by a SIPN, noted KM, and a sequence ω of observed I/O vectors. When several sequences have been observed on-line, the method must be applied to every sequence. Every vector ωk of ω includes an input vector T uˆk and an output vector yˆk such as: ωk = [uˆk , yˆk ] . The length of ω is noted |ω|. The aim is to determine:

(1) whether KM is compatible with ω; (2) the identified model, in the form of an augmented reachability graph; (3) the part of the knowledge model which has not been observed, from the previous result. The first two results are obtained at the end of the first phase; the third one at the end of the second phase of the method. 3.2 Construction of the identified model The model proposed by the expert must be obviously compatible with the observed I/O sequence, i.e. there must exist in this model a firing sequence which can generate the same output vectors sequence from the observed input vectors sequence. Moreover, when this firing sequence exists, the evolutions of the system can be represented by a formal model which is derived from both KM and ω. The final aim of the algorithm which is detailed at Appendix A and sketched at Fig. 4 is to build this model. When this aim cannot be reached, KM is declared inconsistent with the observed I/O sequence. This algorithm comprises three steps: (1) Initial State Detection (ISD): the first output vector yˆ0 of ω does not correspond necessarily to the output values for the initial marking 2 . The aim of this step is therefore to find an observed vector yˆIS that matches with these values; KM and ω are not compatible when yˆIS does not exist. However, according to property 2, a given set of output values does not define necessarily a unique marking. This explains why the following two analyses are to be performed. 2 The reasoning assumes that the initial marking has been observed. If this is not the case, the algorithm can be applied by starting from a different marking.

IFAC WODES 2018 Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159 May 30 - June 1, 2018. Sorrento Coast, Italy

(2) Forward Analysis (FA): its objective is to check that every I/O change, from ωIS to ωn , can be explained from the SIPN: • When only the input vector changes, either no transition which is enabled for the current marking must be firable for the observed values of the inputs, or a transition (or a set of simultaneously firable transitions) which is firable for these values is fired and the output values associated to the source and destination markings are the same. • When both the input and output vectors change, at least one transition must be fired for the observed values of the inputs and the observed values of the outputs must correspond to those of the marking which is reached by firing this (these) transition(s). When the result of this analysis is negative a new yˆIS is searched in ω. (3) Backward Analysis (BA): this analysis is similar to the FA but the exploration of ω is made from ωIS to ω0 . Knowledge Model SIPN (KM) I/O observed sequence ω

Initial State

Detection (ISD) Backward

Looking for the next I/O vector New I/O vector to analyse ?

KM not compatible with observation

Yes

Forward

Analysis (FA)

Returning to the initial state detected Looking for the previous I/O vector

Looking for the next I/O vector

New I/O vector to analyse ?

No

Yes

Yes No

I/O vector and KM evolution compatibility ?

Returning to the initial state detected

No

I/O vector and KM previous evolution compatibility ?

No

Yes

P1

{A}

t1

t3

{t3}

{P1}{A}

{t1}

{t1}

P2

{B} a b − A B −

M0

P3

t2

t4

(a) 0 1 0 0 0  0  1  1  0  1  −−−−−      ω=  0 1 1 0 0 0 0 0 0 1 ω0 ω1 ω2 ω3 ω4

     

M2{P2}{B}

{P3}

{t4}

M1

{t3,t4}

{t2} Caption

(c)

(b)

Fig. 5. Illustration of the example 2: SIPN (a), observed I/O sequence (b), ARG built (c) Example 2. This algorithm is exemplified on the model of Fig. 5a where the SIPN owns 2 inputs U = {a, b} and 2 outputs Y = {A, B}. The obtained ARG is depicted at Fig. 5c. As the PN is safe and the outputs are Boolean variables, Mg and γ(Mg ) are represented in this figure as sets of marked places and True variables, instead of vectors, in the sake of brevity.

FA starts with ω2 = [uˆ2 , yˆ2 ]T whose output vector is identical to that of ω1 . This means that the only enabled transition from M0 (t1 ) cannot be fired for the observed input combination uˆ2 , what is consistent with the knowledge model. The input vector uˆ2 = [0, 1]T is stored in the set Is for the initial marking then ω3 = [uˆ3 , yˆ3 ]T is analyzed. T The observed output vector yˆ3 = [0, 0] means that a new marking M1 has been reached; uˆ3 = [0, 0]T is stored in the set If for the edge from M0 to M1 , as well as in the set Is for M1 . ω4 = [uˆ4 , yˆ4 ]T is at last analyzed. This I/O vector corresponds to a marking change from M1 to M2 ; the appropriate sets If and Is are updated.

Yes New I/O vector to analyse ?

(Mg , γ(Mg ), Te (Mg )) are obtained only from the SIPN, Tf , Is and If are yielded by the exploration of ω.

ISD starts from ω0 = [uˆ0 , yˆ0 ]T . The output vector yˆ0 = [0, 0]T does not match with the output vector associated T to the initial marking γ(M0 ) = [1, 0] . Hence, ω1 is then analyzed. The output vector corresponds in this case to that of the initial marking; the input vector uˆ1 = [1, 1]T is stored in the set Is for the initial marking and ISD stops.

No Yes No

Initial state detected ?

Analysis (BA)

Returning to the initial state detected

155

Identifed model in the form of an Augmented Reachability Graph (ARG)

Fig. 4. Identified model construction An Augmented Reachability Graph (ARG) is constructed during the exploration of the I/O sequence. This kind of graph is similar to the Stable Location Automaton introduced in Provost et al. (2011) and used to represent formally the behavior of a Grafcet model. An ARG is a pair ARG = (RM, E) with RM the set of vertices and E the set of edges. A vertex v is a 4-tuple v = (Mg , γ(Mg ), Te (Mg ), Is ) with Mg a marking of the SIPN, γ(Mg ) the output values for this marking, Te (Mg ) the set of transitions which are enabled for this marking and Is the set of input vectors which have been observed and did not provoke a marking change. An edge e ∈ E with Tf

e = (Mg , Mg , Tf , If ) represents Mg −→ Mg where Tf is the set of simultaneously fired transitions and If the set of input vectors which provoke these firings. It must be underlined that, even if some elements of an ARG

155

As the forward analysis is positive, backward analysis is performed from ω1 . The marking that corresponds to this observation (M0 ) can be reached only by firing from M1 the transition t3 whose associated function is a ∧ b. The observed output vector yˆ0 = [0, 0]T and input vector uˆ1 = [1, 1]T show that KM is compatible with the observations. BA is positive. 3.3 Determination of the unobserved behavior As it is based on observations, the ARG which has been built by the previous algorithm does not include necessarily every marking and marking change; the change from M2 to M1 has not been observed, for instance in the example 2. In a similar way, all the input vectors which provoke/do not provoke a marking change have not been

IFAC WODES 2018 156 Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159 May 30 - June 1, 2018. Sorrento Coast, Italy

necessarily observed. The aim of this section is to show how these missing information can be explicitly expressed. Graph of reachable markings of the SIPN

For every marking

tj ∈T / f

Develop the Boolean functions that provoke/ do not provoke every marking change

In the ARG that is provided by the algorithm, the observed behavior corresponds to the minterms such as the corresponding inputs combination has been observed, the unobserved behavior to the other minterms.

Isolate the minterms that do not correspond to observations

An edge e is completely observed if all minterms in the expression of fe have been observed. A marking is completely observed if all edges starting from this marking, including the self-loop, have been completely observed.

Yes

New marking to analyze ?

However, a self-loop on Mg must be introduced in the ARG for the empty set of transitions ∅, to model that the marking remains the same for this element of E. The following boolean function fe is associated to this selfloop:  ¬Ftj f e =

No

The graph of reachable markings, starting point of the algorithm, must be constructed by considering that: • Several enabled transitions of the SIPN may be simultaneously fired • Functions on the inputs are associated to transitions.

If the set of enabled transitions for a marking Mg is noted Te (Mg ), the set of possible firings from this marking, noted E, is indeed the power set of Te (Mg ): E = P(Te (Mg )). The number of firings in this set is |E| = 2|Te (Mg )| . Example 3. If Te (Mg ) = {t1 , t2 , t3 } then E = {∅, {t1 }, {t2 }, {t3 }, {t1 , t2 }, {t2 , t3 }, {t1 , t3 }, {t1 , t2 , t3 }} and |E| = 8 because n = 3. In the graph of reachable markings, the edges that start from Mg correspond to the elements of E. A Boolean function fe , firing condition of a set of transitions, is associated to each edge e, with: 

tj ∈Tf

Ft j



tj ∈T / f

¬Ftj

t2

P2

The behavior of the knowledge model that has not been observed can be found by the algorithm that is detailed at Appendix B and sketched at Fig. 6. This algorithm relies on the development of Boolean functions in the form of disjunction of minterms. It is first reminded that a minterm is a logical expression of n Boolean variables that uses only the negation and conjunction operators. If b = (b1 , ..., bn ) is an element of Bn , a minterm defined from b is min(b) = u1 ∧ u2 ∧ ... ∧ un , where ui = ui if bi = 1, ui = ¬ui if bi = 0.

fe =

Caption

{P2,P3} {t1}

Fig. 6. Finding the unobserved behavior

∀Tf ∈ E,

t1

P1

ARG with observed and unobserved behaviors

(4)

This Boolean function may be sometimes equal to zero. If Te (Mg ) = {t1 , t2 } with Ft1 = a and Ft2 = a ∧ b, the boolean function fe associated to the firing of only t2 is : fe = Ft2 ∧¬Ft1 = (a∧b)∧¬a = 0. In the reachability graph of the SIPN as well as in the ARG, the corresponding edge is not represented because this element of E is not feasible. 156

{t1,t2} {P1,P2,P3}

t3

P3

M0

{t1,t3}

{t1,t2,t3}

(a)

{P3}

{P2} (b)

{P2,P3} {P3}

M0 {P1,P2,P3}

{P2} (c)

Fig. 7. KM SIPN (a), reachability graph of the SIPN (b), ARG with the observed (minterms circled with dotted line) and unobserved behaviors (minterms not circled) (c) Example 4. The graph of reachable markings of the SIPN of Fig. 7a is given at Fig. 7b. Three transitions are enabled for M0 but only four firings are possible because the functions associated to {t2 }, {t3 }, {t2 , t3 } are equal to zero (when Tf = {t2 , t3 }, fe = (a ∧ b) ∧ (a ∧ c) ∧ ¬a = 0 for instance). The Boolean functions associated to the four marking changes as well as the absence of marking change (self-loop on M0 ) are shown on Fig. 7c; it may be noted that the eight minterms which can be defined on the set of the three inputs are present in the disjunction of the four functions. If, for instance, the only observed vector T is ω0 = [0, 0, 0|0, 0, 0] , the observed behavior corresponds to the self-loop on M0 with the only minterm of f0 that is circled with dotted line (¬a ∧ ¬b ∧ ¬c); the unobserved behavior to the other minterms.

IFAC WODES 2018 Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159 May 30 - June 1, 2018. Sorrento Coast, Italy

4. EXAMPLE This example is based on the knowledge model that is represented at Fig. 2 and the following observed I/O sequence: 000010001100011 a b c A B C D −

M1

M0 {P1}

{t2}

M2

{P3}{B}

{t4}

M4 {P7,P8}{C,D}

{P5,P6}{A,C}

{t6,t7}

{t7}

M3

{t6}

{P6,P7}{C}

Caption

{t7}

0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 ω0 ω1 ω2 ω3 ω4 ω5 ω6 ω7 ω8 ω9 ω10 ω11 ω12 ω13 ω14

{t5}

{t6,t7}

{t8}

000110011110001 010000111000111 011100000000100                ω= 000000011110000                

{P4}

{t5}

{t4}

{t1,t2}

{t8}

157

M3' Fig. 8. Identified model

4.1 Construction of the identified model

ISD starts this time from ω1 but the observed output vector does not match with γ(M0 ), from this observation to ω4 . The initial state is only detected for ω5 . Hence, ISD stops and FA starts from ω6 . This analysis shows easily that the observed vectors ω6 to ω14 correspond respectively to an input change without marking change, the firing of t2 , three consecutive input changes without marking change, the firing of t4 , then successively those of t5 , t6 and t7 . FA concludes positively. The BA is then performed from ω5 . The observed vectors from ω5 to ω0 correspond respectively to the firing of t8 , the simultaneous firings of t6 and t7 , two successive input changes without marking change and the firing of t5 . BA concludes positively; hence the knowledge model is compatible with the observed sequence. The identified model that is built during these analyses is given at Fig. 8. It must be noted that the firing of some transitions (t4 , t5 ) with the same value of the input vector (ˆ u0 = u ˆ11 = [0, 0, 0]T for instance for t4 ) has been observed two times and that several different values of the input vector that do not change a marking (ˆ u8 , u ˆ9 , u ˆ10 for M1 , for instance) have been observed, too. 4.2 Determination of the unobserved behavior From the previous result and the knowledge of the Boolean functions associated to the transitions of the SIPN, the ARG of Fig. 9 can be obtained. In this model, the observed behavior corresponds to the minterms which are circled with a dotted line and the unobserved behavior to the minterms which are circled with a solid line. Only two markings will be somewhat detailed. Two transitions are enabled for M0 : Te = {t1, t2}. However, as Ft1 and Ft2 are exclusive, only one of them is possible for a given combination of the input values. No 3

It is also possible to remark that none of the transitions that follow ˆ1 = [0, 0, 1]T P1 is firable for the current values of the inputs u

157

Caption

{P2}

ISD starts from ω0 . The observed output vector yˆ0 = [0, 0, 0, 0]T matches with γ(M0 ), the output set associated to the initial marking of the SIPN. Therefore, ISD stops and FA starts from ω1 . However, the observed output vector yˆ1 = [1, 0, 1, 0]T means that either both P2 and P7 are marked or that P5 is marked. As it not possible to fire transitions that lead from the initial marking to one of these markings 3 , FA is stopped and ISD is relaunched.

1

2

M0

1 2 3 4 5 6 7 8

= = = = = = = =

7

8

3

4

{t1}

1

{t2}

{P1} 5 6 {t8} M4 6 8 {P7,P8} 1 4

2 5

3 7

2

M1 {P3} {t6,t7}

{t7} 1

2

1

2

5

6

{t4} 3 7

4 8

{P5,P6}

M3

{P6,P7} M3'

2

3

6

{t5}

1 5

6

8

5

{t6} 3

4

M2 {P4}

7

8

3 7

4

4

5

6

7

8

Fig. 9. ARG with the observed (minterms circled with dotted line) and unobserved behaviors (minterms circled with continuous line) firing of t1 has been observed; hence the behavior of the system from M0 and for the input combinations that correspond to the minterms 3 and 4 is unobserved. A firing of t2 for the minterm 5 has been observed; this is not the case for the minterm 6. The self-loop on M0 has been partially observed (observed for the minterms 7 and 8, unobserved for the minterms 1 and 2). Two transitions are also enabled for M3 : Te = {t6 , t7 }. Given the Boolean functions associated to these transitions, either only t6 is fired, or both transitions are simultaneously fired. The two firings have been partially observed. This is also the case of the self-loop on M3 . Globally, the observed behavior is composed of 20 couples (marking, minterm), for instance (M3 , 2 ) or (M3 , 7 ), and the behavior which has not been observed with 28 such couples, for instance (M3 , 1 ) or (M3 , 5 ). It may be noted that only the self-loop on M1 has been fully observed. 5. CONCLUSION This paper has presented a relative identification method for closed-loop reactive systems. The development of the Boolean functions on inputs which are associated to the transitions of the knowledge model permits to point out the behaviors which have been observed and unobserved. These information can be the starting point of research on active identication. In this approach indeed, the experiments to obtain the I/O sequences from which the identified model is to be built do not come from purely

IFAC WODES 2018 158 30 - June 1, 2018. Sorrento Coast, Italy Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159 May

passive observation of the evolutions of the closed-loop system but require that some inputs of the controller are to be forced. The forcing sequences must be constructed to observe evolutions which have not been obtained by passive observation; therefore, their construction relies on the accurate knowledge of the unobserved behavior. Construction of these sequences is the issue that will be addressed in our future work.

Appendix A

Algorithm 1 Identifed model construction 1: 2: 3: 4: 5: 6: 7: 8: 9: 10:

REFERENCES Angluin, D. (1987). Learning regular sets from queries and counterexamples. Information and Computation, 75(2). Dotoli, M., Fanti, M.P., Mangini, A.M., and Ukovich, W. (2011). Identification of the unobservable behaviour of industrial automation systems by Petri nets. Control Engineering Practice, 19(9), 958–966. Estrada-Vargas, A.P., Lpez-Mellado, E., and Lesage, J.J. (2015). A Black-Box Identification Method for Automated Discrete-Event Systems. IEEE Transactions on Automation Science and Engineering, 14(3), 1321–1336. Estrada-Vargas, A.P., L´ opez-Mellado, E., and Lesage, J.J. (2010). A Comparative Analysis of Recent Identification Approaches for Discrete-Event Systems. Mathematical Problems in Engineering, 2010, 1–21. Giua, A. and Seatzu, C. (2005). Identification of freelabeled Petri nets via integer programming. In Proceedings of the 44th IEEE Conference on Decision and Control, 7639–7644. Gold, E.M. (1967). Language identification in the limit. Information and Control, 10(5), 447 – 474. Meda-Campa˜ na, M. and L´ opez-Mellado, E. (2005). Identification of concurrent discrete event systems using Petri nets. In Proceedings of the 17th IMACS World Congress on Computational and Applied Mathematics, 11–15. Minas, M. and Frey, G. (2002). Visual PLC-programming using signal interpreted Petri nets. In Proceedings of the 2002 American Control Conference (IEEE Cat. No.CH37301), volume 6, 5019–5024 vol.6. Provost, J., Roussel, J.M., and Faure, J.M. (2011). A formal semantics for Grafcet specifications. In 2011 IEEE International Conference on Automation Science and Engineering, 488–494. Roth, M., Lesage, J.J., and Litz, L. (2010). Black-box identification of discrete event systems with optimal partitioning of concurrent subsystems. In Proceedings of the 2010 American Control Conference, 2601–2606. Saives, J., Faraut, G., and Lesage, J.J. (2015). Identification of discrete event systems unobservable behaviour by petri nets using language projections. In 2015 European Control Conference (ECC), 464–471. Schneider, S., Litz, L., and Lesage, J.J. (2012). Determination of timed transitions in identified discrete-event models for fault detection. In 2012 IEEE 51st IEEE Conference on Decision and Control (CDC), 5816–5821. 158

11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49:

procedure ModelConstruction(KM, ω) k = IS = 0  Initial state detection (ISD) M = M0 InitRG(M0 )  Initializing the identified model while yˆk = γ(M0 ) do if k > |ω| return False  Not compatible k =k+1 end while IS = k  Saving the initial state detected k = k  Forward analysis (FA) while yˆk = yˆk do  Looking for an output vector change if k  > |ω| then k  = k = IS  Returning to the initial state M = M0 go to BA end if k = k + 1 end while Ie = {ˆ uk } if Tf = ∅ go to ISD  No transitions can be fired Is = ∅ for k  From k To k  do if ∃tj ∈ Te (M ), Fj (ˆ uk ) = 1 then go to ISD  One transition is fired without output change end if Is = Is ∪ {ˆ uk } end for s(tj ) = 1 for tj ∈ Tf M = M + W.s  Computing next marking AddingMarkingRG(M, Te (M ), Tf , Ie , Is ) if yˆk = γ(M ) go to FA else go to ISD  Backward analysis (BA) while yˆk = yˆk do  Searching for an output vector change if k  = 0 return RG  Compatible k = k − 1 end while if ∀tj ∈ T˜e (M ), Fj (ˆ uk ) = 0 then  T˜e (M ) Set of previous enabled transitions k = IS  Returning to the initial state go to ISD end if for k  From k  To k do if ∃tj ∈ T˜e (M ), Fj (ˆ uk ) = 1 then k = IS  Returning to the initial state go to ISD end if end for s(tj ) = 1 for tj ∈ T˜f M = M − W.s  Computing the previous marking go to BA end procedure

IFAC WODES 2018 May 30 - June 1, 2018. Sorrento Coast, Italy Clement Galetta et al. / IFAC PapersOnLine 51-7 (2018) 152–159

Appendix B Algorithm 2 Unobserved behavior determination 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:

procedure UnObsMinterms(v)  For one vertex v of the RG E = P(Te ) R=∅ fE for Tf in E do fe = 1 for tj in Te do if tj in Tf : fe = fe ∧ Ftj else fe = fe ∧ ¬Ftj end for if fe (Tf )! = 0 : fE = fE ∪ fe end for AddEdgeARG(RG, fE )  Add missing evolutions to the ARG Te = InputCollection(v, ARG)  Set of input vectors leading to an evolution Emin = ∅  Set of minterms Omin = ∅  Set of observed minterms for fe in fE do min = Minterms(fe )  Set of minterms for m in min do E =E∪m for u ˆ in Is ∪ Ie do if m(ˆ u) = T rue then Omin = Omin ∪ m  the minterm m has been observed end if end for end for end for Umin = Emin − Omin  Unobserved minterms return (Umin , Omin ) end procedure

159

159