Formal Simulation and Visualisation of Hybrid Programs

Pedro Mendes,Ricardo Correia,Renato Neves,José Proença
DOI: https://doi.org/10.4204/EPTCS.411.2
2024-11-22
Abstract:The design and analysis of systems that combine computational behaviour with physical processes' continuous dynamics - such as movement, velocity, and voltage - is a famous, challenging task. Several theoretical results from programming theory emerged in the last decades to tackle the issue; some of which are the basis of a proof-of-concept tool, called Lince, that aids in the analysis of such systems, by presenting simulations of their respective behaviours. However being a proof-of-concept, the tool is quite limited with respect to usability, and when attempting to apply it to a set of common, concrete problems, involving autonomous driving and others, it either simply cannot simulate them or fails to provide a satisfactory user-experience. The current work complements the aforementioned theoretical approaches with a more practical perspective, by improving Lince along several dimensions: to name a few, richer syntactic constructs, more operations, more informative plotting systems and errors messages, and a better performance overall. We illustrate our improvements via a variety of examples that involve both autonomous driving and electrical systems.
Systems and Control,Programming Languages
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the limitations of the existing tool Lince when dealing with hybrid systems. Specifically, as a proof - of - concept tool, Lince has the following problems when dealing with practical application scenarios (such as autonomous driving and electrical systems): 1. **Poor usability**: Lince lacks basic functions and is unable to handle a wide range of important scenarios. Especially when it comes to practical problems such as autonomous driving, it either fails to simulate these scenarios or provides a poor user experience. 2. **Limited operation**: The original version of Lince lacks the arithmetic operations required to handle basic tasks, such as square root, trigonometric functions, etc., which makes many practical problems unsolvable. 3. **Insufficient numerical methods**: Previous versions of Lince used accurate but poorly scalable methods to solve ordinary differential equations (ODEs), resulting in its inability to simulate standard hybrid programming scenarios. 4. **Limited visualization mechanism**: The visualization component of Lince can only show the behavior at a single time point and cannot well represent the trajectories in multi - dimensional space or the overall behavior under different initial conditions. To solve these problems, the paper proposes improvements to Lince, specifically including the following aspects: - **Expand basic operations**: Standard arithmetic operations such as division, trigonometric functions and square root extraction are added, and the operational semantics are extended to support the possibility of failure of some operations. - **Improve numerical methods**: A numerical solver is integrated. Although a certain degree of accuracy is sacrificed, the scalability and application range are improved. - **Enhance the visualization mechanism**: The visualization component is improved so that it can better represent the trajectories in multi - dimensional space and the system behavior under different initial conditions. Through these improvements, Lince can now handle complex hybrid system problems more effectively while maintaining its simplicity and theoretical basis.