A method, system, device and medium for determining the termination of a program

By converting program code into directed abstract syntax tree diagrams and using graph attention networks and convolutional neural networks for analysis, the problem of low prediction accuracy in complex loops is solved, and a higher precision program termination judgment is achieved.

CN119415407BActive Publication Date: 2025-04-01CHINA UNIV OF GEOSCIENCES (BEIJING)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510020290.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-04-01
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

In the program termination analysis of existing neural network methods, the graph structure description ability is limited in the face of complex loops, resulting in low prediction accuracy.

Method used

The non-termination possibility of the program is extracted by converting the program code into a directed abstract syntax tree diagram and inputting the graph attention network and convolutional neural network for analysis.

Benefits of technology

The accuracy of program termination judgment is improved, and the loop structure characteristics and syntax node order can be more effectively reflected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415407B_ABST
    Figure CN119415407B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of computer technology, and provides a method, system, device and medium for determining the termination of a program. The method comprises: after obtaining the program code, performing syntax parsing, and constructing an abstract syntax tree based on syntax nodes; in the abstract syntax tree, constructing a unidirectional edge between syntax nodes based on the dependency relationship of expressions or statements; for a syntax node A whose syntax is a loop meaning, establishing a back edge between the syntax node A and the sub-syntax node in its loop body; and then obtaining a directed abstract syntax tree graph; encoding the directed abstract syntax tree into a feature graph, inputting the graph attention network, and outputting a first vector; inputting the adjacency matrix of the feature graph into a convolutional neural network, and outputting a second vector; weighted summing and normalizing the two vectors to obtain a non-termination probability estimation result. The method can effectively identify the loop structure in the program and improve the accuracy of determining the termination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the field of computer technology, and in particular, relates to a method, system, device and medium for determining the termination of a program. Background Art

[0002] In computer science, termination analysis is a technique used to determine whether a program can be run in a finite number of steps for any input. This technique is critical to ensuring the reliability and security of programs because it prevents them from entering infinite loops, which can lead to unbounded consumption of system resources and potential system crashes.

[0003] Manual detection of termination errors is very expensive. Although traditional termination verification methods attempt to provide strict guarantees that the solver is interpretable, they all face limitations unique to formal symbolic methods. In recent years, with the increasing sophistication of deep learning theory, neural networks have been used in the field of program termination analysis. The goal of these methods is not to provide strict guarantees that can be interpreted by the solver, but to try to use neural networks to provide an estimate of whether the program terminates to help programmers debug vulnerabilities.

[0004] Although current neural network methods have made great progress in estimating termination analysis, their ability to describe graph structures in complex loops is limited, which leads to low prediction accuracy in some cases. The reason is that undirected graph representation and its encoding method cannot effectively reflect the structural characteristics and syntax node order of loop programs. Summary of the invention

[0005] To solve the above problems, the present disclosure provides a method, system, device and medium for determining the termination of a program, which uses a method of converting program code into a directed abstract syntax tree graph and inputting it into a neural network, thereby being able to give an accurate judgment on the termination of the program.

[0006] The following is the technology of the present invention:

[0007] A method for determining the termination of a program, comprising:

[0008] Get the program code;

[0009] Parse the program code, identify the grammatical components as grammar nodes, and construct the grammar nodes into an abstract syntax tree in a tree form;

[0010] In the abstract syntax tree, based on the dependency relationship of expressions or statements, a unidirectional edge is constructed between syntax nodes; for a syntax node A whose syntax is a loop meaning, a back edge is established between the syntax node A and the sub-grammar node in its loop body; and thus a directed abstract syntax tree graph is obtained;

[0011] After encoding the directed abstract syntax tree graph into a feature graph, the feature graph is input into the graph attention network for graph semantic analysis, and a first vector representing the non-termination possibility of the program code is output; the adjacency matrix of the feature graph is input into the convolutional neural network for loop feature extraction, and a second vector representing the non-termination possibility of the program code is output;

[0012] The first vector and the second vector are weighted and then normalized to obtain a non-termination probability estimation result of the program. If the non-termination probability is higher than a threshold, the program is determined to be a non-termination program.

[0013] Further,

[0014] The grammatical components include: function definition, variable assignment, loop structure, and conditional judgment.

[0015] Further,

[0016] The step of encoding a directed abstract syntax tree graph comprises:

[0017] Using a semantic encoder to map the node type of each grammatical node to a specific encoding;

[0018] The execution order of code statements is sequentially encoded using a sequential encoder.

[0019] Further,

[0020] The method of sequentially encoding the execution order of the code statements by using a sequential encoder comprises:

[0021] Arrange the statements into a sequence according to the execution order of the statements in the program code;

[0022] Traverse the syntax node corresponding to each statement and map the subscript of the statement in the sequence to the syntax node corresponding to each statement.

[0023] Further,

[0024] The output represents a first vector of non-termination possibilities of the program code; comprising:

[0025] For each syntax node B in the directed abstract syntax tree graph, calculate the attention score between it and the adjacent syntax nodes;

[0026] The attention scores are converted into weights through a normalization process;

[0027] Each grammar node B updates its own features by weighted aggregation of features of its neighboring grammar nodes based on the weight;

[0028] Based on the features of each syntax node B, a non-terminal first vector representing the semantic level of the program code is output.

[0029] Further,

[0030] The convolutional neural network is a ResNet network;

[0031] The ResNet network includes: a zero padding layer, a convolutional layer, a batch normalization layer, a ReLU activation layer, a maximum pooling layer, a residual block, a global average pooling layer, and a fully connected layer;

[0032] In the convolution layer, the step size of the convolution kernel is set to 1 and the area is set to 3x3.

[0033] Further,

[0034] The graph attention network and ResNet network are built based on the Pytorch framework.

[0035] A program termination judgment system, characterized by comprising:

[0036] A data acquisition module, used for acquiring program codes;

[0037] The image conversion module is used to parse the program code, identify the grammatical components therein as grammatical nodes, and construct the grammatical nodes into an abstract syntax tree in a tree form;

[0038] In the abstract syntax tree, based on the dependency relationship of expressions or statements, a unidirectional edge is constructed between syntax nodes; for a syntax node A whose syntax is a loop meaning, a back edge is established between the syntax node A and the sub-grammar node in its loop body; and thus a directed abstract syntax tree graph is obtained;

[0039] A judgment module is used to encode the directed abstract syntax tree graph into a feature graph, input the feature graph into a graph attention network for graph semantic analysis, and output a first vector representing the non-termination possibility of the program code; input the adjacency matrix of the feature graph into a convolutional neural network for extracting cyclic features, and output a second vector representing the non-termination possibility of the program code;

[0040] The first vector and the second vector are weighted and then normalized to obtain a non-termination probability estimation result of the program. If the non-termination probability is higher than a threshold, the program is determined to be a non-termination program.

[0041] A device for determining the termination of a program, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for determining the termination of the program.

[0042] A computer storage medium stores executable instructions, which, when executed by a processor, enable the processor to implement the method.

[0043] Compared with the prior art, the present invention has the following advantages:

[0044] Since non-termination usually comes from infinite loops, program loops and execution order are key factors in determining program non-termination. Traditional AST is a tree structure widely used to represent program syntax information. However, for loop programs, its semantic expression ability is limited. Specifically, AST cannot reflect the loop structure of control flow, and its hierarchical structure cannot directly reflect the execution order of nodes.

[0045] Therefore, the present invention performs syntax analysis on the program code and constructs a directed abstract syntax tree graph, especially establishes a bidirectional edge for the loop syntax node to form a directed abstract syntax tree graph, which can effectively reflect the loop structure characteristics, clarify the relationship between syntax nodes, and provide a better structural basis for subsequent analysis;

[0046] After the directed abstract syntax tree graph is obtained and encoded, it is input into the graph attention network. The graph attention network introduces the attention mechanism, which can dynamically assign weights, better capture complex relationship structures, and can handle heterogeneous graphs without the need for global structural information. This makes it perform well in analyzing the relationship between syntax nodes of different importance in the directed abstract syntax tree graph, thereby improving the accuracy of termination verification;

[0047] The convolutional neural network can effectively extract the features of the cyclic structure based on the topological structure of the directed abstract syntax tree graph. It uses the local symmetry between the cyclic structure and the non-cyclic structure on the adjacency matrix to accurately identify the cycle;

[0048] The vectors output by the graph attention network and the convolutional neural network are weighted and normalized to obtain the non-termination probability estimation result. This multi-network combination combines the advantages of the two networks and can more comprehensively and accurately consider the various characteristics of the program code, thereby obtaining a more accurate program termination judgment result.

[0049] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by implementing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 A schematic diagram of the method of the present invention is shown;

[0052] Figure 2 A schematic diagram showing the basic form of the residual block is shown;

[0053] Figure 3 An abstract syntax tree and a directed abstract syntax tree schematic are shown. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0055] Technical innovation of the present invention:

[0056] 1) A neural network framework that focuses on structural information is built to output the probability that the program code is a non-terminating program;

[0057] 2) A new directed abstract syntax tree representation method was designed to represent program code.

[0058] Figure 1 A schematic diagram of the method according to the present invention is shown, and the specific implementation details of the present invention include:

[0059] Step 1:

[0060] The program code is converted into a directed abstract syntax tree D-AST graph structure that can be analyzed. The D-AST graph structure is as follows Figure 3 (b) as shown;

[0061] Specifically, the program code is converted into a D-AST graph structure that can be analyzed, including:

[0062] 1) Syntax parsing: Parse the program code to identify various syntactic components, such as function definitions, variable assignments, loop structures, conditional judgments, etc. For example, for the given Python code, identify "def main():" as the function definition part, "x=2" and "y=3" as assignment statements, and "while x<10:" and "while x<y:" as loop structures.

[0063] 2) Construct an AST tree structure: Organize the parsed syntactic components in a tree form to form an Abstract Syntax Tree (AST) (as shown in Figure 3 Figure (a)). Each syntactic component becomes a syntactic node on the tree, and the syntactic nodes are connected according to the syntactic logical relationship. For example, the function definition syntactic node "def main():" serves as the root syntactic node, and the assignment syntactic nodes "x=2" and "y=3" as well as the loop syntactic node "while x<10:" in the function body are connected below it.

[0064] 3) Directed edge construction: In the abstract syntax tree, based on the dependency relationship of expressions or statements, construct one-way edges between syntactic nodes;

[0065] 4) Loop back-edge construction: Based on the AST, establish back-edges between all loop nodes (while, for) and their child nodes to reflect the loop structure, and then obtain a directed abstract syntax tree graph.

[0066] Explanation:

[0067] The Abstract Syntax Tree (AST) is an abstract representation of program code. Compared with the concrete syntax tree, it does not represent every detail that appears in the real syntax, but only reflects the structural and content-related details. It organizes the syntactic structure of the code in a tree form, and each syntactic node on the tree represents an indivisible sub-structure in the program code.

[0068] Generally speaking, before using a graph neural network for analysis, it is necessary to convert the program code into an undirected graph structure based on the AST. However, this topological structure ignores some structural features of loop programs.

[0069] Therefore, in view of the characteristics of loop programs, the present invention designs a new directed abstract syntax tree representation (Directed Abstract Syntax Tree), namely D-AST. In the D-AST, directed edges are constructed from the parent syntactic node to its child syntactic nodes. The iterative relationship between the loop syntactic node and its subordinate syntactic nodes is represented by bidirectional edges. This topological structure effectively reflects the characteristics of the loop structure.

[0070] Step Two:

[0071] Based on the directed abstract syntax tree graph structure, the semantic information and sequential information of the program are encoded as the initial features of the graph to obtain feature encoding.

[0072] Specific:

[0073] Aiming at the semantic information and order information of the program, the present invention designs two encoders, including a semantic encoder (Semantic-encoder) and an order encoder (Order-encoder), and the encoding process is as follows:

[0074] The semantic encoder uses a dictionary to map the semantic information of each syntax node to a specific encoding to obtain a feature graph. This encoding depends on the D-AST syntax node attributes. For example, the while syntax node will be mapped to the same vector regardless of its position in the feature graph.

[0075] The sequential encoder sequentially encodes the execution order of code statements. First, the statements are arranged into a sequence according to their execution order. Then, the D-AST nodes corresponding to each statement are traversed, and the subscripts of the statements in the sequence are mapped to the syntax nodes corresponding to each statement. Thus, we construct the corresponding sequential encoding. And the adjacency matrix of the feature graph is constructed based on the sequential encoding.

[0076] Step 3:

[0077] The feature graph is input into the Graph Attention Network (GAT) for graph semantic analysis, and the adjacency matrix of the feature graph is input into the convolutional neural network for loop feature extraction, and two two-dimensional vectors are obtained respectively. The former vector represents the possibility of non-termination at the semantic level of the program, while the latter vector represents the possibility that the program contains a loop structure. The convolutional neural network can choose the ResNet network.

[0078] Since the existence of the loop structure increases the possibility of program non-termination, a weighted sum operation of a certain ratio is performed on the two two-dimensional vectors to obtain a weighted vector.

[0079] The weighted vector is passed through a SoftMax function for normalization, and the probability estimation result of the non-termination of the program is obtained.

[0080] Explanation:

[0081] 1) Graph Attention Network (GAT) is a neural network model based on graph structured data. It improves the performance of graph neural networks by introducing an attention mechanism. Traditional graph convolutional networks (GCN) usually use a fixed weighted average method when aggregating neighbor grammatical node information, which fails to fully utilize the differences between grammatical nodes. GAT, on the other hand, introduces a self-attention mechanism, which allows grammatical nodes to dynamically assign weights when aggregating neighbor information, thereby better capturing the complex relational structure of the graph.

[0082] In GAT, each syntax node learns the attention weights of its neighboring syntax nodes, which reflect the importance of the neighboring syntax nodes to the central syntax node. Specifically, for each pair of adjacent syntax nodes, GAT calculates the attention scores between them, and then converts these scores into weights through a normalization process (such as Softmax). Next, the central syntax node updates its own representation by weighted aggregation of the features of these neighboring syntax nodes. This process can be further enhanced by the multi-head attention mechanism to increase the expressiveness and stability of the model.

[0083] A significant advantage of GAT is that its calculation process does not require prior knowledge of the global structure of the graph, but only relies on information from the local neighborhood, which makes GAT very scalable and flexible when processing large graph data. In addition, the introduction of the attention mechanism also enables GAT to better handle heterogeneous graphs, that is, graph structures with different types of grammatical nodes and edges.

[0084] In the graph representation of D-AST, the importance of each syntax node is different. For example, for whether the program terminates after running, the While syntax node is obviously more important than other non-loop syntax nodes. Therefore, the introduction of the attention mechanism is very helpful to improve the accuracy of termination verification.

[0085] Since program termination verification is a graph-level classification problem, after the graph convolution is completed, the vector of each syntax node is averaged and aggregated, and passed through four fully connected layers to obtain a two-dimensional vector that can be used for termination estimation.

[0086] 2) The non-termination of a program often comes from the infinite execution of its loop structure, so the extraction of loop structure features is critical to program termination verification. Therefore, it is necessary to extract feature information that can determine whether a program has a loop based on the topological structure of D-AST.

[0087] According to the construction rules of D-AST, loop structures will be given bidirectional edges, while non-loop structures will only have unidirectional edges. Whether it is a single loop or a nested loop, this difference is reflected as local symmetry on the adjacency matrix. The symmetry on the matrix is ​​similar to the symmetry on the image, and this local symmetry has been proven to be a feature that can be extracted by convolutional neural networks (CNNs).

[0088] ResNet (Residual Neural Network) is a special convolutional neural network (CNN). Because traditional convolutional networks have more or less information loss and loss problems when transmitting information, it also causes gradient vanishing or gradient explosion. ResNet proposes the concept of residual blocks, which bypass the input information to the output, protect the integrity of the information, and increase the depth of the network. At the same time, by introducing residual blocks, the gradient vanishing and gradient explosion problems in deep neural network training are solved, making it possible to train very deep neural networks.

[0089] A residual block contains a shortcut connection, which passes the input directly to the subsequent layer, thus forming a "skip connection". The basic form of a residual block is as follows Figure 2 As shown:

[0090] The basic structure of the ResNet50 model includes initial processing steps such as zero padding layer, convolution layer, batch normalization layer, ReLU activation layer, and maximum pooling layer, followed by multiple convolution blocks and identity blocks, solving the training problem of deep networks through residual connections, followed by global average pooling, flattening the two-dimensional feature map into a one-dimensional vector, and finally outputting the classification result through a fully connected layer. This architecture enables ResNet50 to effectively extract image features and accurately classify.

[0091] Therefore, the present invention uses the ResNet network to extract this feature. The feature extraction process is as follows:

[0092] First, the input adjacency matrix (converted from the encoded directed abstract syntax tree) will pass through a convolution layer. Unlike the ResNet prototype, in order to make the model match matrices of different sizes, the stride of the convolution kernel is set to 1 and the area is set to 3x3.

[0093] The matrix then passes through 4 residual blocks, each of which contains 2 convolutional layers.

[0094] Finally, the matrix is ​​passed through 1 global average pooling layer and 2 fully connected layers to obtain a 2D vector that can be used for termination verification.

[0095] Specifically, the graph neural network GAT and ResNet network can be built based on the Pytorch framework.

[0096] Step 4:

[0097] Evaluate the results of the model output:

[0098] Matplotlib is used to draw visual charts and display the results of model analysis in an intuitive graphical way, helping researchers better understand and evaluate the performance of the model.

[0099] Based on the method of the present invention, the embodiment of the present disclosure also provides a system corresponding to the above method, which includes:

[0100] A data acquisition module, used for acquiring program codes;

[0101] The image conversion module is used to parse the program code, identify the grammatical components therein as grammatical nodes, and construct the grammatical nodes into an abstract syntax tree in a tree form;

[0102] In the abstract syntax tree, based on the dependency relationship of expressions or statements, a unidirectional edge is constructed between syntax nodes; for a syntax node A whose syntax is a loop meaning, a back edge is established between the syntax node A and the sub-grammar node in its loop body; and thus a directed abstract syntax tree graph is obtained;

[0103] A judgment module is used to encode the directed abstract syntax tree graph into a feature graph, input the feature graph into a graph attention network for graph semantic analysis, and output a first vector representing the non-termination possibility of the program code; input the adjacency matrix of the feature graph into a convolutional neural network for extracting cyclic features, and output a second vector representing the non-termination possibility of the program code;

[0104] The first vector and the second vector are weighted and then normalized to obtain a non-termination probability estimation result of the program. If the non-termination probability is higher than a threshold, the program is determined to be a non-termination program.

[0105] Based on the same inventive concept as the above disclosed content, an embodiment of the present disclosure also provides a device corresponding to the above method, which includes at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above method.

[0106] It should be noted that the electrical connection between the above-mentioned units does not necessarily mean the connection between lines. An indirect connection method can be applied to the embodiments of the present disclosure as long as the purpose of the present disclosure is achieved.

[0107] Based on the same inventive concept, the present disclosure also provides a computer storage medium on which executable instructions are stored, and the instructions are executed by a processor to execute the above method.

[0108] Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A method for determining the termination of a program, characterized in that: include: Get the program code; Parse the program code, identify the grammatical components as grammar nodes, and construct the grammar nodes into an abstract syntax tree in a tree form; In the abstract syntax tree, based on the dependency relationship of expressions or statements, one-way edges are constructed between syntax nodes; For a syntax node A whose syntax is a loop meaning, a back edge is established between the syntax node A and the sub-grammar node in its loop body; thereby obtaining a directed abstract syntax tree graph; A semantic encoder is used to map the node type of each syntax node of the directed abstract syntax tree graph to a specific encoding to obtain a feature graph; a sequential encoder is used to sequentially encode the execution order of code statements, and an adjacency matrix of the feature graph is constructed based on the sequential encoding; The feature graph is input into the graph attention network for graph semantic analysis, and a first vector representing the non-termination possibility of the program code is output; the adjacency matrix of the feature graph is input into the convolutional neural network for cyclic feature extraction, and a second vector representing the non-termination possibility of the program code is output; The first vector and the second vector are weighted and then normalized to obtain a non-termination probability estimation result of the program. If the non-termination probability is higher than a threshold, the program is determined to be a non-termination program.

2. A method for determining the termination of a program according to claim 1, characterized in that: The grammatical components include: function definition, variable assignment, loop structure, and conditional judgment.

3. A method for determining the termination of a program according to claim 1, characterized in that: The method of sequentially encoding the execution order of the code statements by using a sequential encoder comprises: Arrange the statements into a sequence according to the execution order of the statements in the program code; Traverse the syntax node corresponding to each statement and map the subscript of the statement in the sequence to the syntax node corresponding to each statement.

4. A method for determining the termination of a program according to claim 1, characterized in that: The output represents a first vector of non-termination possibilities of the program code; comprising: For each syntax node B in the directed abstract syntax tree graph, calculate the attention score between it and the adjacent syntax nodes; The attention scores are converted into weights through a normalization process; Each grammar node B updates its own features by weighted aggregation of features of its neighboring grammar nodes based on the weight; The graph attention network outputs a first vector representing the non-termination possibility of the program code based on the features of each syntax node B.

5. A method for determining the termination of a program according to claim 1, characterized in that: The convolutional neural network is a ResNet network; The ResNet network includes: a zero padding layer, a convolutional layer, a batch normalization layer, a ReLU activation layer, a maximum pooling layer, a residual block, a global average pooling layer, and a fully connected layer; In the convolution layer, the step size of the convolution kernel is set to 1 and the area is set to 3x3.

6. A method for determining the termination of a program according to claim 5, characterized in that: The graph attention network and ResNet network are built based on the Pytorch framework.

7. A program termination judgment system, characterized in that: include: A data acquisition module, used for acquiring program codes; The image conversion module is used to parse the program code, identify the grammatical components therein as grammatical nodes, and construct the grammatical nodes into an abstract syntax tree in a tree form; In the abstract syntax tree, based on the dependency relationship of expressions or statements, one-way edges are constructed between syntax nodes; For a syntax node A whose syntax is a loop meaning, a back edge is established between the syntax node A and the sub-grammar node in its loop body; thereby obtaining a directed abstract syntax tree graph; A judgment module is used to map the node type of each syntax node of the directed abstract syntax tree graph to a specific encoding using a semantic encoder to obtain a feature graph; sequentially encode the execution order of the code statements using a sequential encoder, and construct an adjacency matrix of the feature graph based on the sequential encoding; The feature graph is input into the graph attention network for graph semantic analysis, and a first vector representing the non-termination possibility of the program code is output; the adjacency matrix of the feature graph is input into the convolutional neural network for cyclic feature extraction, and a second vector representing the non-termination possibility of the program code is output; The first vector and the second vector are weighted and then normalized to obtain a non-termination probability estimation result of the program. If the non-termination probability is higher than a threshold, the program is determined to be a non-termination program.

8. A device for determining the termination of a program, comprising: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the termination judgment method of the program described in any one of claims 1 to 6.

9. A computer storage medium having executable instructions stored thereon, wherein when the instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Relation extraction method and system based on attention cycle gated graph convolutional network

    CN111985245A

  • Data classification method and device based on unified optimization target framework graph neural network

    CN112733933A