Requirements-driven Slicing of Simulink Models Using LLMs

Dipeeka Luitel,Shiva Nejati,Mehrdad Sabetzadeh
2024-05-03
Abstract:Model slicing is a useful technique for identifying a subset of a larger model that is relevant to fulfilling a given requirement. Notable applications of slicing include reducing inspection effort when checking design adequacy to meet requirements of interest and when conducting change impact analysis. In this paper, we present a method based on large language models (LLMs) for extracting model slices from graphical Simulink models. Our approach converts a Simulink model into a textual representation, uses an LLM to identify the necessary Simulink blocks for satisfying a specific requirement, and constructs a sound model slice that incorporates the blocks identified by the LLM. We explore how different levels of granularity (verbosity) in transforming Simulink models into textual representations, as well as the strategy used to prompt the LLM, impact the accuracy of the generated slices. Our preliminary findings suggest that prompts created by textual representations that retain the syntax and semantics of Simulink blocks while omitting visual rendering information of Simulink models yield the most accurate slices. Furthermore, the chain-of-thought and zero-shot prompting strategies result in the largest number of accurate model slices produced by our approach.
Software Engineering
What problem does this paper attempt to address?
### Problems Addressed by the Paper This paper aims to address the issue of automatically extracting requirement-based submodels (model slices) from Simulink models to simplify the design review process and improve verification efficiency. Specifically: 1. **Background of the Requirement**: In the certification processes of critical fields such as aerospace, railway, maritime, and automotive, detailed review of design models is required to ensure they meet stringent safety requirements. This process is complex and prone to errors, especially when reviewers need to identify parts of a large model related to specific safety requirements. 2. **Simulink Models**: Simulink is a commonly used modeling tool for constructing and simulating dynamic systems. Ensuring that Simulink models meet safety requirements is a time-consuming process because the entire model needs to be checked to verify whether a particular requirement is met, while in reality, only a small part of the model may be relevant to this requirement. 3. **Model Slicing Method**: The paper proposes a method based on large language models (LLMs) by converting Simulink models into textual representations and using LLMs to identify the Simulink modules required to meet specific requirements, thereby generating reasonable model slices. This method can reduce the complexity of understanding and analyzing the entire model, making it easier to verify whether the system meets safety requirements. The main contribution of the paper lies in exploring the impact of different granularity levels of textual representation and different prompting strategies on the accuracy of slice generation. It was found that a medium-granularity representation, which retains the syntax and semantic information of Simulink modules but excludes visual rendering information, can produce the most accurate slices. Additionally, combining chain-of-thought and zero-shot prompting strategies, this method can generate more accurate model slices.