# Elementary Events for Modeling of Human-System Interactions with Petri Net Models

Rogério Campos-Rebelo, Anikó Costa, Luís Gomes

► To cite this version:

Rogério Campos-Rebelo, Anikó Costa, Luís Gomes. Elementary Events for Modeling of Human-System Interactions with Petri Net Models. 5th Doctoral Conference on Computing, Electrical and Industrial Systems (DoCEIS), Apr 2014, Costa de Caparica, Portugal. pp.219-226, 10.1007/978-3-642-54734-8_25. hal-01274778

HAL Id: hal-01274778

https://inria.hal.science/hal-01274778

Submitted on 16 Feb 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Elementary Events for Modeling of Human-System Interactions with Petri Net Models

Rogério Campos-Rebelo<fnref n="1" />,<fnref n="2" />, Anikó Costa<fnref n="1" />,<fnref n="2" />, Luís Gomes<fnref n="1" />,<fnref n="2" />

**Abstract.** This paper presents a proposal for structuring events for system models expressed using IOPT nets (Input-Output Place-Transition Petri nets). Currently, a non-autonomous event within an IOPT model is defined based on change of input signals with respect to a specific threshold, when two consecutive execution steps are considered. New types of events are proposed, allowing the definition of an event activated not only by crossing a fixed threshold, but also by considering a change in associated signal values on a specific amount (belonging to an interval of values). The concept is further extended allowing the definition of an event based on signal values presented on previous execution steps. The proposal results on a classification of several types of events, namely threshold events, momentum events, impetus events, as well as delayed events and logical events. Usage of these types of events allows improvements in terms of expressiveness and compactness of the resulted model.

**Keywords:** Petri nets, embedded systems, human-system interaction.

## 1 Introduction

System complexity has grown considerably over the last decades. Some of the reasons for this growth are related with the increase in systems' processing capability and memory, as well as associated with the development of more robust technology. This complexity is due, mainly, to the need to produce more efficient systems, and more user friendly.

The growing development of the Service Oriented Architecture (SOA) and the Event-Driven Architecture (EDA) combined with the reduction of cost in sensor technology have led, in the last years, to a big development in the use of events in the analysis of signals and system' behavior [1].

Use of event modeling allows the development of more complex systems expressed through a much more compact model, supporting the development of much more user friendly interfaces.

In order to cope with problems related with the system's complexity, several approaches were proposed to decompose the system development using multiple steps. Model Based Development approach, using specific languages for system specification, is one of these examples.

<footnote n="1">¹ Universidade Nova de Lisboa, Faculdade de Ciências e Tecnologia, Portugal.</footnote>

<footnote n="2">² UNINOVA – Centro de Tecnologias e Sistemas, Portugal.</footnote>

<footnote>{rcr, akc, lugo}@uninova.pt</footnote>
Graphical languages are normally recommended to support this approach. Some examples of graphical languages are statecharts [2], state-machines [3] or Petri Nets, which are used as reference modeling formalisms on this work.

The many developments that Petri Nets have suffered since its first presentation in 1962 [4] have led to the growth of their use in various areas. One of those areas is engineering, taking advantage of some Petri net intrinsic features, such as the ability to model synchronization, concurrency, and conflicts [5], as well as the simultaneous visualization of the structure and behavior of the system [6]. These features allow Petri nets to capture the dynamics of the system, making them also useful in simulation [7].

One of the issues that have taken a significant contribution to the growth of its use was the inclusion of non-autonomous characteristics. This has led to increasing the impact of their use, when compared to other modeling formalisms used for embedded systems design [8]. These non-autonomous characteristics allow the connection of the net with the environment, making them well suitable for modeling the system's controller behavior.

Some examples of non-autonomous Petri net classes are the Interpreted Petri nets [9], synchronized Petri nets [10] or IOPT nets (Input-Output Place-Transition nets) [11].

Whenever modeling human systems interactions are addressed, the number of available modeling primitives is limited.

Following the line of the work presented in [12], this paper presents a more complete and elaborated set of elementary events, benefiting from a scalable definition, addressing the effectiveness of Petri nets modeling for human-system interaction systems, also keeping applications within the controllers' modeling.

Augmenting the traditional way to define an event (as a signal trespassing a threshold level), new ways to define an event associated with signal changes were proposed in [12] related to amplitude and changing speed of variation on signal values.

In this work, this concept is extended allowing a generalized definition supporting the use of the specified signal variations.

On the other hand, for each variation level two different types of behaviors were previously defined. In this work, this definition is also extended.

## 2 Relationship to Collective Awareness Systems

Collective awareness systems are systems that allow interaction and knowledge development in collaboration by several people.

The work proposed in this paper presents a set of elementary events that are defined to be used in the future behavior definition based on events from one or more variables from one or more systems. These characteristics and its exact definition make them suitable for defining behaviors that can be shared or even set together.

On the other hand, the fact that the IOPT nets can be used to implement these events and these tools implemented online and interconnected in the same system ensures a greater capacity for development of collective awareness systems.
## 3 Signal Analysis

It is considered a signal as the value of a certain time variable. This variable can be physical or from the output of a system. As presented in [11], two ways can be considered to analyze a signal:

- Analysis of the signal value at a given moment in order to verify that this value meets a certain condition.

- Definition of events associated to that signal to analyze if the behavior of the signal in time obeys to the behavior that we want to find.

These two types of analysis are mainly different in terms of duration of the analysis. Whereas a condition is inspecting the value of the signal at a given instant of time. In an event, the behavior of the signal in time is analyzed.

From another point of view, a signal analysis can also be made taking into account different degrees of differences between consecutive values. The value of the signal, its derivative (considering two instants of analysis), its second derivative or the following derivatives can be analyzed. Given this analysis one can analyze not only a point or a variation between two points but also behaviors taking into account three or more instants on the signal.

In Table 1 these two types of dependencies on signal evolution is presented, showing the various possibilities for the analysis of a signal.

<table><caption>**Table 1.** Events and Conditions Definition</caption><thead><tr><th></th><th>X</th><th>ΔX</th><th>Δ<sup>2</sup>X</th><th>Δ<sup>3</sup>X</th><th></th></tr></thead><tbody><tr><th>Events</th><td>X<sub>n-1</sub> ≤ K<br>Δ<br>X<sub>n</sub> > K</td><td>ΔX<sub>n-1</sub> ≤ K<br>Δ<br>ΔX<sub>n</sub> > K</td><td>Δ<sup>2</sup>X<sub>n-1</sub> ≤ K<br>Δ<br>Δ<sup>2</sup>X<sub>n</sub> > K</td><td>Δ<sup>3</sup>X<sub>n-1</sub> ≤ K<br>Δ<br>Δ<sup>3</sup>X<sub>n</sub> > K</td><td>...</td></tr><tr><th>Conditions</th><td>X<sub>n</sub> = K</td><td>ΔX<sub>n</sub> = K</td><td>Δ<sup>2</sup>X<sub>n</sub> = K</td><td>Δ<sup>3</sup>X<sub>n</sub> = K</td><td>...</td></tr></tbody></table>

In terms of levels of variation (Δ), defined as a difference of signal value in two consecutive instants, it is possible to define higher order of differences.

It can be seen that for all variations of X, the conditions only analyze a given value of signal X of the index n, while an event is analyzed based on the behavior between two index values n and n-1.

In the table, it can also check the possibility of analysis of the signal behaviors at various instants of the signal. Given that ΔXn = Xn-1 - Xn and ΔXn-1 = Xn-2 - Xn-1, an event in ΔX analyzes signal values in three instants (Xn-2, Xn-1 e Xn). Likewise analyzing the event condition Δ²X it has that Δ²Xn = ΔXn-1 - ΔXn = (Xn-2 - Xn-1) - (Xn-1 - Xn) and Δ²Xn-1 = ΔXn-2 - ΔXn-1 = (Xn-3 - Xn-2) - (Xn-2 - Xn-1). Thus in Δ²X four values of the signal are analyzed (Xn-3, Xn-2, Xn-1 e Xn).
# 4 Elementary Events

An elementary event is defined as an event that cannot be obtained from the composition of other events of the same type.

In this work, two types of elementary events are determined that are distinguished by their behavior: elementary open events and elementary closed events.

## 4.1 Elementary Closed Events

Elementary Closed Events are events that define the analysis for the entire spectrum of signal values. In other words, any value that the signal can have satisfies one of the conditions of the event, either the Pre- or the Post-Condition.

An Elementary Closed Event is in such a way “Closed” that the event can be detected just by looking at one of the conditions. For instance, knowing that the signal satisfies a pre-condition at instant (n-1) and fails to satisfy this condition at instant n, it is guaranteed that he satisfies the post-conditions, which allows the detection of the signal without the need to analyze pre- and post- conditions.

In Table 2 the events defined with these characteristics are shown.

<table><caption>**Table 2.** Elementary Closed Events definitions.</caption><thead><tr><td>Pre-Condition</td><td>Post-Condition</td></tr></thead><tbody><tr><td>X<sub>n-1</sub> > K</td><td>X<sub>n</sub> ≤ K</td></tr><tr><td>X<sub>n-1</sub> ≥ K</td><td>X<sub>n</sub> < K</td></tr><tr><td>X<sub>n-1</sub> < K</td><td>X<sub>n</sub> ≥ K</td></tr><tr><td>X<sub>n-1</sub> ≤ K</td><td>X<sub>n</sub> > K</td></tr><tr><td>X<sub>n-1</sub> = K</td><td>X<sub>n</sub> ≠ K</td></tr><tr><td>X<sub>n-1</sub> ≠ K</td><td>X<sub>n</sub> = K</td></tr></tbody></table>

All events presented in the table are associated to value of signal X to simplify the presentation, but all these types of events can be defined in any ΔⁿX.

## 4.2 Elementary Open Events

Elementary Open Events are events that do not define the analysis for the entire spectrum of signal values. In other words, there are values that the signal may have that are not covered by the equations that define the signal.

The Table 3 presents the defined set of types of elementary open events.
<table><caption>**Table 3.** Elementary Open Events definitions.</caption><thead><tr><td>Pre-Condition</td><td>Post-Condition</td></tr></thead><tbody><tr><td>X<sub>n-1</sub> > K</td><td>X<sub>n</sub> < K</td></tr><tr><td>X<sub>n-1</sub> < K</td><td>X<sub>n</sub> > K</td></tr><tr><td>X<sub>n-1</sub> < K</td><td>X<sub>n</sub> = K</td></tr><tr><td>X<sub>n-1</sub> > K</td><td>X<sub>n</sub> = K</td></tr><tr><td>X<sub>n-1</sub> = K</td><td>X<sub>n</sub> > K</td></tr><tr><td>X<sub>n-1</sub> = K</td><td>X<sub>n</sub> < K</td></tr></tbody></table>

An elementary closed event can be analyzed taking into account only one of the conditions (pre or post-condition) in the two consecutive steps of analysis. For this kind of events, if the pre-condition was satisfied in the step n-1 and the same pre-condition is not satisfied in the step n, the event occurs because the post-condition is satisfied. For elementary open events, both conditions (pre and post) are needed to be analyzed.

To better understand, this type of events, it will be analyzed the event of the fourth row of the table, with the conditions $X_{n-1}> K \land X_n = K$. In this case, if the signal satisfies the pre-condition in instant (n-1), being greater than K and fails to satisfy this condition in instant n becoming less than K, while the pre-condition to be no longer satisfied the event does not occur. Thus, it is not possible to define this type of events using only one equation as proved possible for elementary closed events.

It is not possible to define an elementary open event by composition of other events of the same type. This is the reason that makes it elementary. Despite this, being of another type, it is possible to define elementary closed events by composition of elementary open events.

## 4.3 Complete List of Elementary Events

With the previous definitions, it is possible to define a large number of types of events that define the behaviors of interest in the associated signal.

Putting together the elementary open events and the elementary closed events a set of twelve types of events is obtained. A set of identifiers is used to represent events in a compact form.

The twelve events resulting from the merger mentioned above are defined for each of the various levels of variation $(X, \Delta X, \Delta^2 X, \Delta^3 X, \dots, \Delta^n X)$.

The Table 4 presents this set of events for X and $\Delta X$, showing the conditions of the event and a graphical representation of the behavior of the signal that makes this event to occur.

For each level of variation, twelve types of events were defined, each one representing a specific behavior of the signal. These types of events are represented with a specific operator.

In the variation level 0, the value of (X) is analyzed, detecting crossing of a specific value. For example, it is possible to define an event to detect if the temperature of the
car is higher than 90 degrees. In variation level 1, the first difference (ΔX) is analyzed, associated with the velocity of variation of the signal. For example, an event that occurs whenever the temperature of the car is increasing more than 5 degrees per minute can be defined. Finally, the other levels represent the next variations, starting with level 2, the second difference (Δ²X) (representing the acceleration of variation) up to level n represented by (ΔⁿX).

<table><caption>**Table 4.** Complete Elementary Events list</caption><thead><tr><th></th><th>X</th><th></th><th>ΔX</th><th></th></tr></thead><tbody><tr><td>&lt;&gt;</td><td>X<sub>n-1</sub> &lt; k<br>ΔX<sub>n-1</sub> &lt; k</td><td>k</td><td>ΔX<sub>n-1</sub> &lt; k<br>ΔX<sub>n-1</sub> &lt; k</td><td>Δ&gt;k<br>Δ&lt;k</td></tr><tr><td>&gt;&lt;</td><td>X<sub>n-1</sub> &gt; k<br>ΔX<sub>n-1</sub> &gt; k</td><td>k</td><td>ΔX<sub>n-1</sub> &gt; k<br>ΔX<sub>n-1</sub> &gt; k</td><td>Δ&lt;k<br>Δ&gt;k</td></tr><tr><td>&gt;</td><td>X<sub>n-1</sub> ≤ k<br>ΔX<sub>n-1</sub> ≤ k</td><td>k</td><td>ΔX<sub>n-1</sub> ≤ k<br>ΔX<sub>n-1</sub> ≤ k</td><td>Δ&gt;k<br>Δ≤k</td></tr><tr><td>≥</td><td>X<sub>n-1</sub> &lt; k<br>ΔX<sub>n-1</sub> &lt; k</td><td>k</td><td>ΔX<sub>n-1</sub> &lt; k<br>ΔX<sub>n-1</sub> &lt; k</td><td>Δ≥k<br>Δ&lt;k</td></tr><tr><td>≤</td><td>X<sub>n-1</sub> ≥ k<br>ΔX<sub>n-1</sub> ≥ k</td><td>k</td><td>ΔX<sub>n-1</sub> ≥ k<br>ΔX<sub>n-1</sub> ≥ k</td><td>Δ&lt;k<br>Δ≥k</td></tr><tr><td>=</td><td>X<sub>n-1</sub> &gt; k<br>ΔX<sub>n-1</sub> &gt; k</td><td>k</td><td>ΔX<sub>n-1</sub> &gt; k<br>ΔX<sub>n-1</sub> &gt; k</td><td>Δ≤k<br>Δ&gt;k</td></tr><tr><td>=+</td><td>X<sub>n-1</sub> &ne; k<br>ΔX<sub>n-1</sub> &ne; k</td><td>k</td><td>ΔX<sub>n-1</sub> &ne; k<br>ΔX<sub>n-1</sub> &ne; k</td><td>Δ=k<br>Δ&ne;k</td></tr><tr><td>=-</td><td>X<sub>n-1</sub> &ne; k<br>ΔX<sub>n-1</sub> &ne; k</td><td>k</td><td>ΔX<sub>n-1</sub> &ne; k<br>ΔX<sub>n-1</sub> &ne; k</td><td>Δ=k<br>Δ&lt;k</td></tr><tr><td>&ne;</td><td>X<sub>n-1</sub> = k<br>ΔX<sub>n-1</sub> = k</td><td>k</td><td>ΔX<sub>n-1</sub> = k<br>ΔX<sub>n-1</sub> = k</td><td>Δ&ne;k<br>Δ=k</td></tr><tr><td>&ne;+</td><td>X<sub>n-1</sub> = k<br>ΔX<sub>n-1</sub> = k</td><td>k</td><td>ΔX<sub>n-1</sub> = k<br>ΔX<sub>n-1</sub> = k</td><td>Δ&gt;k<br>Δ=k</td></tr><tr><td>&ne;-</td><td>X<sub>n-1</sub> &ne; k<br>ΔX<sub>n-1</sub> &ne; k</td><td>k</td><td>ΔX<sub>n-1</sub> &ne; k<br>ΔX<sub>n-1</sub> &ne; k</td><td>Δ&lt;k<br>Δ=k</td></tr></tbody></table>
## 4.4 Delayed Analysis of Events

Until now, all events have been presented as analysis of variations in the signal between two consecutive steps of analysis ($X_n$ and $X_{n-1}$). Nevertheless, it is possible to set all these events and an analysis based on two distinct instants (not consecutive) separated by p steps of analysis (instead of one).

In this sense, delayed events are not a new type of events. They are a characteristic that can be changed in any type of elementary events. With the addition of this characteristic, the analysis of the event is done taking into account the values ($X_n$ e $X_{n-p}$). The analysis accomplished in the previous section is done considering two consecutive steps as a particular case where the value p = 1.

In Fig. 1 the way to analyze an event with delay is represented.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Analysis of a delayed Event.</figcaption></figure>

To analyze this event a p-sized window is created and the signal inside this window is not used to the analysis of the event.

Taking into account the large number of types of events is not possible to use one single example to explain the full potential of these types of events. As a matter of fact, due to lack of space, it is not possible even to present a simple system's model taking advantage of any of these new modeling capabilities.

## 5 Conclusions and Further Work

The use of these new types of events provides effective modeling capabilities when using IOPT nets models. It allows the creation of smaller models for the same system, making them easier to read and easy to interpret.

The definition of different variations of the signal allows the analysis of a set of behaviors that allow a better knowledge of the signal, allowing not only changes on the value of the signal, but how these changes occurs, like its velocity or acceleration or even the acceleration of the velocity of the signal.

Taking into account the following objective to define events that represent more complex behavior of associated signs by composition of simple events, the definition of these elementary events becomes a robust starting point for this composition.

Those robust definitions allow the composition of events from different signals and even from different variations of the signal.
As future work, it is foreseen to define a set of transformations, as well as
composition between elementary events in order to create a composed event. To do
this, a standard compact representation for all elementary events and to the interaction
between them needs to be defined.

**Acknowledgments.** The first author was supported by a Grant from project PTDC/EEI-AUT/2641/2012, financed by Portuguese Agency" FCT - Fundação para a Ciência e a Tecnologia".

This work was partially financed by Portuguese Agency" FCT - Fundação para a Ciência e a Tecnologia" in the framework of projects PEst-OE/EEI/UI0066/2011 and PTDC/EEI-AUT/2641/2012.

References

1. Eckert M, Bry F. Complex Event Processing (CEP). Informatik-Spektrum [Internet]. Springer-Verlag; 2009;32(2):163-7. Available from: http://dx.doi.org/10.1007/s00287-009-0329-6

2. Harel D. Statecharts: A visual formalism for complex systems. Sci Comput Program. Elsevier; 1987;8(3):231-74.

3. Börger E, Stärk RF. Abstract state machines: a method for high-level system design and analysis. Springer Heidelberg; 2003.

4. Petri CA. Kommunikation mit Automaten (Communication with Automata) [Internet]. [Hamburg]; 1962. Available from: http://edoc.sub.uni-hamburg.de/informatik/volltexte/2011/160

5. Peterson JL. Petri Nets. ACM Comput Surv. 1977;9(3):223-52.

6. Zurawski R, MengChu Z. Petri nets and industrial applications: A tutorial. Ind Electron IEEE Trans. 1994;41(6):567-83.

7. Murata T. Petri nets: Properties, analysis and applications. Proc IEEE. 1989;77(4):541-80.

8. Gomes L, Barros JP, Costa A. Modeling Formalisms for Embedded Systems Design. In: Zurawski R, editor. Embed Syst Handb. 2005.

9. MOUSSA F, RIAHI M, KOLSKI C, MOALLA M. Interpreted Petri Nets used for Human-Machine Dialogue Specification in Process Control: principles and application to the Ergo-Conceptor+ tool. Integr Comput Aided Eng. 2002;pp. 87-98.

10. Moalla M, Pulou J, Sifakis J. Synchronized petri nets: A model for the description of non-autonomous sytems. Math Found Comput Sci 1978. 1978;374-84.

11. Gomes L, Barros JP, Costa A, Nunes R. The Input-Output Place-Transition Petri Net Class and Associated Tools. Ind Informatics, 5th IEEE Int Conf. 2007. p. 509-14.

12. Campos-Rebelo R, Costa A, Gomes L. On Structuring Events for IOPT Net Models. In: Camarinha-Matos L, Tomic S, Graça P, editors. Technol Innov Internet Things SE - 25 [Internet]. Springer Berlin Heidelberg; 2013. p. 229-38. Available from: http://dx.doi.org/10.1007/978-3-642-37291-9_25