Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A C/C++ Program Defect Automatic Repair Method Based on Program Synthesis

An automatic repair and synthesis method technology, applied in software maintenance/management, creation/generation of source code, code reconstruction, etc., can solve problems such as the inability to guarantee the correctness of the code, and achieve the effect of ensuring correctness

Active Publication Date: 2019-09-20
NANJING UNIV
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Usually the repaired code can pass the test cases, the correctness of the repaired code cannot be guaranteed

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
  • A C/C++ Program Defect Automatic Repair Method Based on Program Synthesis
  • A C/C++ Program Defect Automatic Repair Method Based on Program Synthesis
  • A C/C++ Program Defect Automatic Repair Method Based on Program Synthesis

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0032] The specific implementation of the C / C++ program defect automatic repair method based on program synthesis used in the present invention will be described in more detail below.

[0033] The C / C++ program defect automatic repair method based on program synthesis of the present embodiment, this method imports the C / C++ program with defect, according to common program defect and the type of defect program, rewrite rule is set, and rewrite rule includes defect Mode and repair options. The defect pattern is then matched against the syntax tree of the defect program. The absence of any matching rewrite rules indicates that the bug in the program cannot be fixed. If there is a matching rewrite rule, replace the matching syntax tree subtree with the selection expression. Afterwards, the program synthesis method is used to obtain the options of each selection expression according to the specifications that the program needs to satisfy. The program synthesis method converts th...

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 program synthesis-based automatic C / C++ program defect repairing method. The method comprises the following steps of: inputting a C / C++ program with a defect, and setting rewriting rules according to common program defects and a type of the defective program, wherein the rewriting rules comprise defect modes and repairing options; matching the defect modes with a syntax tree of the defective program; if any matched rewriting rule does not exist, indicating that the defect of the program cannot be repaired; if the matched rewriting rule exists, replacing matched syntaxsub-trees by selection expressions; obtaining an option of each selection expression according to a stipulation to be satisfied by the program by using a program synthesis method; and converting theprogram with the selection expressions and the stipulation to be satisfied by the program into logic expressions by using the program synthesis method, carrying out solution in a set time by using a constraint solver, substituting the option of each selection expression, and outputting the syntax tree as a C / C++ code so as to obtain a repaired program.

Description

technical field [0001] The invention relates to a method for automatically repairing program defects, which uses a program synthesis method to realize automatic repair of program defects, and belongs to the field of software engineering. Background technique [0002] In computer science, program synthesis refers to the automatic construction of programs given a specification. Because code can be automatically generated, program synthesis is often used in code completion, software development, and algorithm design. The program synthesis method includes two steps of synthesis and verification. Using the method of counterexample guidance, the problem is transformed into a SAT / SMT problem, and finally the SAT / SMT solver is used to solve it. [0003] The current method of automatically repairing program defects usually adopts the method based on test cases. Usually the repaired code can pass the test cases, and the correctness of the repaired code cannot be guaranteed. The met...

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 Patents(China)
IPC IPC(8): G06F8/72G06F8/30
Inventor 王林章陈天骄李宣东
Owner NANJING UNIV
Features
  • Generate Ideas
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More