scieee AI-readable full text Open interactive document viewer

Inferencia y verificación de propiedades en sistemas ciber-físicos estocásticos

Romero Flores, Javier; Vernyuk, Dmytro

Abstract

Este Trabajo de Fin de Grado tiene principalmente como objetivo la ampliación de las capacidades de análisis de las herramientas para la vericación de los sistemas ciberfísicos en tiempo de ejecución. Los requisitos de la vericación están expresados en Signal Temporal Logic (STL), un tipo de lógica temporal enfocada al análisis de señales analógicas o reales. La lógica temporal es un tipo de lógica modal que nos permite expresar propiedades sobre un estado o una secuencia de estados del sistema. La primera mejora consiste en añadir dos nuevos operadores lógicos para denir tendencias (derivadas) y acumulaciones (integrales) sobre esas señales. La segunda parte del proyecto consiste en incorporar los nuevos operadores lógicos en una una biblioteca de minería de datos ya existente para evaluar expresiones de STL paramétrica. Hemos comprobado el buen funcionamiento de los nuevos operadores y hemos diseñado una nueva interfaz gráca para ofrecer una interacción más fácil tanto con STL como con la biblioteca de minería.

Full text

Inferencia y verificación de propiedades en sistemas ciber-físicos estocásticos Inference and verification of properties in stochastic cyber-physical systems Director: José Ignacio Requeno Autores: Javier Romero Flores (GIC) & Dmytro Vernyuk (GII) Trabajo de fin de grado del Grado en Ingeniería de Computadores e Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid Curso 2021-2022 I ain't no physicist but I know what matters.  Popeye el Marino I II Resumen Este Trabajo de Fin de Grado tiene principalmente como objetivo la ampliación de las capacidades de análisis de las herramientas para la vericación de los sistemas ciberfísicos en tiempo de ejecución. Los requisitos de la vericación están expresados en Signal Temporal Logic (STL), un tipo de lógica temporal enfocada al análisis de señales analógicas o reales. La lógica temporal es un tipo de lógica modal que nos permite expresar propiedades sobre un estado o una secuencia de estados del sistema. La primera mejora consiste en añadir dos nuevos operadores lógicos para denir tendencias (derivadas) y acumulaciones (integrales) sobre esas señales. La segunda parte del proyecto consiste en incorporar los nuevos operadores lógicos en una una biblioteca de minería de datos ya existente para evaluar expresiones de STL paramétrica. Hemos comprobado el buen funcionamiento de los nuevos operadores y hemos diseñado una nueva interfaz gráca para ofrecer una interacción mas fácil tanto con STL como con la biblioteca de minería. Palabras Clave : Lógica Temporal STL Derivada Integral Interfaz Gráca PyQt Minería de Datos C++ Python III IV Abstract The purpose of this Final Degree Project is mainly to expand the analysis capabilities of the tools for the verication of cyber-physical systems at runtime. The verication requirements are expressed in Signal Temporal Logic (STL), a type of temporal logic focused on the analysis of analog or real signals. Temporal logic is a type of modal logic that allows us to express properties about a state or a sequence of states of the system. The rst improvement consists of adding two new logical operators for dening trends (derivatives) and accumulations (integrals) in those signals. The second part of the project consists of including the new logical operators to an existing data mining library for evaluating parametric STL expressions. We have tested the functionality of the new operators and designed a new graphical interface that oers an easier interaction with both STL and the data mining library. Keywords : Temporal Logic STL Derivative Integral GUI PyQt C++ Python Data Mining Índice general 1. Introducción 1 1.1. Sistemasciberfísicos ................................ 1 1.2. Objetivos ...................................... 2 1.3. Organización del documento . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4. Planicación temporal y esfuerzo . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4.1. Primera - Investigación . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4.2. Segunda - Documentación . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4.3. Tercera - Implementación . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4.4. Cuarta - Diseño y Finalización . . . . . . . . . . . . . . . . . . . . . . 4 1.5. OrganizacióndeEquipo .............................. 4 2. Introduction 7 2.1. Cyber-physicalsystem............................... 7 2.2. Objectives...................................... 8 2.3. DocumentOrganization .............................. 8 2.4. Timescheduleandeort.............................. 8 2.4.1. First-Research............................... 9 2.4.2. Second - Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4.3. Third - Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4.4. Fourth - Design and Completion . . . . . . . . . . . . . . . . . . . . . 9 2.5. TeamOrganization................................. 10 3. Nuevos operadores para STL 11 3.1. LógicaTemporal .................................. 11 3.2. SignalTemporalLogic............................... 13 3.3. STLEval....................................... 14 3.4. Denición de los nuevos operadores . . . . . . . . . . . . . . . . . . . . . . . . 14 3.5. Integración con ParetoLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 V VI ÍNDICE GENERAL 4. Interfaz gráca 19 4.1. Estructura...................................... 19 4.2. Bibliotecasutilizadas................................ 20 4.2.1. PyQt5.................................... 20 4.2.2. MatplotLib ................................. 21 4.2.3. Pandas ................................... 22 4.2.4. Seaborn................................... 22 4.3. Guíadeuso..................................... 22 5. Conclusiones y trabajo futuro 25 5.1. Conclusiones .................................... 25 5.2. Trabajofuturo ................................... 26 6. Conclusions and future work 27 6.1. Conclusions..................................... 27 6.2. Futurework..................................... 28 Bibliografía 29 Capítulo 1 Introducción 1.1. Sistemas ciberfísicos Los sistemas ciberfísicos son un tipo especial de sistemas en tiempo real que combinan un micro controlador o programa software, representado mediante una máquina de estados discretos, con uno o varios sensores que interactúan sobre una variable física. Ejemplos de este tipo de entornos son los ordenadores de a bordo que regulan la velocidad de crucero de un vehículo, o el piloto automático que controla la altitud y trayectoria de un avión. Garantizar el correcto funcionamiento de estas plataformas es crucial, ya que un mal funcionamiento conlleva una reducción del comfort por parte de los usuario o, incluso, la pérdida de vidas humanas. Una manera de asegurarlo es mediante el uso de técnicas de veri- cación formal. Las técnicas de vericación en tiempo de ejecución [6] ( runtime verication en inglés) implementan un monitor que supervisa que la ejecución actual cumple con los requisitos especicados. Los monitores actúan como guardianes, alertando al usuario cuando la ejecución se desvía del comportamiento deseado e, incluso, implementando contramedidas para revertir ese hecho y redirigir el sistema hacia un estado saludable. Existen diversos formalismos para denir los comportamientos deseados y no deseados. Los requisitos se pueden expresar operacionalmente, mediante algún tipo de autómata de estados nito, o declarativamente, mediante una descripción lógico-matemática. Dentro de esta segunda categoría, la lógica temporal es un tipo de lógica modal que expresa propiedades sobre un estado en particular del sistema, o sobre los caminos (es decir, secuencia de estados) que atraviesa. En este trabajo utilizaremos Signal Temporal Logic [7], un tipo de lógica temporal enfocada al análisis de señales analógicas o reales. 1 8 CAPÍTULO 2. INTRODUCTION 2.2. Objectives The objectives of this project are: Extend the capabilities of temporal logic to express properties involving trends (derivatives), or accumulations (integrals), Implement these new logical operators in current software tools, and Provide a friendly user interface that facilitates interaction with said tools. In particular, the project objectives have been translated into concrete contributions to the following pre-existing software tools: STLEval [2]: It is a tool capable of processing STL specications and evaluating them on a real signal. It has received the implementation of the new temporal logic operators that calculate derivatives and integrals on a signal. STLEval [2]: It is a mining library that learns the (in)valid congurations of the monitored system expressed as templates or parametric specications in STL. ParetoLib internally interfaces with STLEval for the execution of the calculations. It has received an update of the STLEval binaries and DLL libraries which package together with the rest of the library, as well as the graphical user interface (GUI). The new graphical user interface allows to interact both with the learning library and indirectly with the STLEval tool. 2.3. Document Organization The document is divided into 4 chapters. In the chapter 3 we will detail the semantics and implementation of the new logical operators. The chapter 4 is dedicated to the new graphical user interface. Finally, we continue with the most relevant conclusions of the project in the chapter 5, and sketch some ideas for the future work. 2.4. Time schedule and eort This project lasted 8 months and was carried out by two part-time students, Dmytro Vernyuk (GII) and Javier Romero Flores (GIC), with an average dedication of 3 hours per day. The students have been tutored by José Ignacio Requeno through weekly meetings. Approximately 1300 lines of code have been modied or created, which are distributed between the two updated software tools and the new graphical user interface. graphical user interface. The code developed in this project can be consulted in the new functionalities 2.4. TIME SCHEDULE AND EFFORT 9 of the corresponding web repositories ( derivative branch of STLEval and GUI branch of ParetoLib). The project started on September 13, 2021, and has consisted of 4 phases. 2.4.1. First - Research The project started with a rst phase of research, where we dedicated ourselves to theoretical knowledge necessary for the work: reading information about what is temporal logic and the main dierence with other modal logics. We resorted both to the material provided by the instructor and to the external material available to learn the main denitions and basic syntax. This was the most complicated part of the whole work not only because of the theoretical diculty of the specialized information in the eld of but also because of the paradigm shift involved in understanding the main concept of this logic: that an assertion can become a negation depending on the instant at which the expression is evaluated. 2.4.2. Second - Documentation After acquiring the previous theoretical knowledge necessary for the understanding of the functionalities to be implemented, we continued with the reading of the documentation of the libraries and software tools to be extended: their software architecture and class hierarchy. We devoted a great deal of eort to study the denition of the derivation and integration operators proposed in the scientic literature, and their subsequent coding and incorporation into the STLEval software tool. 2.4.3. Third - Implementation We implemented the operations of derivation and integration of time signals in the STLEval software tool. We completed this task with a set of tests on time signals with benign characteristics that facilitated us to run validation tests: for example, the integral of a periodic signal (sinusoidal or triangular) symmetric about the horizontal axis should be zero in certain intervals. 2.4.4. Fourth - Design and Completion As a last task we implemented the graphical interface of the application, starting from a rst sketch that we stabilized after two meetings. The most complicated task of this process was the connection between the dierent components of the interface with the methods of the STLEval and ParetoLib tools, which execute all the program logic. The connection with STLEval was made through a pre-existing API in C++ that was already integrated in Python through the ParetoLib library. This fact, the possibility of accessing both the ParetoLib mining library and the STLEval tool indirectly, motivated the 10 CAPÍTULO 2. INTRODUCTION Figure 2.1: Gantt diagram. choice of Python as the programming language for the design of the user windows. The ease of use of the language as well as the number of auxiliary libraries for data processing with which to extend the functionalities of the interface in the future also contributed to this decision. 2.5. Team Organization Due to the theoretical diculty of this project, we decided to carry out the tasks jointly: all the sections of this project, except for the documentation work, were carried out at the same time by both members of the team. The planning coincides with the phases of the project, the exact dates are shown in the following chart. Capítulo 3 Nuevos operadores para STL 3.1. Lógica Temporal Si navegamos por internet o buscamos en los libros acerca de qué es la lógica temporal tarde o temprano daremos con una cita del lósofo alemán Kant que cita: la posibilidad de principios apodícticos de las relaciones del tiempo, o axiomas del tiempo en general. Tiene una sola dimensión: los distintos tiempos no son simultáneos, sino sucesivos Y, aunque quizás sacado de todo contexto, es un buen primer comienzo para explicar acerca de qué es el tiempo y por consiguiente qué tiene que ver la lógica con éste. Y es que Kant quería expresar que el tiempo es algo que va ocurriendo constantemente, es un conjunto de hechos que juntos transcurren en una dirección y conforman el tiempo. Pues bien, teniendo en cuenta esta idea podemos llegar a comprender y diferenciar la lógica temporal. La lógica proposicional no tiene la percepción de tiempo: en este tipo de lógica tenemos hechos que son verdaderos o falsos, que unidos pueden transformarse en verdad o no, pero nunca individualmente cambian su valor. Por ejemplo si decimos que: s = El día está soleado Este argumento será eterno individualmente. Aún así, realizamos operaciones con él como negarlo ¬s ,: todo el argumento se verá afectado en todo momento. ¬s = El día no está soleado Pero como todos podemos percibir, en la realidad esto no sucede. En otras palabras, 11 12 CAPÍTULO 3. NUEVOS OPERADORES PARA STL Figura 3.1: Máquina de estados. Figura 3.2: Traza de ejecución (discreta). puede que no todo el día esté soleado, pero quizás si por la mañana y no por la tarde o viceversa. Esto es lo que trata de expresar la lógica temporal. En un momento determinado una expresión puede ser verdad mientras que en otra hora, minuto, segundo, o cualquier otra unidad que utilicemos para medir el tiempo, puede cambiar y tener un valor diferente. En un sistema ciberfísico, el controlador software se representa como una máquina de estados (Figura 3.1). Tras el estado inicial s0 , la aplicación puede moverse de un estado a otro dependiendo de las restricciones de la máquina. Esto dará lugar a una traza de ejecución (Figura 3.2) donde el tiempo se reeja en el número de estados recorridos. En este ejemplo, el tiempo es discreto : cada instante temporal está asociado a un único estado del sistema. En un entorno real, el tiempo es denso , es decir, el estado de la aplicación cambia en función de los datos que registra en los sensores o en las reacciones que cambian un parámetro físico (Figura 3.3). Figura 3.3: Traza de ejecución (densa). 3.2. SIGNAL TEMPORAL LOGIC 13 En este trabajo utilizaremos Signal Temporal Logic [7], un tipo de lógica temporal enfocada al análisis de señales analógicas o reales. 3.2. Signal Temporal Logic Signal Temporal Logic (STL) [7] es un tipo de lógica temporal especializada en el análisis de señales reales analógicas. STL permite expresar características sobre la evolución de algún atributo físico, como la velocidad o temperatura. Por tanto, como punto de partida, STL requiere una muestra o traza de ejecución sobre la que comprobar las hipótesis. La lógica distingue dos tipos de situaciones: propiedades que se satisfacen en un estado o momento puntual de la traza de ejecución, o propiedades de camino que se evalúan a lo largo de una secuencia de eventos. STL proporciona operadores para recorrer los diferentes estados del sistema y comprobar en qué momentos se cumplen las propiedades. Por ejemplo, la proposición atómica v > 120 mostraría los instantes en los que la velocidad supera los 120 . Los operadores de camino enriquecerían esa expresión para analizar si la velocidad se sobrepasa puntualmente en algún momento ( F )uturo del viaje, ( G )eneralmente a lo largo de todo el recorrido, o permanece constante hasta ( U ntil) que se incrementa a un nuevo valor. Formalmente, la gramática básica de STL comprende los siguientes operadores: φ:= µ| ¬φ|φ1∨φ2|φ1U[t1,t2]φ2 Donde µ representa las proposiciones atómicas, en forma de desigualdades sobre la señal muestreada (p.ej., µ:= v > 120 ); y φ las especicaciones sobre los caminos. El resto de los operadores se componen a partir de los operadores precedentes, donde t1, t2∈R≥0 son marcas temporales que denen el intervalo de monitorización respecto al instante inicial, siendo t2≥t1 . F[a,b]φ≡ ⊤U[a,b]φ G[a,b]φ≡ ¬F[a,b]¬φ Existen versiones extendidas que permiten analizar aspectos cuantitativas con STL, por ejemplo, los valores máximos/mínimos [1] o integrales en un intervalo, o calcular la derivada en un punto [5]. Las especicaciones en STL se compilan en un monitor que supervisa la ejecución del sistema (p. ej., el sensor de velocidad de un vehículo). Algunos intérpretes de STL son 14 CAPÍTULO 3. NUEVOS OPERADORES PARA STL Figura 3.4: Señal original y su reconstrucción. AMT [9] (sintaxis básica) y STLEval [2] (sintaxis básica y operadores de min/max). En este proyecto, implementaremos en STLEval los operadores cuantitativos de STL que permiten calcular integrales y derivadas sobre una señal, según la denición propuesta en [5]. 3.3. STLEval STLEval es una herramienta capaz de manejar tanto expresiones STL básicas, que devuelven señales Booleanas, como ciertas extensiones cuantitativas, que transforman la señal de entrada en una nueva señal continua (operadores de min/max). Por estos motivos, así como su eciencia (está escrita en en C++) STLEval se ha tomado como punto de partida para implementar los operadores cuantitativos de STL que permiten calcular integrales y derivadas sobre una señal, según la denición propuesta en [5]. Internamente, STLEval representa una señal como una serie temporal, es decir, una sucesión de pares (clave, valor) donde la clave es una marca temporal y el valor representa la magnitud física en ese momento. La imagen 3.4 ilustra la señal original y su representación interna en STLEval. 3.4. Denición de los nuevos operadores El cálculo de la derivada e integral se aproximan mediante las siguientes expresiones matemáticas, donde x representa la señal completa, xτ es el valor de la señal en el instante τ , µi [a,b] es la integral en el intervalo [a, b] y µd + ( µd − ) representan la aproximación de la derivada por la derecha (izquierda) del instante temporal en cuestión: 3.4. DEFINICIÓN DE LOS NUEVOS OPERADORES 15 Figura 3.5: Interpretación de la derivada e integral. µd +=dg(x) dt+≥c µi [a,b]=Zb a g(xτ)δτ ≥c µd −=dg(x) dt−≥c Dado que internamente STLEval representa las señales reales como una serie numérica discreta, aproximamos el instante temporal τ como τ=kδt donde δt es la frecuencia de muestreo y k el término de la sucesión: µd +=g(x(k+1)δt)−g(xkδt)≥cδt µi [a,b]= k+b/δt−1 X k′=k+a/δt g(xk′δt)δt ≥c µd −=g(xkδt)−g(x(k−1)δt)≥cδt Grácamente, la derivada se interpreta como la pendiente entre dos puntos consecutivos de la señal; y la integral como el sumatorio del área de los rectángulos con base δt contenidos en el intervalo (Figura 3.5). Los nuevos operadores se han incorporado a STLEval. En la notación de la herramienta, D simboliza el operador derivada ( D≡µd + ), e I representa el operador integral ( I[a, b]≡ µi [a,b] ). 16 CAPÍTULO 3. NUEVOS OPERADORES PARA STL 3.5. Integración con ParetoLib ParetoLib [3, 8] es una biblioteca de minería que recibe una especicación paramétrica o plantilla en STL y devuelve el rango de valores de las variables para las que la propiedad se satisface o invalida. Internamente, ParetoLib implementa un algoritmo de búsqueda que guía el aprendizaje y evalúa instancias concretas de la fórmula temporal a través de la herramienta STLEval. Para ello, ParetoLib se empaqueta junto los binarios y librerías dinámicas de STLEval precompilados tanto para Linux como para Windows, lo que convierte a la biblioteca en una herramienta multiplataforma. Figura 3.6: Señal triangular. Gracias a la actualización de STLEval, podemos evaluar expresiones que involucren parámetros en derivadas e integrales. Por ejemplo, dada una señal triangular (Figura 3.6) evaluamos sobre ella la siguiente especicación STL 1 : G[0,p1]Dx0>= 6 −p2 donde p1 y p2 son los parámetros, x0 es la señal y D es el operador derivada. Como resultado, ParetoLib devuelve la imagen 3.7 que muestra las conguraciones de los parámetros p1 y p2 que satisfacen la propiedad (región en verde) y las que lo falsican (región en rojo). Asimismo, podemos ejecutar expresiones con integrales como por ejemplo: On[0,p1]Ix0>= 5 ∗106−p2 donde p1 y p2 son los parámetros, x0 es la señal, I es el operador integral y On[0,p1] indica el intervalo de integración. Igualmente, ParetoLib devuelve como resultado la imagen 1 La ecuación muestra los operadores con notación inja por legibilidad, aunque STLEval realmente utiliza notación preja. Es decir, se escribiría (G[0,p1](>= (Dx0) 6 −p2)) . 3.5. INTEGRACIÓN CON PARETOLIB 17 Figura 3.7: Resultado paramétrico para la derivada. 3.8 que muestra las conguraciones de los parámetros p1 y p2 que satisfacen la propiedad (región en verde) y las que lo falsican (región en rojo). Cabe mencionar que este tipo de mapas ya estaban previamente disponibles como resultado de la ejecución de la biblioteca de minería. ParetoLib está escrito en Python. El código fuente 3.1 ilustra la forma tradicional de invocar a la biblioteca de minería. En el capitulo 4 veremos la nueva interfaz gráca que va a facilitar al usuario el trabajo con ParetoLib y con STLEval. 1 from ParetoLib.Oracle.OracleSTLe import OracleSTLeLib 2 from ParetoLib.Search.Search import Search2D , EPS, DELTA , STEPS 3 4 # File containing the definition of the Oracle 5 nfile = '../../../Tests/Oracle/OracleSTLe/2D/triangular/derivative/ triangular.txt' 6 human_readable = True 7 8 # Definition of the n-dimensional space 9 min_x , min_y = (1.0, 0.0) 10 max_x , max_y = (999.0, 2.0) 11 24 Capítulo 5 Conclusiones y trabajo futuro Para acabar este trabajo presentamos algunas conclusiones sobre los temas tratados, tan- to teóricos como prácticos, y discutimos algunas ideas propicias para la mejora y continuidad del proyecto. 5.1. Conclusiones Este trabajo ha tenido como objetivo mejorar las capacidades de análisis de las herramientas para la vericación de los sistemas ciberfísicos en tiempo de ejecución. Para ello, hemos utilizado la lógica temporal como formalismo para especicar las propiedades que debe satisfacer el sistema. En particular, hemos usado Signal Temporal Logic (STL), un tipo de lógica temporal enfocada al análisis de señales analógicas que provienen de sensores físicos (p.ej., la velocidad o temperatura). Entre los resultados más relevantes en este proyecto, hemos logrado extender las capacidades de la lógica temporal STL para expresar propiedades que involucren tendencias (derivadas), o acumulaciones (integrales). Hemos implementado esos nuevos operadores lógicos en las herramientas software de vericación actuales, principalmente en la herramienta STLEval. Junto con STLEval, nos hemos ocupado también de la biblioteca ParetoLib, una biblioteca de minería que aprende las conguraciones (in)válidas del sistema monitorizado, expresadas como plantillas o especicaciones paramétricas en STL. ParetoLib internamente se conecta con STLEval para la ejecución de los cálculos, por lo que ha recibido una actualización de los binarios y bibliotecas DLL de STLEval que empaqueta de forma conjunta con el resto de la biblioteca para dar soporte a las nuevas operaciones de derivación e integración. Por último, hemos proporcionado una interfaz de usuario amigable que facilita la interacción tanto con la biblioteca de aprendizaje como indirectamente con la herramienta 25 26 CAPÍTULO 5. CONCLUSIONES Y TRABAJO FUTURO STLEval. La interfaz gráca abstrae la complejidad de invocar a STLEval a través de la consola de comandos, o mediante código fuente en Python en el caso de ParetoLib (código fuente 3.1), tal y como sucedía anteriormente hasta ahora. La interfaz gráca resume la mayor parte de las opciones de conguración de la herramienta de vericación y del algoritmo de minería. Finalmente, nos gustaría recalcar el arduo esfuerzo realizado en la documentación e investigación bibliográca previa para la adquisición de los conocimientos necesarios para la elaboración de los resultados presentados en estas conclusiones. 5.2. Trabajo futuro Como trabajo futuro, planteamos las siguientes extensiones o mejoras. Por un lado, proponemos incluir más opciones en la interfaz gráca de usuario que nos permitan congurar parámetros adicionales de las herramientas de vericación y minería y que hasta ahora se han omitido. Por ejemplo, incorporaremos nuevos campos para seleccionar el grado de precisión del aprendizaje, el nivel de paralelismo en los cálculos en ParetoLib u otras elecciones posibles desde el código fuente en Python. Por otro lado, actualmente STLEval sólo soporta interpolación constante para rellenar el espacio entre dos puntos de la muestra. Como trabajo futuro, se plantea enriquecer dicha herramienta para soportar nuevos tipos de interpolación (p.ej., lineal, polinomial, splines, etc.). Esto abre la posibilidad de desarrollar nativamente nuevos tipos de operadores lógicotemporales que permitan realizar predicciones sobre el futuro en base a unas señales ya conocidas y recogidas del artefacto que queramos monitorizar (aproximación mediante series de Taylor, análisis estadístico de las trazas u otros métodos de aprendizaje). Un prototipo de nuevo operador lógico-temporal sería el operador probabilidad o Pr∼λφ , donde ∼∈ {< ,≤,≥, >} y λ∈[0,1] . En siguiente lugar, la implementación de un procesador de lenguaje natural facilitará la escritura de expresiones en STL en un formato más agradable para usuarios no experimentados. En una primera aproximación, simplemente reescribirá las ecuaciones en un formato más legible (p. ej. F G (v > 120) en lugar de (F(G(> v 120)) ) para posteriormente permitir en futuras versiones redactar propiedades del estilo En el futuro, la propiedad X se cumple . Por último, reimplementar el núcleo de ParetoLib aumentará las prestaciones computacionales de la biblioteca. Python ofrece mecanismos para compilar el código fuente en lugar de interpretarlo, lo que aumentaría el rendimiento de la librería de minería. La mejora sería mínima (ParetoLib llama a STLeval para la mayoría de los cálculos, y STLeval está en C++), pero el incremento del rendimiento al compilar Python nos ayudaría a ahorrar unos pocos milisegundos. Capítulo 6 Conclusions and future work To nish this project, we present some conclusions on the topics covered, both theoretical and practical, and we discuss some ideas that are conducive to the improvement and continuity of the project. 6.1. Conclusions This project has aimed to improve the analysis capabilities of the tools for the verication of cyber-physical systems at runtime. To do this, we have used temporal logic as a formalism to specify the properties that the system must satisfy. In particular, we have used Signal Temporal Logic (STL), a type of temporal logic focused on the analysis of analog signals coming from physical sensors (i.e., speed or temperature). Among the most relevant results in this project, we have managed to extend the capabilities of STL temporal logic to express properties that involve trends (derivatives), or accumulations (integrals). We have implemented these new logical operators in the current verication software tools, mainly in the STLEval tool. Along with STLEval, we have also taken care of the ParetoLib library, a mining library that learns (in)valid congurations of the monitored system, expressed as templates or parametric specications in STL. ParetoLib internally interfaces with STLEval to perform calculations, so it has received an update to the STLEval binaries and DLLs that it packages together with the rest of the library to support the new derivation and integration operations. Lastly, we have provided a friendly user interface that makes it easy to interact both with the learning library and indirectly with the STLEval tool. The graphical interface abstracts the complexity of invoking STLEval via the command line, or via Python source code in the case of ParetoLib (source code 3.1), as has been the case up until now. The 27 28 CAPÍTULO 6. CONCLUSIONS AND FUTURE WORK graphical interface summarizes most of the conguration options of the verication tool and the mining algorithm. Finally, we would like to emphasize the arduous eort made in the documentation and previous bibliographical research for the acquisition of the necessary knowledge for the elaboration of the results presented in these conclusions. 6.2. Future work As future work, we propose the following extensions or improvements. On the one hand, we propose to include more options in the graphical user interface that allow us to congure additional parameters of the verication and mining tools and that have been omitted until now. For example, we will incorporate new elds to select the degree of precision of the learning, the level of parallelism in the calculations in ParetoLib or other possible choices from the source code in Python. On the other hand, currently STLEval only supports constant interpolation to ll the space between two sample points. As future work, it is proposed to enrich this tool to support new types of interpolation (i.e. linear, polynomial, splines, etc.). This opens the possibility of natively developing new types of logical-temporal operators that allow making predictions about the future based on already known signals collected from the artefact that we want to monitor (Taylor series approximation, statistical analysis of the traces or other learning methods). A prototype of a new logical-temporal operator would be the operator probability or Pr∼λφ , where ∼∈ {<, ≤,≥, >} and λ∈[0,1] . Next, implementing a natural language processor will make it easier to write expressions in STL in a more pleasing format for inexperienced users. As a rst approximation, it will simply rewrite the equations in a more readable format (i.e. F G (v > 120) instead of (F(G(> v 120)) ) to later allow in future versions write properties of the style In the future, property X is true . Lastly, reimplementing the core of ParetoLib will increase the computational performance of the library. Python oers mechanisms to compile the source code instead of interpreting it, which would increase the performance of the mining library. The improvement would be minimal (ParetoLib calls STLeval for most calculations, and STLeval is in C++), but the performance boost when compiling Python would help us save a few milliseconds. Bibliografía [1] Alexey Bakhirkin y Nicolas Basset. Specication and Ecient Monitoring Beyond STL. En: Tools and Algorithms for the Construction and Analysis of Systems - 25th International Conference, TACAS 2019, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019, Prague, Czech Republic, April 6-11, 2019, Proceedings, Part II . Ed. por Tomás Vojnar y Lijun Zhang. Vol. 11428. Lecture Notes in Computer Science. Springer, 2019, págs. 79-97. doi : 10.1007/978-3-030- 17465-1\_5 . url : https://doi.org/10.1007/978-3-030-17465-1\_5 . [2] Alexey Bakhirkin, Akshay Mambakam y José-Ignacio Requeno Jarabo. StlEval . VERIMAG Git Repository. Ver. 2.X. 2022. url : {https://gricad-gitlab.univ-grenoble- alpes.fr/verimag/tempo/StlEval} . [3] Alexey Bakhirkin y col. ParetoLib: A Python Library for Parameter Synthesis. En: Formal Modeling and Analysis of Timed Systems - 17th International Conference, FORMATS 2019, Amsterdam, The Netherlands, August 27-29, 2019, Proceedings . Ed. por Étienne André y Mariëlle Stoelinga. Vol. 11750. Lecture Notes in Computer Science. Springer, 2019, págs. 114-120. doi : 10.1007/978-3-030-29662-9\_7 . url : https: //doi.org/10.1007/978-3-030-29662-9\_7 . [4] Nicolas Basset y col. Learning Specications for Labelled Patterns. En: Formal Modeling and Analysis of Timed Systems - 18th International Conference, FORMATS 2020, Vienna, Austria, September 1-3, 2020, Proceedings . Ed. por Nathalie Bertrand y Nils Jansen. Vol. 12288. Lecture Notes in Computer Science. Springer, 2020, págs. 76-93. doi : 10.1007/978-3-030-57628-8\_5 . url : https://doi.org/10.1007/978-3-030- 57628-8\_5 . [5] Ali Tevk Buyukkocak, Derya Aksaray y Yasin Yazicioglu. Control Synthesis using Signal Temporal Logic Specications with Integral and Derivative Predicates. En: 2021 American Control Conference, ACC 2021, New Orleans, LA, USA, May 25-28, 2021 . IEEE, 2021, págs. 4873-4878. doi : 10.23919/ACC50511.2021.9482651 . url : https://doi.org/10.23919/ACC50511.2021.9482651 . 29 30 BIBLIOGRAFÍA [6] Yliès Falcone y col. A taxonomy for classifying runtime verication tools. En: Int. J. Softw. Tools Technol. Transf. 23.2 (2021), págs. 255-284. doi : 10.1007/s10009-021- 00609-z . url : https://doi.org/10.1007/s10009-021-00609-z . [7] Oded Maler y Dejan Nickovic. Monitoring temporal properties of continuous signals. En: Formal Techniques, Modelling and Analysis of Timed and Fault-Tolerant Systems . Springer, 2004, págs. 152-166. [8] Akshay Mambakam y José-Ignacio Requeno Jarabo. ParetoLib . VERIMAG Git Repository. Ver. 2.X. 2022. url : {https://gricad-gitlab.univ-grenoble-alpes.fr/ verimag/tempo/multidimensional_search} . [9] Dejan Nickovic y col. AMT 2.0: qualitative and quantitative trace analysis with extended signal temporal logic. En: Int. J. Softw. Tools Technol. Transf. 22.6 (2020), págs. 741-758. doi : 10.1007/s10009-020-00582-z . url : https://doi.org/10.1007/ s10009-020-00582-z .