Automatic generation method for verification property of security-critical software based on large model
Through the automatic generation method of safety-critical software verification properties based on large models, natural language requirements in real development environments are translated into timing logical formulas, solving the problem that existing technology cannot effectively handle flexible natural language requirements, and achieving more efficient and more Secure software development.
Patent Information
- Application Number
- CN202411348471.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Existing methods cannot effectively translate flexible natural language requirements in real development environments into timing logical formulas, making it difficult to ensure the security and reliability of software in safety-critical software development.
A method for automatic generation of safety-critical software verification properties based on large models is proposed. By analyzing the requirements text, extracting atomic propositions, defining irregular natural language type templates, and using random algorithms to generate timing logical formulas, combining with large language models for translation.
It significantly improves software development efficiency, reduces development time and cost, improves the security and reliability of safety-critical software, and can more effectively respond to the needs of the real development environment.
Smart Images

Figure CN119473842A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of safety-critical fields, and specifically is a method for automatically generating verification properties of safety-critical software based on a large model. Background Art
[0002] Safety-critical software refers to a type of software used in safety-critical systems in the fields of aviation, aerospace, transportation, energy, etc., and its operation may cause the system to be in a dangerous state, thereby causing property loss, environmental damage or personal injury. It has extremely high requirements for functional correctness, real-time performance, safety and other properties.
[0003] The increasing complexity of safety-critical software makes software development more difficult, and the development cost and insecurity factor also increase accordingly. The ambiguity of natural language requirements is a challenge to the difficulty of safety-critical software development. To meet this challenge, converting natural language requirements into logical formulas is an effective solution.
[0004] Temporal Logic is a formal logic system for describing and reasoning about time-related properties. It extends the expressive power of classical logic to enable the processing of dynamic properties in the time dimension. Temporal logic achieves this extension primarily by introducing temporal operators that allow precise modeling and analysis of changes in system states. Common temporal operators include "Always", "Eventually", and "Until", which are used to indicate whether a property always holds at a certain point in time or at a certain moment in the future. Temporal logic has a wide range of applications, including program verification in computer science, design and verification of automated control systems, and planning and decision support in artificial intelligence. By using temporal logic, researchers and engineers can more systematically analyze the behavior and properties of a system and ensure the correctness and reliability of the system under various time conditions. The formal nature of this logic system also makes it an important tool in theoretical computer science to help solve complex problems involving time factors.
[0005] Converting natural language requirements into logical formulas is crucial in the development of safety-critical software. Natural language is often ambiguous and vague, while logical formulas are precise and clear, which can eliminate ambiguity and ensure that all stakeholders have a consistent understanding of the requirements. Through logical formulas, developers can use formal methods for verification and proof, and use mathematical tools to ensure that the system meets specific requirements, thereby improving reliability and safety. In addition, logical formulas can be processed and analyzed by automated tools, such as model checking tools and automated theorem provers, to help verify the correctness of the system. Formalized requirement descriptions can also check contradictions between different requirements, ensure the consistency of system requirements, and provide traceability from requirements to implementation to ensure that the implemented system fully meets the initial requirements. In the development of complex systems, logical formulas also serve as a common language between different teams to promote communication and collaboration between teams. Therefore, converting natural language requirements into logical formulas can significantly improve the development quality and efficiency of safety-critical software.
[0006] Researchers have proposed many methods for translating English sentences into various target language formulas. The traditional methods in the first stage usually follow three steps: 1) preprocessing the given English input by extracting syntactic information, 2) identifying the patterns or rules of TL by classification, and 3) running the attribute grammar-based parser to derive the target logical format. These methods are only applicable to restricted input natural languages. Another type of method is based on learning. Gopalan et al. from Brown University collected a dataset focused on GLTL, where both NL and GLTL examples are used for navigation of cars in a room. Then a Seq2Seq model with an attention mechanism is trained. Although the accuracy (93.45%) is high, the GLTL used is relatively simple, each GLTL usually includes one to three APs, and the dataset also focuses on a restricted task. The latest method applies new achievements in the field of natural language processing: a large pre-trained language model (LLM) based on Transformer, He Yongchao et al. from MIT used Chat-GPT3 to assist in generating framework training data, and used these data to fine-tune the T5 model, which outperformed the baseline method on existing public datasets.
[0007] However, in order to simplify the task, these previous works usually make strong assumptions to restrict the input text or output formula, which limits flexibility and generality. Existing methods cannot address the requirements in real development environments. Therefore, it is of great significance to develop a more general tool that translates flexible natural language requirements into temporal logic formulas. Summary of the invention
[0008] Purpose of the invention: In order to solve the problem that existing methods cannot meet the requirements in a real development environment, the present invention proposes a method for automatically generating verification properties of safety-critical software based on a large model, which translates non-standard natural language requirements into temporal logic formulas. On the premise of ensuring the safety and reliability of the software, it can effectively respond to the requirements in a real development environment, significantly improve software development efficiency, and reduce development time and cost.
[0009] Technical solution: A method for automatically generating verification properties of safety-critical software based on a large model, comprising the following steps:
[0010] Analyze the requirement text in the process of safety-critical software development to obtain atomic propositions in the requirement text, extract the subject and predicate from each atomic proposition, merge the extracted subject and predicate to obtain the reorganized atomic proposition;
[0011] Analyze the requirement text in the process of safety-critical software development and define non-standard natural language type templates;
[0012] According to the defined irregular natural language type template, the reorganized atomic propositions are combined with the logic operators using a random algorithm to generate a signal sequential logic formula;
[0013] Translate the generated signal temporal logic formula into natural language, thereby constructing a data set containing formula-natural language pairs;
[0014] Depending on the situation, you can use a dataset containing formula-natural language pairs to fine-tune the local large model or the large language model interface to obtain a fine-tuned large model.
[0015] Using the prompt word template, the natural language requirements to be translated are input into the fine-tuned large model to obtain the corresponding temporal logic formula.
[0016] Furthermore, the non-standard natural language type template includes:
[0017] Template 1:
[0018] When a natural language contains: subject verb_1operator verb_2, complete it as: subjectverb_1operator subject verb_2; where subject represents the subject, verb_1 represents the predicate 1, and operator represents and or imply or equal or or until or until[*,**];
[0019] When natural language contains: subject operator subject verb, complete it as: subject_1verb operator subject_2verb; where operator means and or or;
[0020] Template 2:
[0021] When a natural language contains phrase+subject_1 / subject_2 / …+verb, it is completed as: subject_1verb and / or subject_2verb and / or…; where phrase means all of, one of, or any of;
[0022] Template three:
[0023] When the natural language sentence is: AP_1equal AP_2.AP_2+sentence, rewrite it as: AP_1+sentence; where AP_1 represents atomic proposition 1 and AP_2 represents atomic proposition 2;
[0024] Template 4:
[0025] When the natural language sentence is: AP imply sentence_1, phrase imply sentence_2, complete it into two sentences: AP imply sentence_1 and negation AP imply sentence_2; where AP represents an atomic proposition, phrase is otherwise or on the other hand or conversely, sentence_1 represents STL sub-formula 1, and sentence_2 represents STL sub-formula 2.
[0026] Furthermore, the aforementioned non-standard natural language type template is defined, and a random algorithm is used to combine the reorganized atomic propositions with the logic operator to generate a signal timing logic formula, specifically including:
[0027] Define unary operators and binary operators, the unary operators include: negation, global, final, and the binary operators include: and, or, until, implies, equals;
[0028] Through the binary tree generation algorithm, the reorganized atomic propositions are randomly synthesized with appropriate unary operators and binary operators to obtain various signal timing logic formulas.
[0029] Furthermore, the binary tree generation algorithm is used to randomly synthesize the reorganized atomic propositions with appropriate unary operators and binary operators to obtain various signal timing logic formulas, including:
[0030] Define the randomly generated atomic proposition number AP_num and the irregular type irrgular_type;
[0031] Randomly select AP_num reorganized atomic propositions to form prop_list;
[0032] When irregular_type=1, insert a type1_phrase into prop_list to form a new prop_list. Based on the new prop_list, use the generate_from_list algorithm to generate the in-order signal timing logic formula to obtain the final signal timing logic formula, which is expressed as: generate_from_list(prop_list);
[0033] When irregular_type=2, insert a type2_phrase into prop_list to form a new prop_list. Based on the new prop_list, use the generate_from_list algorithm to generate the in-order signal timing logic formula to obtain the final signal timing logic formula, which is expressed as: generate_from_list(prop_list);
[0034] When irregular_type=3, randomly sample a reorganized atomic proposition outside_ap, and then randomly sample a reorganized atomic proposition inside_ap in prop_list, use the generate_from_list algorithm to generate the in-order signal timing logic formula, and generate the final signal timing logic formula according to template 3, which is expressed as: outside_ap+"<->"+inside_ap+";"+generate_from_list(prop_list);
[0035] When irregular_type=4, randomly sample a reorganized atomic proposition, and based on the reorganized atomic proposition, use the generate_from_list algorithm to generate one_sentence; then randomly sample two reorganized atomic propositions, and based on the two reorganized atomic propositions, use the generate_from_list algorithm to generate other_sentence, randomly obtain a reorganized atomic proposition ap from prop_list, and obtain a random number sign. If the random number sign=0, then generate the final signal timing logic formula according to template 4, expressed as: ap+"->"+one_sentence+"; ~"+ap+"->"+other_sentence; otherwise, generate the final signal timing logic formula according to template 4, expressed as: ap+"->"+other_sentence+"; ~"+ap+"->"+one_sentence;
[0036] Among them, type1_phrase is a simple sentence dataset type1_phrase generated according to the irregular type in template 1, which is composed of a combination of reorganized atomic propositions;
[0037] Similarly, type2_phrase is a simple sentence dataset type2_phrase generated according to the irregular type in template 2, which is composed of a combination of reorganized atomic propositions.
[0038] Furthermore, the generate_from_list algorithm specifically includes the following operations:
[0039] Randomly split prop_list into multiple sublists sub_lists;
[0040] For each sub_lists, define num_open_subtree as the length of the sublist; when num_open_subtree>1, randomly select an operator operation from the two types of operators and insert it at the front of the sublist to obtain the preceding signal timing logic formula; only if the operator operation is an operator in the binary operator, then num_open_subtree-1; only if the operation contains time, fill in a random time;
[0041] Finally, all sub_lists are connected using the operators in the binary operator to convert them into an in-order signal timing logic formula.
[0042] Furthermore, the prompt word template includes: translation instructions, explicit prompts, example samples and natural language requirements to be translated.
[0043] Furthermore, the clear prompt includes:
[0044] Prompt to check whether there are irregular expressions in natural language, and provide irregular natural language type templates;
[0045] It is suggested to correct the non-standard natural language expression according to the non-standard natural language type template, and translate the corrected natural language expression into a temporal logic formula.
[0046] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0047] (1) The present invention uses the atomic proposition data in the requirements to generate a logical formula data set. This data set is closer to real development than a data set that randomly generates atomic propositions, significantly improves the diversity and complexity of the data set, and improves the performance of the model trained by the data set;
[0048] (2) The present invention analyzes and summarizes four types of irregular requirements and generates data from them. These irregular requirements types make up for the deficiency that all natural language data in the past are standard natural languages, making the model trained by the generated data more generalized and applicable to more flexible natural language requirements;
[0049] (3) The present invention uses the prompt engineering of the large language model for translation. With the help of the deep learning algorithm of the large language model and the huge training data, the system can achieve efficient and accurate translation between logical formulas and natural language;
[0050] (4) The present invention achieves a more general natural language requirement translation, greatly improving the security and reliability of safety-critical software development. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is the overall architecture diagram of the automatic translation tool;
[0052] Figure 2 Generate schematic diagrams for the data;
[0053] Figure 3 Fine-tune the schematic for the large model;
[0054] Figure 4 This is a schematic diagram of the project. DETAILED DESCRIPTION
[0055] The technical solution of the present invention is now further described in conjunction with the accompanying drawings and embodiments.
[0056] like Figure 1As shown, the present invention relates to an automatic translation method for converting safety-critical software development requirements into temporal logic formulas based on a large model, also known as a method for automatically generating safety-critical software verification properties. It mainly includes the following steps:
[0057] Step 1: Collect and analyze the requirement texts in the safety-critical software development process, analyze the atomic propositions in the requirement texts, extract the subject, predicate and other terms, and generate a requirement term data set. At the same time, analyze the requirement features in the requirement texts that cannot be directly converted into logical formulas, summarize and define four types of non-standard templates. The specific operations include:
[0058] In order to enhance the authenticity of the data set, the present invention extracts atomic propositions from the safety-critical software development requirements document, divides them into subjects and predicates, and recombines them into new atomic propositions. The present invention extracts subjects and predicates from real data sources, analyzes, extracts and processes them, and then recombines these subjects and predicates to generate logical atomic propositions, thereby ensuring that the generated atomic propositions can accurately reflect the core semantic relationships in the original data, and can flexibly adjust the collocation of subjects and predicates according to the needs of different application scenarios to enhance the applicability and accuracy of atomic propositions.
[0059] At the same time, after analyzing the natural language requirements in safety-critical software, four non-standard natural language type templates were defined.
[0060] For the convenience of description, the atomic proposition is divided into the form of subject + predicate, that is, subject + verb, and the complete atomic proposition is replaced by AP:
[0061] Template 1: Atomic proposition part omitted: This type has two subcategories:
[0062] a.subject verb_1operator verb_2, needs to be completed as subject verb_1operatorsubject verb_2, where operator refers to and / imply / equal / or / until / until[*,**]. For example, the natural language atomic proposition "packet data right and stored" needs to be completed as "packet data right andpacket data stored".
[0063] b. Subject operator subject verb, needs to be completed as subject_1verb operatorsubject_2verb, where operator refers to and / or. For example, the natural language atomic proposition "check bit and command word are correct" needs to be completed as "check bit is correct and command word iscorrect" when translated;
[0064] Template 2: Atomic proposition parallel structure: phrase+subject_1 / subject_2 / …+verb, where phrase refers to all of / one of / any of, and needs to be completed as subject_1verb and / or subject_2verb / or… during translation. For example, the natural language requirement fragment “one of check bit, command word, packet length, synchronization word is correct” needs to be rewritten as “check bit is correct or command word is correct or packet length is correct or synchronization word is correct” during translation;
[0065] Template 3: Contextual synonym conversion: AP_1equal AP_2.AP_2+sentence needs to be rewritten as AP_1+sentence, such as "Data is valid when pressure altitude is above 1000.If data is valid,call the system initialization function", which needs to be rewritten as "when the pressure altitude are above 1000,call the systeminitialization function" during translation;
[0066] Template 4: One-to-many translation: AP imply sentence_1, negation AP imply sentence_2, that is, a natural language requirement is translated into multiple temporal logic formulas. For example, "If the data source is selected, stay in state 1, otherwise migrate to state 2." This sentence should be translated as two sentences: "If the data source is selected, stay in state 1." and "If the data source is not selected, migrate to state 2."
[0067] Step 2: Combine the random algorithm and use four non-standard natural language type templates to combine the demand term data set with the logical operator to generate a logical formula data set. The specific operations include:
[0068] The recombined atomic propositions and irregular natural language type templates are used as materials for generating logical formula datasets.
[0069] According to the irregular type in template 1, a simple sentence dataset type1_phrase is generated, which is composed of a simple combination of atomic propositions. Similarly, according to the irregular type in template 2, a simple sentence dataset type2_phrase is generated, which is composed of a simple combination of atomic propositions. In addition, the subject and predicate are recombined to generate the AP dataset.
[0070] The main idea of randomly generating STL formulas is to define the randomly generated atomic proposition number AP_num and the irregular type irrgular_type, and then randomly obtain AP_num atomic propositions from the atomic proposition library AP to form prop_list. When irregular_type=1, insert a type1_phrase into prop_list to generate an STL formula; when irregular_type=2, insert a type2_phrase into prop_list to generate an STL formula; when irregular_type=3, randomly sample an atomic proposition outside_ap from the atomic proposition library, and then randomly sample an inside_ap from prop_list, and generate a formula according to the template; when irregular_type=4, randomly sample an atomic proposition to generate one_sentence, and then randomly sample two atomic propositions to generate other_sentence, randomly obtain an ap from prop_list, and then generate a formula according to the template according to the randomly generated sign.
[0071] The algorithm for randomly generating STL formulas is as follows:
[0072] Input: Maximum number of atomic propositions N
[0073] Output: Synthesized STL formula
[0074] AP_num=random numin range(1,N)
[0075]
[0076] This algorithm generates a signal temporal logic (STL) formula. This method can generate diverse STL expressions by introducing randomness. Type 0 generates a standard formula, Type 1 and Type 2 generate formulas by adding non-standard atomic propositions to the candidate AP, and Type 3 and Type 4 need to make changes to the formula structure according to the template.
[0077] The generate_from_list algorithm is as follows:
[0078] Input: atomic proposition list prop_list
[0079] Output: In-order STL formula
[0080]
[0081]
[0082] First, two types of operators are defined (one_subtree is a unary operator that only works on one element, and two_subtree is a binary operator that works on two elements), and then the input atomic proposition list is randomly divided into several sublists sub_lists. For each sub_lists, num_open_subtree is defined as the length of the sublist. When num_open_subtree>1, an operator operation is randomly selected from the two types of operators and inserted into the front of the sublist (because it is a pre-order expression): if operation is an operator in two_subtree, then num_open_subtree-1 (operable element-1); if operation contains time, fill in a random time. Finally, all sub_lists are connected with the operators in two_subtree, and then converted into in-order expressions to generate the final STL formula. The unary operators in this embodiment are such as negation, global, and final, and the binary operators are such as and, or, until, implies, and equivalent.
[0083] Step 3: Use the large language model to translate the signal temporal logic (STL) formula generated in step 2 into natural language, and generate natural language requirements and logic formula data containing non-standard requirements. The specific operations include:
[0084] GPT-3 will try to generate original NL whose semantics are close to STL. LLM GPT-3 (Davinci-003) is applied to help generate multiple NL and STL pairs. Various NL-STL pairs are used as prompts, and GPT-3 is asked to automatically generate more NL-STL pairs. Then, human annotators modify the original NL to make its meaning consistent with STL. During this process, NL-STL pairs in the prompt will be randomly selected to make the vocabulary and sentence structure more diverse. Figure 2 In each iteration of , 20 pairs of prompts that compose GPT-3 are randomly selected from the prompt pool.
[0085] Step 4: Fine-tune the local large model or large language model interface according to the situation; the specific operations include:
[0086] In the process of developing safety-critical software, for situations where confidentiality is required, that is, when data cannot be leaked, the data generated above is put into a locally deployed large model, and the model is fine-tuned until the required effect is achieved, and the fine-tuned model is used offline. For situations where confidentiality is not required, fine-tuning is performed directly using the online open fine-tuning API.
[0087] Fine-tuning is the further training of a pre-trained language model to make it perform better in a specific task or domain. This process involves additional training of the model using a domain-specific dataset to adjust the model's parameters to better suit a specific application scenario. Through fine-tuning, the model can improve accuracy and performance on specific tasks, especially when processing specific types of data or responding to specific requirements, which can significantly improve its performance.
[0088] like Figure 3 As shown, pre-training means that the large model is trained on a large amount of text before it is put into use to obtain its capabilities in the field of general natural language processing. During fine-tuning, the parameters within the model are adjusted on the original basis through new training data, and transfer learning is used to make it more suitable for downstream tasks. In the present invention, the ability to translate natural language into temporal logic formulas is enhanced through data set training.
[0089] Step 5: Build a prompt word template to guide the big model to rewrite non-standard requirements into standard requirements, and further translate these standardized requirements into temporal logic formulas. Specific operations include:
[0090] Prompt engineering is a method to guide large language models to generate expected outputs by designing and optimizing input prompts. By precisely constructing prompt words, providing examples, or using templates, the model can be helped to better understand the task requirements and generate more relevant and expected results. Prompt engineering can improve the performance of the model on specific tasks without modifying the model structure or weights, thereby optimizing the quality and accuracy of the generated content.
[0091] like Figure 4 As shown, the present invention designs a prompt engineering template to guide the large model to translate in two steps. First, the translation instructions and requirements are explained, including that the translation task is to translate from natural language to signal timing logic, and the operators required in the translation; then, clear prompts are provided to prompt the large model to check whether there are irregular expressions in the natural language, and four types of irregularities and correction methods are listed; then, some example samples are given, that is, corresponding examples of natural language and STL formulas; finally, the natural language to be translated is provided, and the large model is allowed to translate.
Claims
1. A method for automatically generating verification properties of safety-critical software based on a large model, characterized by: The following steps are involved: Analyze the requirement text in the process of safety-critical software development to obtain atomic propositions in the requirement text, extract the subject and predicate from each atomic proposition, merge the extracted subject and predicate to obtain the reorganized atomic proposition; Analyze the requirement text in the process of safety-critical software development and define non-standard natural language type templates; According to the defined irregular natural language type template, the reorganized atomic propositions are combined with the logic operators using a random algorithm to generate a signal sequential logic formula; Translate the generated signal temporal logic formula into natural language, thereby constructing a data set containing formula-natural language pairs; Depending on the situation, you can use a dataset containing formula-natural language pairs to fine-tune the local large model or the large language model interface to obtain a fine-tuned large model. Using the prompt word template, the natural language requirements to be translated are input into the fine-tuned large model to obtain the corresponding temporal logic formula.
2. The method for automatically generating verification properties of safety-critical software based on a large model according to claim 1, characterized in that: The non-standard natural language type template includes: Template 1: When a natural language contains: subject verb_1operator verb_2, complete it as: subject verb_1operator subject verb_2; where subject represents the subject, verb_1 represents the predicate 1, and operator represents and or imply or equal or or until or until[*,**]; When natural language contains: subject operator subject verb, complete it as: subject_1verboperator subject_2verb; where operator means and or or; Template 2: When a natural language contains phrase+subject_1 / subject_2 / …+verb, it is completed as: subject_1verb and / or subject_2verb and / or…; where phrase means all of, one of, or any of; Template three: When the natural language sentence is: AP_1equal AP_2.AP_2+sentence, rewrite it as: AP_1+sentence; where AP_1 represents atomic proposition 1 and AP_2 represents atomic proposition 2; Template 4: When the natural language sentence is: AP imply sentence_1, phrase imply sentence_2, complete it into two sentences: AP imply sentence_1 and negation AP imply sentence_2; where AP represents an atomic proposition, phrase is otherwise or on the other hand or conversely, sentence_1 represents STL subformula 1, and sentence 2 represents STL subformula 2.
3. The method for automatically generating verification properties of safety-critical software based on a large model according to claim 2, characterized in that: The aforementioned method of combining the reorganized atomic propositions with the logic operators according to the defined non-standard natural language type template using a random algorithm to generate a signal timing logic formula specifically includes: Define unary operators and binary operators, the unary operators include: negation, global, final, and the binary operators include: and, or, until, implies, equals; Through the binary tree generation algorithm, the reorganized atomic propositions are randomly synthesized with appropriate unary operators and binary operators to obtain various signal timing logic formulas.
4. The method for automatically generating verification properties of safety-critical software based on a large model according to claim 3, characterized in that: The binary tree generation algorithm randomly synthesizes the reorganized atomic propositions with appropriate unary operators and binary operators to obtain various signal timing logic formulas, including: Define the randomly generated atomic proposition number AP_num and the irregular type irrgular_type; Randomly select AP_num reorganized atomic propositions to form prop_list; When irregular_type=1, insert a type1_phrase into prop_list to form a new prop_list. Based on the new prop_list, use the generate_from_list algorithm to generate the in-order signal timing logic formula to obtain the final signal timing logic formula, which is expressed as: generate_from_list(prop_list); When irregular_type=2, insert a type2_phrase into prop_list to form a new prop_list. Based on the new prop_list, use the generate_from_list algorithm to generate the in-order signal timing logic formula to obtain the final signal timing logic formula, which is expressed as: generate_from_list(prop_list); When irregular_type=3, randomly sample a reorganized atomic proposition outside_ap, and then randomly sample a reorganized atomic proposition inside_ap in prop_list, use the generate_from_list algorithm to generate the in-order signal timing logic formula, and generate the final signal timing logic formula according to template 3, which is expressed as: outside_ap+"<->"+inside_ap+";"+generate_from_list(prop_list); When irregular_type=4, randomly sample a reorganized atomic proposition, and based on the reorganized atomic proposition, use the generate_from_list algorithm to generate one_sentence; then randomly sample two reorganized atomic propositions, and based on the two reorganized atomic propositions, use the generate_from_list algorithm to generate other_sentence, randomly obtain a reorganized atomic proposition ap from prop_list, and obtain a random number sign. If the random number sign=0, then generate the final signal timing logic formula according to template 4, expressed as: ap+"->"+one_sentence+"; ~"+ap+"->"+other_sentence; otherwise, generate the final signal timing logic formula according to template 4, expressed as: ap+"->"+other_sentence+"; ~"+ap+"->"+one_sentence; Among them, type1_phrase is a simple sentence dataset type1_phrase generated according to the irregular type in template 1, which is composed of a combination of reorganized atomic propositions; Similarly, type2_phrase is a simple sentence dataset type2_phrase generated according to the irregular type in template 2, which is composed of a combination of reorganized atomic propositions.
5. The method for automatically generating verification properties of safety-critical software based on a large model according to claim 4, characterized in that: The generate_from_list algorithm described above specifically includes the following operations: Randomly split prop_list into multiple sublists sub_lists; For each sub_lists, define num_open_subtree as the length of the sublist; when num_open_subtree>1, randomly select an operator operation from the two types of operators and insert it at the front of the sublist to obtain the preceding signal timing logic formula; only if the operator operation is an operator in the binary operator, then num_open_subtree-1; only if the operation contains time, fill in a random time; Finally, all sub_lists are connected using the operators in the binary operator to convert them into an in-order signal timing logic formula.
6. The method for automatically generating verification properties of safety-critical software based on a large model according to claim 1, characterized in that: The prompt word template includes: translation instructions, explicit prompts, example samples and natural language requirements to be translated.
7. The method for automatically generating verification properties of safety-critical software based on a large model according to claim 6, characterized in that: The clear prompts include: Prompt to check whether there are irregular expressions in natural language, and provide irregular natural language type templates; It is suggested to correct the non-standard natural language expression according to the non-standard natural language type template, and translate the corrected natural language expression into a temporal logic formula.
Citation Information
Patent Citations
Smart home linear sequential logic protocol generation method and device
CN110705316A
Method and system for automatically generating formalized protocol from natural language to PPTL
CN113255295A
Verification property automatic generation method based on natural language requirements
CN116522919A
Requirement description e.g. test specification, creating method for embedded system i.e. motor vehicle control device, involves automatically representing modules, and assigning to classes in particular unified modeling language classes
DE102006050112A1
Requirement runtime monitor using temporal logic or a regular expression
US20170249202A1