Source Code Conversion via Knowledge Graph and AST

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing technologies face challenges in efficiently updating source code from an original programming language to a target programming language, particularly in ensuring compatibility with existing software infrastructure and reducing the computational complexity and resource consumption involved in this process.

Innovation Solution

The system generates a knowledge graph of the source code to identify unique data objects in the original programming language, masks these objects, predicts counterpart objects in the target language using NLP, and creates the new version of the source code in the target language, thereby reducing the need for extensive processing and memory resources.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If source code is converted from an original programming language to a target programming language using conventional methods, then the new version of source code can be provided to subscribers, but the process consumes excess amounts of processing and memory resources

Engineering Contradiction:
Improvesource code conversion efficiencyVSAvoidprocessing and memory resources
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The source code conversion process is segmented into distinct phases: parsing the original source code into an abstract syntax tree (AST), transforming the AST into the target programming language, and validating the converted code. This segmentation allows each phase to be optimized independently, reducing overall resource consumption during conversion.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

An abstract syntax tree (AST) is introduced as an intermediary representation between the original source code and the target programming language. The AST serves as a language-agnostic intermediate form that captures the semantic structure of the code, enabling efficient transformation to the target language without direct complex parsing and compilation operations.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If source code is converted from an original programming language to a target programming language, then the new version can be provided to subscribers, but the conversion process is computationally complex and requires a large amount of processing resources

Engineering Contradiction:
Improveprogramming language compatibilityVSAvoidconversion process complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The abstract syntax tree (AST) acts as a universal intermediary that simplifies the conversion process between different programming languages. By representing code structure in a language-agnostic format, the system reduces conversion complexity while maintaining adaptability to multiple source and target languages.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The conversion system is designed with universal components that can handle multiple programming languages through a common AST representation. The same conversion infrastructure serves multiple language pairs, reducing overall system complexity while maintaining broad language compatibility.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Adaptability or versatility

If conversion library functions are used to link existing software infrastructure stack with new version of source code in another programming language, then compatibility is achieved, but excess amounts of processing and memory resources are consumed

Engineering Contradiction:
Improvesoftware infrastructure compatibilityVSAvoidprocessing and memory resources
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

Instead of using heavy conversion library functions to link different programming languages, the system creates a copied representation of the original code's semantic structure in the target language through AST transformation. This copying approach in the abstract domain is more resource-efficient than maintaining runtime linkage through conversion libraries.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS20250028511A1Source code conversion from an original computer programming language to a target programming language
Publication Date: 2025.01.23 BANK OF AMERICA CORP
  • US20250028511A1 patent drawing
  • US20250028511A1 patent drawing
  • US20250028511A1 patent drawing

AI summary

A system identifies data objects from a first piece of code in an original programming language and creates a knowledge graph that represents a relationship among the data objects. The system identifies a particular data object that is unique to the original programming language. The system determines a counterpart data object that is used for a particular purpose as the identified data object in a target programming language. The system creates a second piece of code in the target programming language by replacing the particular data object with the counterpart data object. The system determines if the second piece of code is configured to perform a task that the first piece of code is programmed to perform. In response to determining that the second piece of code is configured to perform the particular task, the system executes the second piece of code.