Safety critical system model conversion method, device and system for SCR
Through the SS model flattening algorithm and ANTLR syntax file processing, the SCR model of the safety-critical system was successfully converted into the NuXMV model, which solved the problem that existing technology cannot directly convert and realized the possibility of safety analysis and verification.
Patent Information
- Application Number
- CN202010992819.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-21
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-09-21
AI Technical Summary
The existing technology cannot directly convert the SCR model of safety-critical systems into the NuXMV model, resulting in the inability to perform safety analysis and verification.
Use SS model flattening algorithm to eliminate recursive definitions, write ANTLR grammar files to obtain abstract syntax trees, design conversion rules and algorithms, and convert SS models into NuXMV models.
It realizes the direct conversion of safety-critical systems from SCR model to NuXMV model, and can conduct security analysis through model checking tools to verify the correctness of the system.
Smart Images

Figure CN112115615B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of safety-critical system modeling and model conversion, and in particular to a safety-critical system model conversion method, device and system for SCR. Background Art
[0002] T-VEC is a tool for demand design and demand modeling based on the SCR method in the four-variable model. It uses tabular expressions to replace formal mathematical symbols with mode transition tables, condition tables, and event tables to describe the different values of state variables in different modes, conditions, and states of the system, and express the logical relationship of system state migration, thereby achieving a formal description of system behavior. The T-VEC language defines a system model format that is demand-centric and expressed in tabular expressions. It saves the model in a file format with a .SS suffix. The T-VEC abstract demand model is called an SS model. Each SS model contains multiple SS files. Each intermediate variable and output variable with constraints and positive output is saved as a .SS file. Each .SS file contains a system definition variable and multiple system control constraint statements. For different system control constraints, the system definition variable has different values.
[0003] NuXMV is a traditional symbolic model checker. NuXMV is an extension of SMV, which is the first BDD-based model checker. After functional expansion and re-implementation, NuXMV added a verification engine based on the SAT algorithm, which can perform formal verification on finite and infinite state systems. NuXMV's model modeling language XMV models the system by describing the state transition of the finite state machine Finite State Machine (FSM) and the infinite state system, and uses state transition to define the change of system variable values triggered by events. NuXMV defines a model form that describes the system operation process based on the system state and uses state transition. It saves the model in a single file format with the suffix .SMV. For convenience, the abstract requirement model that NuXMV needs to input is called an XMV model below. An XMV model consists of a main module (MODULE) and several sub-modules. The modules are associated by variable parameters. The sub-modules can be nested and iterated with each other, and can be reused multiple times. Finally, they are all called separately by the main module. Unlike the SS model, the XMV model is state-driven, and the state migration reflects the dynamic behavior of the model. The state consists of the smallest unit state variable (VAR). In the XMV model, the ASSIGN statement is used to enter the state transition and define the state variable assignment; INIT represents the initial assignment of the newly introduced state variable; NEXT represents the variable value of the next state under the current state constraint.
[0004] ANTLR4 (Another Tool for Language Recognition) is an open source parser generation tool. The parser generation tool can generate parsers based on special domain languages, solving the problem of complex and time-consuming handwritten parsers. ANTLR4 evolved from the extension of the ANTLR tool, which was first developed by Professor Terence Parr of the University of San Francisco. It provides parsers for building frameworks, languages, and traversing parse trees. ANTLR4 supports reading, processing, executing or translating structured text or binary files. ANTLR4 lexical rules are described by regular expressions, and the grammatical structure is precisely defined as the extended Backus-Naur form (E-BNF) to eliminate left recursion. ANTLR4 reads the character stream of the input lexical file, clusters the characters into words and symbols (Token); parses the grammar file and recognizes the grammar structure, and finally generates a grammar analysis tree for each input model. The ANTLR4 grammar program parser constructs a grammar analysis tree based on the grammar file (grammer.g4). The grammar tree is parsed recursively from top to bottom. Its root node is the start of the serialized statement, which contains the file structure of all situations described in the grammar file. Its child nodes are all the recursive phrase names that make up the file structure. The leaf nodes at the bottom are the specific words corresponding to the phrase names in the instance.
[0005] For the construction of safety analysis models for safety-critical systems, SS models are currently created directly based on the requirements. However, since the SS model is a variable relationship model, the constraint relationship between system variables is described using table expressions to build the system model. Therefore, the SS model has the recursive, nested and discrete nature of variable definition, and cannot be directly used for safety analysis. Therefore, a method is urgently needed to transform the safety-critical system from the SCR model to the NuXMV model. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides a safety-critical system model conversion method, device and system for SCR, which can realize the direct conversion of the safety-critical system from the SCR model to the NuXMV model. Since the converted NuXMV file is a state machine-based model, safety analysis can be performed through model checking tools to check the consistency and completeness of the requirement model and verify the correctness of the system.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A safety critical system model conversion method for SCR, the conversion method comprising the following steps:
[0009] S1, according to the pre-designed SS model flattening algorithm, the recursive definition of the imported SS model is eliminated to obtain the flattened SS model;
[0010] S2, write the ANTLR grammar file of the flattened SS model and obtain the corresponding abstract syntax tree;
[0011] S3, combined with the flattening result of the SS model, designs the conversion rules and the corresponding conversion algorithm, uses the abstract syntax tree obtained in step S2 to build a node traverser, and converts the flattened SS model obtained in step S1 into the corresponding NuXMV model.
[0012] To optimize the above technical solutions, the specific measures taken also include:
[0013] Furthermore, in step S1, the process of eliminating the recursive definition of the imported SS model according to the pre-designed SS model flattening algorithm to obtain the flattened SS model includes the following steps:
[0014] S11, obtain all tree model units that express variable constraints in the SS model; abstract each variable containing constraint definitions upward into a basic model unit, where:
[0015] (1) ITO unit: an interpretable variable unit with input, intermediate, and output constraints;
[0016] (2) IT unit: an interpretable variable unit with input and intermediate constraints;
[0017] (3) IO unit: an interpretable variable unit with input and output constraints;
[0018] (4)TO unit: an interpretable variable unit with intermediate and output constraints;
[0019] (5) T-unit: basic unit with only intermediate constraints;
[0020] (6) O unit: basic unit with output constraints only;
[0021] (7) I unit: basic unit with input constraints only;
[0022] S12, flattening each tree model unit expressing variable constraints to the lower layer, traversing each branch of the tree model unit, and performing a deep search on each branch until the unit and the complex units under the unit are decomposed into basic units, wherein the basic units include I units, T units, and O units;
[0023] S13, simplifying the T unit and the O unit into a group of I units, so that the tree model unit is finally flattened downward and simplified into an I basic unit group, that is, from the SS model point of view, the complex variable constraint relationship containing recursion and nesting is converted into a group containing only input variable constraint relationships.
[0024] Furthermore, in step S2, the process of writing the ANTLR grammar file of the flattened SS model and obtaining the corresponding abstract syntax tree includes the following steps:
[0025] S21, constructing an ANTLR grammar parsing file of the SS model using the metalanguage of ANTLR according to the grammar description file of the SS model, and obtaining the lexical and grammar parser of the SS model by running the built-in method of ANTLR;
[0026] S22, input the SS model instance into the lexical and grammatical parser to obtain the corresponding syntax tree.
[0027] Further, in step S3, the conversion rule includes:
[0028]
[0029]
[0030]
[0031]
[0032]
[0033] Where: T Basic Indicates the basic type, T Custom Represents a custom type, T XMV Represents the type in the XMV model, C represents the declaration of constants in the SS model, Statecon and They represent the state constant and constant value in the XMV model respectively, I and TO represent the atomic unit and complex unit in the SS model respectively, IVAR and VAR represent the input variables and state variables in the XMV model respectively, LS represents the logical structure set in the SS model, C represents the constraint set in the XMV model, f(ρ)=value represents the output assignment function in the SS model, where ρ represents the logical structure and value represents the variable value; next represents the assignment process of the XMV model state transition.
[0034] Further, in step S3, the corresponding conversion algorithm includes the following steps:
[0035] S31, type conversion:
[0036] For the basic types in the SS model, directly map them to the basic types in the XMV model, and expand the value range upward; for the numeric custom types in the SS model, convert them to the basic types in the XMV model; for the character custom types in the SS model, convert them to the enumeration types in the XMV;
[0037] S32, constant conversion:
[0038] Directly map the constant declarations in the SS model to the state constant assignment statements in the XMV model;
[0039] S33, variable conversion:
[0040] The intermediate variables of the SS model are divided into two categories: one is the intermediate variables and output variables that can be decomposed downward, namely the complex unit TO, and the other is the input variables that cannot be decomposed downward, namely the atomic unit I;
[0041] Map the declaration TO of the complex unit to the state variable declaration statement in the XMV model, and map the declaration of the atomic unit I to the input variable declaration statement in the XMV model;
[0042] S34, constraint conversion:
[0043] Assume that the SS model uses the logical structure LS to define the constraint relationship between variables, and one logical structure describes one constraint relationship; in the XMV model, use the DEFINE keyword to make a macro definition declaration to define the constraint name and the corresponding constraint relationship;
[0044] Based on the above settings, the logical structure set in the SS model is converted into a constraint set in the XMV model;
[0045] S35, output assignment conversion:
[0046] In the SS model, the input is expressed as conditional choices, and for each logical structure, the output variable has a corresponding output value;
[0047] After converting it into an XMV model, in the converted XMV model, the next state assignment keyword NEXT is used to describe the assignment relationship, and the conditional selection keyword CASE is used to describe that for different constraint macro definitions, the assignment of the state variable to the next state has different values.
[0048] The present invention also provides a safety critical system model conversion device for SCR, the conversion device comprising:
[0049] A module for eliminating the recursive definition of the imported SS model according to a pre-designed SS model flattening algorithm to obtain the SS model after flattening;
[0050] A module used to write the ANTLR grammar file of the flattened SS model and obtain the corresponding abstract syntax tree;
[0051] It is used to combine the flattening results of the SS model, design the conversion rules and the corresponding conversion algorithm, use the obtained abstract syntax tree to build a node traverser, and convert the flattened SS model into the corresponding NuXMV model module.
[0052] The present invention also relates to a safety critical system model conversion system for SCR, the conversion system comprising a memory and a processor;
[0053] The memory stores a computer program, and the processor is used to run the computer program stored in the memory to execute the SCR-oriented safety critical system model conversion method as described above.
[0054] The beneficial effects of the present invention are:
[0055] (1) It is possible to directly convert the safety-critical system from the SCR model to the NuXMV model. Since the converted NuXMV file is a state machine-based model, the model checking tool can be used to perform safety analysis, check the consistency and completeness of the requirement model, and verify the correctness of the system.
[0056] (2) The SS model flattening algorithm and conversion algorithm proposed in the present invention are created in combination with the characteristics of the SS model and have a certain degree of universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flow chart of the SCR-oriented safety critical system model conversion method of the present invention.
[0058] Figure 2 It is a flow chart of a conversion method according to one example of the present invention.
[0059] Figure 3 It is a schematic diagram of the simplified flattening process of the SS model unit of the present invention.
[0060] Figure 4 It is a pseudo code diagram of variable constraint flattening of the present invention.
[0061] Figure 5 It is the variable conversion rule diagram of the present invention.
[0062] Figure 6 It is the constraint transformation rule diagram of the present invention.
[0063] Figure 7 It is the output conversion rule diagram of the present invention. DETAILED DESCRIPTION
[0064] The present invention will now be described in further detail with reference to the accompanying drawings.
[0065] It should be noted that the terms such as "upper", "lower", "left", "right", "front", "back", etc. cited in the invention are only for the convenience of description and are not used to limit the scope of implementation of the present invention. Changes or adjustments in their relative relationships should be regarded as the scope of implementation of the present invention without substantially changing the technical content. Specific embodiment 1
[0067] Combination Figure 1 The present invention relates to a safety critical system model conversion method for SCR, the conversion method comprising the following steps:
[0068] S1, according to the pre-designed SS model flattening algorithm, the recursive definition of the imported SS model is eliminated to obtain the flattened SS model.
[0069] S2, write the ANTLR grammar file of the flattened SS model and obtain the corresponding abstract syntax tree.
[0070] S3, combined with the flattening result of the SS model, designs the conversion rules and the corresponding conversion algorithm, uses the abstract syntax tree obtained in step S2 to build a node traverser, and converts the flattened SS model obtained in step S1 into the corresponding NuXMV model.
[0071] The present invention mainly solves the problem of converting from SS model to NuXMV model. In order to solve this problem, the present invention mainly includes three parts. First, design and implement the algorithm of flattening SS model to eliminate the recursive definition of SS model. Second, write the ANTLR grammar file of the flattened SS model to obtain the corresponding abstract syntax tree. Third, design and define conversion rules, and design the corresponding conversion algorithm, use the generated syntax tree to build a node traverser, and convert the input flattened SS model into NuXMV model. Figure 2 It is a flow chart of a conversion method according to one example of the present invention.
[0072] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings.
[0073] In the first part, we design and implement the algorithm for flattening the SS model to eliminate the recursive definition of the SS model. The SS model contains two configuration files, coreRTS.SS and runTimeData.SS, and multiple intermediate and output variable definition files. The configuration files describe the definition of all basic types, the value range of the basic type, and the transfer definition between user-defined types and basic types. The variable definition file uses the condition table, event table, pattern class, etc. in the model to describe the state transition in the model, reflecting the dynamic nature of the model behavior.
[0074] Because there is recursive nesting between the variable constraints in the SS model, each variable containing constraint definitions is abstracted upward into a basic model unit, where:
[0075] (1) ITO unit: an interpretable variable unit with input, intermediate, and output constraints;
[0076] (2) IT unit: an interpretable variable unit with input and intermediate constraints;
[0077] (3) IO unit: an interpretable variable unit with input and output constraints;
[0078] (4)TO unit: an interpretable variable unit with intermediate and output constraints;
[0079] (5) T-unit: basic unit with only intermediate constraints;
[0080] (6) O unit: basic unit with output constraints only;
[0081] (7) I unit: basic unit with input constraints only;
[0082] The variable relationship flattening simplification method proposed in this paper is as follows Figure 3 As shown, each tree model unit that expresses variable constraints is flattened to the lower layer, and each branch of this complex model unit is traversed. Each branch is deeply searched until the unit and the complex units under the unit are decomposed into basic units (I, T, O), and then the T and O units are simplified into a group of I units. At this point, a complex unit is flattened downward to be simplified into an I basic unit group, that is, from the SS model, a complex variable constraint relationship containing recursion and nesting is converted into a group containing only input variable constraint relationships. The variable constraint flattening pseudo code is as follows Figure 4 shown.
[0083] The second part is to write the ANTLR grammar file of the flattened SS model and obtain the corresponding abstract syntax tree. Through the grammar description file of the SS model, the ANTLR grammar parsing file of the SS model is constructed using the metalanguage of ANTLR. By running the built-in method of ANTLR, the lexical and grammatical parsers of the SS model are obtained. By inputting a certain SS model instance, the corresponding syntax tree can be obtained.
[0084] The third part is to design conversion rules, write algorithms, traverse the syntax tree, and convert the SS model into the XMV model according to the five defined conversion rules. The specific conversion rules are as follows:
[0085]
[0086]
[0087]
[0088]
[0089]
[0090] The following precise definition is given: T Basic Indicates the basic type, T Custom Represents a custom type, T XMV Represents the type in the XMV model, C represents the declaration of constants in the SS model, Statecon and Respectively represent the state constant and constant value in the XMV model, I and TO represent the atomic unit and complex unit in the SS model, IVAR and VAR represent the input variable and state variable in the XMV model, LS represents the logical structure set in the SS model, C represents the constraint set in the XMV model, f(ρ)=value represents the output assignment function in the SS model, where ρ represents the logical structure and value represents the variable value; next represents the assignment process of the XMV model state transition. According to each part of the conversion algorithm, the specific steps of the conversion are given below.
[0091] Step 1: Type conversion. The types of the SS model are divided into basic types and custom types. For basic types, they can be directly mapped to the basic types in the XMV model, and the value range is expanded upward; custom types are divided into numeric types and character types. Numeric custom types are converted to their basic types, and character custom types are converted to enumeration types in XMV.
[0092] Step 2: Constant conversion. The constant declaration in the SS model can be directly mapped to the state constant assignment statement in the XMV model.
[0093] Step 3: Variable conversion. Divide the variables in the SS model into two categories: one is the intermediate variables and output variables that can be decomposed downward (i.e., complex units TO), and the other is the input variables that cannot be decomposed downward (i.e., atomic units I). The declaration of complex units is mapped to the state variable declaration statement in the XMV model, and the declaration of atomic units is mapped to the input variable declaration statement in the XMV model. Figure 5 It is the variable transformation rule diagram.
[0094] Step 4: Constraint conversion. In the SS model, the logical structure LS is used to define the constraint relationship between variables, and one logical structure describes one constraint relationship. In the XMV model, the DEFINE keyword is used to make a macro definition declaration to define the constraint name and the corresponding constraint relationship. Constraint conversion is to convert the logical structure set in the SS model into the constraint set in the XMV model. Figure 6 is the constraint transformation rule graph.
[0095] Step 5: Output assignment conversion. In the SS model, the input is expressed as a conditional selection. For each logical structure, the output variable has a corresponding output value. In the XMV model, the next state assignment keyword NEXT is used to describe the assignment relationship, and the conditional selection keyword CASE is used to describe that for different constraint macro definitions, the state variable has different values for the next state assignment. Figure 7 is the output transformation rule graph. Specific embodiment 2
[0097] According to the steps of the present invention described above, the specific model conversion steps are as follows:
[0098] Step 1: Use the SCR method to model the system requirements into an SS model, preprocess the description file of the SS model, delete the comments, and standardize the format. Build the system SS model according to the input and output requirements of the system requirements. Use the ATTRIBUTE key statement annotation in the description file of the SS model, recursively traverse the syntax tree that has been established according to the model grammar, search for the comment keywords, and leave the comment statements empty. With the help of ANTLR4, adjust the legality of the SS model characters, standardize the format, and complete the file preprocessing.
[0099] Step 2: Determine the decomposability of each layer of variable constraints and classify the constraints. outputVarConstraint, termVarConstraint, and inputVarConstraint represent the output variable constraint (O basic unit) set, intermediate variable constraint (T basic unit), and input variable constraint (I atomic unit) set in a complex unit of the input file, respectively. When flattening, first determine for each O unit in the output variable constraint set whether this O unit is a complex unit and whether there are other T and O units. If so, recurse downward and flatten this O unit. Deeply traverse all I units on this branch of the O unit and add them to the inputVarConstraint set. If not, add the atomic constraints contained in this O unit to the inputVarConstraint set as the recursive exit.
[0100] Step 3: Deeply traverse and find each atomic constraint, flatten and reconstruct the constraint relationship, and output the intermediate file and the flattened model file. For each T unit in the intermediate variable constraint set, flatten and simplify each T unit into an atomic constraint, add the atomic constraint set, and write the constraint information of the T unit into a termxml file, where the constraint information includes the variable name varname, other dependent variables importvar, and related constraints cons. Finally, write the inputVarConstraint set describing all atomic constraints into the Modelname.pSS file to complete the flattened and simplified file output.
[0101] Step 4: Convert the types in the flattened model. Classify data types into basic types and custom types. The conversion rules of basic types are defined in the basictype hash table, and the conversion rules correspond one to one. The basic types and the initial values of the basic types are defined in the basicinit hash table. Custom types are stored separately from basic types. Custom types can be divided into two categories: one is a custom type based on an enumeration basic type, and the other is a basic type based on a numeric type. The type names of these two categories are in the data_element_name node. After determining whether the custom type is an enumeration type, the classification obtains the value range and pushes it into the stack.
[0102] Step 5: Convert the constants in the flattened model. First, traverse the leaf nodes of the syntax tree to obtain the constants in the model and store them in the constant hash table constant, where key is the constant name and value is the constant value. Then, write the constant declarations into the file in order according to the defined conversion format.
[0103] Step 6: Convert the variables in the flattened model. The flattened SS model contains the constraints between complex variables and atomic variables. Traverse the syntax tree and build a variable hash table Var, where the key is the variable name and the value is the decomposability of the variable. Convert the variable declaration, the variable Var table, and determine whether it is an atomic unit based on the value of each element. If so, convert it to the definition statement of the input variable, otherwise, convert it to the definition statement of the state variable.
[0104] Step 7: Convert the constraint definitions in the flattened model. The conversion process of constraint declarations is bottom-up. After obtaining the bottom-level constraint nodes, perform logical conversion on the constraints within the nodes. Replace "AND", "OR" and "NOT" with logical symbols "&", "|" and "!", and then convert the constraints between nodes. First, determine whether there are sibling nodes. If not, submit all constraints upward to the parent node, and then perform constraint conversion on the parent node; if it exists, convert the node "AND" and "OR" constraints to logical symbols, and then submit the conversion upward until the top-level node of the constraint ends. Finally, use the DEFINE keyword to name the constraint.
[0105] Step 8: Convert the output assignment statements in the flattened model. For each output variable, use a corresponding hash table assignmMap to save the constraint macro definition of this variable that has been converted in the previous step, where key is the macro definition name and value is the value of the output variable under this constraint macro definition. According to the conversion rules, use the next and case keywords to reconstruct the output assignment.
[0106] Step 9: Normalize the converted XMV model format and write it into the xmv file with the corresponding name to complete the model conversion.
[0107] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A safety-critical system model conversion method for SCR, It is characterized in that The conversion method comprises the following steps: S1, according to the pre-designed SS model flattening algorithm, the recursive definition of the imported SS model is eliminated to obtain the flattened SS model; S11, obtain all tree-shaped model units that express variable constraints in the SS model; abstract each variable containing constraint definitions upward into a basic model unit; The basic unit of the model includes: ITO unit: Interpretable variable unit with input, intermediate and output constraints; IT unit: an interpretable variable unit with input and intermediate constraints; IO unit: an interpretable variable unit with input and output constraints; TO unit: an interpretable variable unit with intermediate and output constraints; T-element: basic element with only intermediate constraints; O unit: basic unit with output constraints only; I unit: basic unit with input constraints only; S12, flattening each tree model unit expressing variable constraints to the lower layer, traversing each branch of the tree model unit, and performing a deep search on each branch until the unit and the complex units under the unit are decomposed into basic units, wherein the basic units include I units, T units, and O units; S13, simplifying T units and O units into a group of I units, so as to finally flatten and simplify the tree model units downward into an I basic unit group, that is, from the perspective of the SS model, converting the complex variable constraint relationship containing recursion and nesting into a group containing only input variable constraint relationships; S2, write the ANTLR grammar file of the flattened SS model and obtain the corresponding abstract syntax tree; S3, combining the flattening result of the SS model, designing the conversion rules and the corresponding conversion algorithm, using the abstract syntax tree obtained in step S2, constructing a node traverser, and converting the flattened SS model obtained in step S1 into the corresponding NuXMV model; The conversion rules include: Where: T Basic Indicates the basic type, T Custom Represents a custom type, T XMV Represents the type in the XMV model, C represents the declaration of constants in the SS model, Statecon and They represent the state constant and constant value in the XMV model, I and TO represent the atomic unit and complex unit in the SS model, IVAR and VAR represent the input variable and state variable in the XMV model, respectively. i Represents the logical structure set in the SS model, C i represents the constraint set in the XMV model, f(ρ)=value represents the output assignment function in the SS model, where ρ represents the logical structure and value represents the variable value; next represents the assignment process of the XMV model state transition; The corresponding conversion algorithm includes the following steps: S31, type conversion: For the basic types in the SS model, directly map them to the basic types in the XMV model, and expand the value range upward; for the numeric custom types in the SS model, convert them to the basic types in the XMV model; for the character custom types in the SS model, convert them to the enumeration types in the XMV; S32, constant conversion: Directly map the constant declarations in the SS model to the state constant assignment statements in the XMV model; S33, variable conversion: The intermediate variables of the SS model are divided into two categories: one is the intermediate variables and output variables that can be decomposed downward, namely the complex unit TO, and the other is the input variables that cannot be decomposed downward, namely the atomic unit I; Map the declaration of complex unit TO to the state variable declaration statement in the XMV model, and map the declaration of atomic unit I to the input variable declaration statement in the XMV model; S34, constraint conversion: Assume that the SS model uses the logical structure LS to define the constraint relationship between variables, and one logical structure describes one constraint relationship; in the XMV model, use the DEFINE keyword to make a macro definition declaration to define the constraint name and the corresponding constraint relationship; Convert the logical structure set in the SS model into the constraint set in the XMV model; S35, output assignment conversion: In the SS model, the input is expressed as conditional choices, and for each logical structure, the output variable has a corresponding output value; After converting it into an XMV model, in the converted XMV model, the next state assignment keyword NEXT is used to describe the assignment relationship, and the conditional selection keyword CASE is used to describe that for different constraint macro definitions, the assignment of the state variable to the next state has different values.
2. The SCR-oriented safety critical system model conversion method according to claim 1, It is characterized in that In step S2, the process of writing the ANTLR grammar file of the flattened SS model and obtaining the corresponding abstract syntax tree includes the following steps: S21, constructing an ANTLR grammar parsing file of the SS model using the metalanguage of ANTLR according to the grammar description file of the SS model, and obtaining the lexical and grammar parser of the SS model by running the built-in method of ANTLR; S22, input the SS model instance into the lexical and grammatical parser to obtain the corresponding syntax tree.
3. A safety-critical system model conversion device for SCR, It is characterized in that Used to execute the SCR-oriented safety critical system model conversion method according to any one of claims 1 to 2; the conversion device comprises: A module for eliminating the recursive definition of the imported SS model according to a pre-designed SS model flattening algorithm to obtain the SS model after flattening; A module used to write the ANTLR grammar file of the flattened SS model and obtain the corresponding abstract syntax tree; It is used to combine the flattening results of the SS model, design conversion rules and corresponding conversion algorithms, use the obtained abstract syntax tree to build a node traverser, and convert the flattened SS model into the corresponding NuXMV model module.
4. A safety-critical system model conversion system for SCR, It is characterized in that The conversion system includes a memory and a processor; The memory stores a computer program, and the processor is used to run the computer program stored in the memory to execute the SCR-oriented safety-critical system model conversion method described in any one of claims 1-2.
