# US 2023/0266967 A1 · Method and system for mapping intermediate representation objects for facilitating incremental analysis

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

- Number: US 2023/0266967 A1
- Document ID: US20230266967A1
- Status: Published application
- Kind: A1
- Application number: 18/146,702
- Filed: 2022-12-27
- Published: 2023-08-24
- Earliest claimed: 2022-02-24
- Assignees: Tata Consultancy Services Limited
- Applicants: Tata Consultancy Services Limited
- Inventors: ANUSHRI JANA; ANKITA SHAMRAO KHADSARE; VAIDEHI MANOJ GHIME; BHARTI CHIMDYALWAR
- Web page: https://patentgrep.com/patent/US20230266967A1

## CPC

- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 8/75: Structural analysis for program understanding
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

For performing incremental analysis, analysis tools may reuse analysis information computed earlier for intermediate representation (IR) objects that remain unchanged between versions of program. But identification numbers (IDs) of unchanged IR objects change over versions due to changes with each run of incremental analysis, thereby making it difficult to reuse analysis information as tools require IDs of unchanged IR objects from previous versions. Present disclosure provides method and system for mapping IR objects for facilitating incremental analysis. The system first extracts attributes associated with each IR object present in previous version to create data structure for storing IR objects. The system then determines unchanged lines between versions to create line number map. Thereafter, system uses line number map to create ID-based IR mapping between ID of each unchanged IR object present in each unchanged line in current version and ID of each IR object stored in data structure.

## Claims

### Claim 1

A processor implemented method, comprising:
receiving, by an intermediate representation mapping system (IRMS) via one or more hardware processors, a current version and a previous version of a computer program, and an intermediate representation (IR) associated with each of the current version and the previous version of the computer program, wherein the IR associated with each of the current version and the previous version comprises one or more IR objects;
extracting, by the IRMS via the one or more hardware processors, one or more attributes associated with each IR object of the one or more IR objects present in the previous version of the computer program, the one or more attributes comprising a line number, an object type, an identification number (ID), and a name;
creating, by the IRMS via the one or more hardware processors, a data structure for storing the one or more IR objects present in the previous version of the computer program, wherein each IR object is stored in the data structure based on the one or more attributes extracted for a respective IR object;
comparing, by the IRMS via the one or more hardware processors, the current version and the previous version of the computer program using a data comparison tool to determine one or more lines that are unchanged between the current version and the previous version of the computer program;
creating, by the IRMS via the one or more hardware processors, a line number map based on the one or more unchanged lines, the line number map comprising a line number-based mapping between each unchanged line in the current version and a respective unchanged line in the previous version of the computer program; and
creating, by the IRMS via the one or more hardware processors, an ID-based IR mapping between the ID of each unchanged IR object of one or more unchanged IR objects present in each unchanged line in the current version and the ID of each IR object stored in the data structure using the created line number map.

### Claim 2 (depends on 1)

The processor implemented method of claim 1, wherein each unchanged IR object of the one or more unchanged IR objects comprises the one or more attributes.

### Claim 3 (depends on 2)

The processor implemented method of claim 2, wherein the step of creating, by the IRMS via the one or more hardware processors, the ID-based IR mapping between ID of each unchanged IR object of one or more unchanged IR objects present in each unchanged line in the current version and ID of each IR object stored in the data structure using the created line number map comprises:
for each unchanged IR object of the one or more unchanged IR objects, performing:
determining, by the IRMS via the one or more hardware processors, whether a line number of each unchanged IR object has a mapped line number in the line number map;
accessing, by the IRMS via the one or more hardware processors, the one or more IR objects that are stored corresponding to the mapped line number from the data structure based on the determination;
determining, by the IRMS via the one or more hardware processors, a matching IR object among the one or more accessed IR objects for each unchanged IR object, wherein the matching is performed based on the name and the object type attribute of the unchanged IR object;
accessing, by the IRMS via the one or more hardware processors, the ID of the matching IR object based on the determination;
creating, by the IRMS via the one or more hardware processors, the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object determined for the corresponding unchanged IR object; and
updating, by the IRMS via the one or more hardware processors, a mapping attribute of the matching IR object as mapped in the data structure.

### Claim 4 (depends on 3)

The processor implemented method of claim 3, wherein the step of creating, by the IRMS via the one or more hardware processors, the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object comprises:
checking, by the IRMS via the one or more hardware processors, whether the mapping attribute of the matching IR object is mapped or not; and
upon determining that the mapping attribute of the matching IR object is not mapped, creating, by the IRMS via the one or more hardware processors, the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object determined for a corresponding unchanged IR object.

### Claim 5 (depends on 4)

The processor implemented method of claim 4, further comprising:
upon determining that the mapping attribute of the matching IR object is mapped, determining, by the IRMS via the one or more hardware processors, a next matching IR object among the one or more accessed IR objects for each unchanged IR object;
accessing, by the IRMS via the one or more hardware processors, the ID of the next matching IR object;
creating, by the IRMS via the one or more hardware processors, the ID-based IR mapping between the ID of each unchanged IR object and the ID of a next matching IR object determined for the corresponding unchanged IR object; and
updating, by the IRMS via the one or more hardware processors, the mapping attribute of the next matching IR object as mapped in the data structure.

### Claim 6 (depends on 1)

The processor implemented method of claim 1, further comprising:
using, by the IRMS via the one or more hardware processors, the ID-based IR mapping for performing incremental analysis of the computer program.

### Claim 7

An intermediate representation mapping system (IRMS), comprising:
a memory storing instructions;
one or more communication interfaces; and
one or more hardware processors coupled to the memory via the one or more communication interfaces, wherein the one or more hardware processors are configured by the instructions to:
receive a current version and a previous version of a computer program, and an intermediate representation (IR) associated with each of the current version and the previous version of the computer program, wherein the IR associated with each of the current version and the previous version comprises one or more IR objects;
extract one or more attributes associated with each IR object of the one or more IR objects present in the previous version of the computer program, the one or more attributes comprising a line number, an object type, an identification number (ID), and a name;
create a data structure for storing the one or more IR objects present in the previous version of the computer program, wherein each IR object is stored in the data structure based on the one or more attributes extracted for a respective IR object;
compare the current version and the previous version of the computer program using a data comparison tool to determine one or more lines that are unchanged between the current version and the previous version of the computer program;
create a line number map based on the one or more unchanged lines, the line number map comprising a line number-based mapping between each unchanged line in the current version and the respective unchanged line in the previous version of the computer program; and
create an ID-based IR mapping between the ID of each unchanged IR object of one or more unchanged IR objects present in each unchanged line in the current version and the ID of each IR object stored in the data structure using the created line number map.

### Claim 8 (depends on 7)

The system as claimed in claim 7, wherein each unchanged IR object of the one or more unchanged IR objects comprises the one or more attributes.

### Claim 9 (depends on 8)

The system as claimed in claim 8, wherein the one or more hardware processors are configured to create the ID-based IR mapping between the ID of each unchanged IR object of one or more unchanged IR objects present in each unchanged line in the current version and the ID of each IR object stored in the data structure using the created line number map by performing:
for each unchanged IR object of the one or more unchanged IR objects,
determining whether a line number of each unchanged IR object has a mapped line number in the line number map;
accessing the one or more IR objects that are stored corresponding to the mapped line number from the data structure based on the determination;
determining a matching IR object among the one or more accessed IR objects for each unchanged IR object, wherein the matching is performed based on the name and the object type attribute of the unchanged IR object;
accessing the ID of the matching IR object based on the determination;
creating the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object determined for the corresponding unchanged IR object; and
updating a mapping attribute of the matching IR object as mapped in the data structure.

### Claim 10 (depends on 9)

The system as claimed in claim 9, wherein the one or more hardware processors are configured to create the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object by performing:
checking whether the mapping attribute of the matching IR object is mapped or not; and
upon determining that the mapping attribute of the matching IR object is not mapped, creating the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object determined for a corresponding unchanged IR object.

### Claim 11 (depends on 10)

The system as claimed in claim 10, wherein the one or more hardware processors are configured to:
upon determining that the mapping attribute of the matching IR object is mapped, determine a next matching IR object among the one or more accessed IR objects for each unchanged IR object;
access the ID of the next matching IR object;
create the ID-based IR mapping between the ID of each unchanged IR object and the ID of a next matching IR object determined for the corresponding unchanged IR object; and
update the mapping attribute of the next matching IR object as mapped in the data structure.

### Claim 12 (depends on 7)

The system as claimed in claim 7, wherein the one or more hardware processors are configured to:
use the ID-based IR mapping for performing incremental analysis of the computer program.

### Claim 13

One or more non-transitory machine-readable information storage mediums comprising one or more instructions which when executed by one or more hardware processors cause:
receiving, by an intermediate representation mapping system (IRMS), a current version and a previous version of a computer program, and an intermediate representation (IR) associated with each of the current version and the previous version of the computer program, wherein the IR associated with each of the current version and the previous version comprises one or more IR objects;
extracting, by the IRMS, one or more attributes associated with each IR object of the one or more IR objects present in the previous version of the computer program, the one or more attributes comprising a line number, an object type, an identification number (ID), and a name;
creating, by the IRMS, a data structure for storing the one or more IR objects present in the previous version of the computer program, wherein each IR object is stored in the data structure based on the one or more attributes extracted for a respective IR object;
comparing, by the IRMS, the current version and the previous version of the computer program using a data comparison tool to determine one or more lines that are unchanged between the current version and the previous version of the computer program;
creating, by the IRMS, a line number map based on the one or more unchanged lines, the line number map comprising a line number-based mapping between each unchanged line in the current version and a respective unchanged line in the previous version of the computer program; and
creating, by the IRMS, an ID-based IR mapping between the ID of each unchanged IR object of one or more unchanged IR objects present in each unchanged line in the current version and the ID of each IR object stored in the data structure using the created line number map.

### Claim 14 (depends on 13)

The one or more non-transitory machine-readable information storage mediums of claim 13, wherein each unchanged IR object of the one or more unchanged IR objects comprises the one or more attributes.

### Claim 15 (depends on 14)

The one or more non-transitory machine-readable information storage mediums of claim 14, wherein the step of creating, by the IRMS, the ID-based IR mapping between ID of each unchanged IR object of one or more unchanged IR objects present in each unchanged line in the current version and ID of each IR object stored in the data structure using the created line number map comprises:
for each unchanged IR object of the one or more unchanged IR objects, performing:
determining, by the IRMS, whether a line number of each unchanged IR object has a mapped line number in the line number map;
accessing, by the IRMS, the one or more IR objects that are stored corresponding to the mapped line number from the data structure based on the determination;
determining, by the IRMS, a matching IR object among the one or more accessed IR objects for each unchanged IR object, wherein the matching is performed based on the name and the object type attribute of the unchanged IR object;
accessing, by the IRMS, the ID of the matching IR object based on the determination;
creating, by the IRMS, the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object determined for the corresponding unchanged IR object; and
updating, by the IRMS, a mapping attribute of the matching IR object as mapped in the data structure.

### Claim 16 (depends on 15)

The one or more non-transitory machine-readable information storage mediums of claim 15, wherein the step of creating, by the IRMS, the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object comprises:
checking, by the IRMS, whether the mapping attribute of the matching IR object is mapped or not; and
upon determining that the mapping attribute of the matching IR object is not mapped, creating, by the IRMS, the ID-based IR mapping between the ID of each unchanged IR object and the ID of the matching IR object determined for a corresponding unchanged IR object.

### Claim 17 (depends on 16)

The one or more non-transitory machine-readable information storage mediums of claim 16, wherein the one or more instructions which when executed by the one or more hardware processors further cause:
upon determining that the mapping attribute of the matching IR object is mapped, determining, by the IRMS, a next matching IR object among the one or more accessed IR objects for each unchanged IR object;
accessing, by the IRMS, the ID of the next matching IR object;
creating, by the IRMS, the ID-based IR mapping between the ID of each unchanged IR object and the ID of a next matching IR object determined for the corresponding unchanged IR object; and
updating, by the IRMS, the mapping attribute of the next matching IR object as mapped in the data structure.

### Claim 18 (depends on 13)

The one or more non-transitory machine-readable information storage mediums of claim 13, wherein the one or more instructions which when executed by the one or more hardware processors further cause:
using, by the IRMS, the ID-based IR mapping for performing incremental analysis of the computer program.
