Local sensitive program analysis method based on abstract syntax tree and theorem proof

An abstract syntax tree and theorem proving technology, which is applied in the field of locally sensitive program analysis based on abstract syntax trees and theorem proving, can solve problems such as low running performance, discounted analysis results, high false positive and false negative rates, and shorten the time spent , to avoid the effect of low efficiency

Active Publication Date: 2020-03-13
安徽中科国创高可信软件有限公司
View PDF3 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Based on the above framework, static code analysis tools are very efficient and accurate when dealing with grammatical issues in programs, but cannot handle path-sensitive semantic issues
[0003] When the above method analyzes the source code file, because the traversal process is inconsistent with the code execution process, and the state of the object will not be recorded during the traversal process, the semantics of the program cannot be analyzed at the matching node, and it can only be judged from the grammatical level Whether there is a program exception, so the mechanism of the static code analysis tool based on the abstract syntax tree can only detect the grammar rules of the energy code file, but cannot realize the detection of the semantic rules
[0004] From the perspective of program analysis, many program problems need to be detected at the semantic level of the program. If this semantics is abandoned and each source code file is analyzed only from the grammatical level, it is impossible to comprehensively analyze the program. detection, resulting in greatly reduced analysis results
However, symbolic execution tools have relatively low operating performance, are often powerless for complex programs, and have a high rate of false positives and false negatives

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Local sensitive program analysis method based on abstract syntax tree and theorem proof
  • Local sensitive program analysis method based on abstract syntax tree and theorem proof
  • Local sensitive program analysis method based on abstract syntax tree and theorem proof

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0032] The technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0033] A local sensitive program analysis method based on abstract syntax tree and theorem proving provided by the present invention includes:

[0034] Perform preprocessing, lexical analysis, and grammatical analysis on the program code, and construct an abstract syntax tree AST without grammatical errors according to the results of grammatical analysis;

[0035] Traverse the abstract syntax tree AST of the program code, collect the nodes to be detected and the related nodes of the nodes to be detected, form the relevant logical expressions of the nodes to be detected according to the information of the nodes to be detected and their related nodes, and input them into the theorem prover;

[0036] In the process of traversal, first determine the nodes to be detected, then collect and analyze the information of the nod...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a local sensitive program analysis method based on an abstract syntax tree and theorem proof. The local sensitive program analysis method comprises the steps of constructing the abstract syntax tree AST without syntax errors for program codes; traversing an abstract syntax tree AST of the program code, collecting a to-be-detected node and related nodes of the to-be-detectednode, forming a related logic expression of the to-be-detected node according to the to-be-detected node and related node information, and inputting the related logic expression into a theorem prover; and the theorem prover solves the to-be-detected node through the logic expression, and if an abnormal condition exists in the solved to-be-detected node value, judging that the program has a semantic defect. According to the method, by collecting the local context and the local path information of the program node, some wrong alarms are avoided, the usability is improved, semantic defect detection of the program code is achieved, and the problem that a traditional symbolic execution tool is long in time consumption for analyzing the code due to path explosion is solved.

Description

technical field [0001] The invention relates to the field of program code detection in the field of computer information security, in particular to a local sensitive program analysis method based on abstract syntax tree and theorem proof. Background technique [0002] In static code analysis based on abstract syntax tree traversal, the static code analysis tool framework traverses the abstract syntax tree (AST) generated by each source code file, and developers can create corresponding node matchers and perform Registration, when the static code analysis tool finds a node that matches the node matcher when traversing the syntax tree, it will save the node in memory and notify the client through the callback function. After completing the registration of the node matcher, the developer implements the alarm mechanism in the callback function, and outputs the code position of the corresponding node and the alarm content to the command line. Based on the above framework, static...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41G06F21/56
CPCG06F21/563G06F8/436G06F8/42Y02D10/00
Inventor 李兆鹏顾建平戴一飞
Owner 安徽中科国创高可信软件有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products