# US 11,119,892 B2 · Method, device and computer-readable storage medium for guiding symbolic execution

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,119,892 B2
- Document ID: US11119892B2
- Status: Granted
- Kind: B2
- Application number: 16/829,593
- Filed: 2020-03-25
- Published: 2021-01-21
- Granted: 2021-09-14
- Earliest claimed: 2019-07-16
- Assignees: Baidu Online Network Technology (Beijing) Co., Ltd.
- Applicants: Baidu Online Network Technology (Beijing) Co., Ltd.
- Inventors: Qian Feng; Shengjian Guo; Peng Li; Minghua Wang; Yulong Zhang; Tao Wei
- Web page: https://patentgrep.com/patent/US11119892B2

## CPC

- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/08: Learning methods
- G06N 3/09: Supervised learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The present disclosure provides a method, apparatus, device and computer-readable storage medium for guiding symbolic execution. According to embodiments of the present disclosure, it is possible to determine the specific code region of the program, and obtain the program loop output of the program corresponding to the specific code region of the program by using the program inverse analysis method, so that it is possible to obtain the program loop input of the program corresponding to the specific code region by using the program loop predictor according to the program loop output of the program. In this way, the obtained program loop input of the program corresponding to the specific code region may be used to guide the symbolic execution to filter out impossible execution paths and jump out of the program code and reach the specific code region, thereby improving the reliability of the symbolic execution.

## Claims

### Claim 1

A method for guiding symbolic execution, wherein the method comprises:
determining a specific code region of a program;
obtaining a program loop output of the program corresponding to the specific code region of the program by using a program inverse analysis method; and
obtaining a program loop input of the program corresponding to the specific code region by using a program loop predictor according to the program loop output of the program,
wherein the program loop predictor is obtained by:
obtaining a program state before a first iteration operation in the program loop and a program state after each iteration operation by using abstract interpretation;
taking the program state before each iteration operation and the program state after the iteration operation as a piece of training data; and
building the program loop predictor based on a Recurrent Neural Network (RNN) by using at least two pieces of training data composed of the program state.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining the specific code region of the program comprises:
determining the specific code region of the program by using abstract interpretation.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the specific code region of the program comprises a code region where a bug point of the program lies.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the building the program loop predictor based on the RNN by using the at least two pieces of training data comprises:
performing embedding processing for the program state in the at least two pieces of training data to obtain a state vector; and
building the program loop predictor based on the RNN by using the at least two pieces of training data after the embedding processing.

### Claim 5

A device comprising:
one or more processors;
a storage for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method for guiding symbolic execution, wherein the method comprises:
determining a specific code region of a program;
obtaining a program loop output of the program corresponding to the specific code region of the program by using a program inverse analysis method; and
obtaining a program loop input of the program corresponding to the specific code region by using a program loop predictor according to the program loop output of the program,
wherein the program loop predictor is obtained by:
obtaining a program state before a first iteration operation in the program loop and a program state after each iteration operation by using abstract interpretation;
taking the program state before each iteration operation and the program state after the iteration operation as a piece of training data; and
building the program loop predictor based on a Recurrent Neural Network (RNN) by using at least two pieces of training data composed of the program state.

### Claim 6 (depends on 5)

The device according to claim 5, wherein the determining the specific code region of the program comprises:
determining the specific code region of the program by using abstract interpretation.

### Claim 7 (depends on 5)

The device according to claim 5, wherein the specific code region of the program comprises a code region where a bug point of the program lies.

### Claim 8 (depends on 5)

The device according to claim 5, wherein the building the program loop predictor based on the RNN by using the at least two pieces of training data comprises:
performing embedding processing for the program state in the at least two pieces of training data to obtain a state vector; and
building the program loop predictor based on the RNN by using the at least two pieces of training data after the embedding processing.

### Claim 9

A non-transitory computer-readable storage medium on which a computer program is stored, wherein the program, when executed by a processor, implements a method for guiding symbolic execution, wherein the method comprises:
determining a specific code region of a program;
obtaining a program loop output of the program corresponding to the specific code region of the program by using a program inverse analysis method; and
obtaining a program loop input of the program corresponding to the specific code region by using a program loop predictor according to the program loop output of the program,
wherein the program loop predictor is obtained by:
obtaining a program state before a first iteration operation in the program loop and a program state after each iteration operation by using abstract interpretation;
taking the program state before each iteration operation and the program state after the iteration operation as a piece of training data; and
building the program loop predictor based on a Recurrent Neural Network (RNN) by using at least two pieces of training data composed of the program state.

### Claim 10 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein the determining the specific code region of the program comprises:
determining the specific code region of the program by using abstract interpretation.

### Claim 11 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein the specific code region of the program comprises a code region where a bug point of the program lies.

### Claim 12 (depends on 9)

The non-transitory computer-readable storage medium according to claim 9, wherein the building the program loop predictor based on the RNN by using the at least two pieces of training data comprises:
performing embedding processing for the program state in the at least two pieces of training data to obtain a state vector; and
building the program loop predictor based on the RNN by using the at least two pieces of training data after the embedding processing.
