# US 2025/0147742 A1 · Read, Write, And Array Tracking In Code Representations

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

- Number: US 2025/0147742 A1
- Document ID: US20250147742A1
- Status: Published application
- Kind: A1
- Application number: 18/770,230
- Filed: 2024-07-11
- Published: 2025-05-08
- Earliest claimed: 2023-11-08
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Daniel Goodman
- Web page: https://patentgrep.com/patent/US20250147742A1

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- G06F 8/30: Creation or generation of source code
- G06F 8/41: Compilation
- G06F 8/427: {Parsing}
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/447: {Target code generation}
- G06F 8/452: {Loops}
- G06F 8/75: Structural analysis for program understanding
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Read, write, and array tracking may be performed for a tree representing a program or a portion of a program. A tree may be obtained from a compiler or an interpreter. The tree may be traversed to generate a map data structure in a single pass, constructing a chain of dependencies between results observed at each node visited as part of traversing the tree.

## Claims

### Claim 1

A system, comprising:
at least one processor;
a memory, comprising program instructions that when executed by the at least one processor cause the at least one processor to:
obtain a tree representing a program or a portion of a program;
traverse the tree to generate a map data structure in a single pass, wherein the map data structure maps the tree, and different subtrees of the tree, to respective data structures that comprise:
a first set of variables declared prior to the program or the portion of the program represented by the tree and in scope for the tree;
a second set of variables read by the program or the portion of the program represented by the tree; and
a third set of variables modified by the program or the portion of the program represented by the tree; and
a set of array references that respectively reference an array possibly modified by the program or the portion of the program represented by the tree; and
wherein to traverse the tree, the program instructions cause the at least one processor to construct a chain of dependencies between results observed at each node visited as part of traversing the tree.

### Claim 2 (depends on 1)

The system of claim 1, wherein the program or the portion of the program is a probabilistic programming language.

### Claim 3 (depends on 1)

The system of claim 1, wherein to traverse the tree, the program instructions cause the at least one processor to determine whether a variable name is overloaded.

### Claim 4 (depends on 1)

The system of claim 1, wherein to traverse the tree, the program instructions cause the at least one processor to determine whether more than one global reference points to a same array.

### Claim 5 (depends on 1)

The system of claim 1, wherein to traverse the tree, the program instructions cause the at least one processor to determine whether at least one reference is maintained to an outer most array.

### Claim 6 (depends on 1)

The system of claim 1, wherein to traverse the tree, the program instructions cause the at least one processor to determine whether one of the set of array references to the array is placed in two or more other arrays.

### Claim 7 (depends on 1)

The system of claim 1, wherein to traverse the tree, the program instructions cause the at least one processor to determine whether the first set of variables is within scope of at least:
a for statement; or
an if-else statement; or
the for statement and the if-else statement.

### Claim 8

A method, comprising:
performing, by one or more computing devices:
for a tree representing a program or a portion of the program:
traversing the tree to generate a map data structure in a single pass, wherein the map data structure maps the tree, and different subtrees of the tree, to respective data structures that comprise:
a first set of variables declared prior to the program or the portion of the program represented by the tree and in scope for the tree;
a second set of variables read by the program or the portion of the program represented by the tree;
a third set of variables modified by the program or the portion of the program represented by the tree; and
a set of array references that respectively reference an array possibly modified by the program or the portion of the program represented by the tree; and
wherein traversing the tree comprises constructing a chain of dependencies between results observed at each node visited as part of traversing the tree.

### Claim 9 (depends on 8)

The method of claim 8, wherein the program or the portion of the program is specified in a probabilistic programming language.

### Claim 10 (depends on 8)

The method of claim 8, wherein traversing the tree further comprises determining whether a variable name is overloaded.

### Claim 11 (depends on 8)

The method of claim 8, wherein traversing the tree further comprises determining whether more than one global references points to a same array.

### Claim 12 (depends on 8)

The method of claim 8, wherein traversing the tree further comprises determining whether at least one reference is maintained to an outer most array.

### Claim 13 (depends on 8)

The method of claim 8, wherein traversing the tree further comprises determining whether one of the set of array references to the array is placed in two or more other arrays.

### Claim 14 (depends on 8)

The method of claim 8, wherein traversing the tree further comprises determining whether the first set of variables is within scope of at least:
a for statement; or
an if-else statement; or
the for statement and the if-else statement.

### Claim 15

One or more, non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices, cause the one or more computing devices to implement:
for a tree representing a program or the portion of the program:
traversing the tree to generate a map data structure in a single pass, wherein the map data structure maps the tree, and different subtrees of the tree, to respective data structures that comprise:
a first set of variables declared prior to the program or the portion of the program represented by the tree and in scope for the tree;
a second set of variables read by the program or the portion of the program represented by the tree; and
a third set of variables modified by the program or the portion of the program represented by the tree; and
a set of array references that respectively reference an array possibly modified by the program or the portion of the program represented by the tree; and
wherein in traversing the tree, the program instructions cause the one or more computing devices to implement constructing a chain of dependencies between results observed at each node visited as part of traversing the tree.

### Claim 16 (depends on 15)

The one or more non-transitory, computer-readable storage media of claim 15, wherein the program or the portion of the program is specified in a probabilistic programming language.

### Claim 17 (depends on 15)

The one or more non-transitory, computer-readable storage media of claim 15, wherein, in traversing the tree, the programming instructions cause the one or more computing devices to implement determining whether a variable name is overloaded.

### Claim 18 (depends on 15)

The one or more non-transitory, computer-readable storage media of claim 15, wherein, in traversing the tree, the programming instructions cause the one or more computing devices to implement determining whether more than one global references points to a same array.

### Claim 19 (depends on 15)

The one or more non-transitory, computer-readable storage media of claim 15, wherein, in traversing the tree, the programming instructions cause the one or more computing devices to implement determining whether one of the set of array references to the array is placed in two or more other arrays.

### Claim 20 (depends on 15)

The one or more non-transitory, computer-readable storage media of claim 15,
wherein, in traversing the tree, the programming instructions cause the one or more computing devices to implement determining whether the first set of variables is within scope of at least:
a for statement;
an if-else statement; or
the for statement and the if-else statement.
