Metadata-Driven Source Code Translation with Global Symbol Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing tools face difficulties in translating computer program source code from one high-level language to another while maintaining functional equivalence and relating the converted code to the original source code, leading to challenges in maintaining and enhancing programs across different development systems and environments.

Innovation Solution

A system and method that analyzes source code in a first high-level language, generates a data structure with globally unique identifiers, and creates metadata to map semantic entities between the original and target languages, ensuring functional equivalence and annotating the converted code with conversion details.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If source code is converted from one high-level language to another using existing tools, then code translation is achieved, but traceability between original and converted code is lost

Engineering Contradiction:
Improvecode translation capabilityVSAvoidtraceability information
Core Design Contradiction:
Adaptability or versatilityVSLoss of information

Solution Approach 1:

The system performs preliminary actions by injecting globally unique identifiers into the original source code before conversion, and by pre-configuring the conversion tool with metadata templates. This ensures that traceability information is established in advance, allowing the converted code to maintain links to the original code despite language translation.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces metadata as an intermediary element that bridges the original source code and the converted code. This metadata contains mapping information that links symbols in the converted code back to their corresponding symbols in the original code, enabling traceability even though the code has been translated to a different language.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If code conversion tools are used to translate source code between languages, then translation speed is improved, but functional equivalence verification becomes difficult

Engineering Contradiction:
Improvetranslation speedVSAvoidfunctional equivalence
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system implements feedback mechanisms by generating metadata that maps converted code symbols back to original code symbols. This metadata serves as feedback information that allows verification of functional equivalence, enabling the system to check whether the converted code correctly represents the original code's functionality while maintaining high translation speed.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The conversion tool performs preliminary analysis of the original source code to identify symbols and generate corresponding metadata before the actual conversion process. This preliminary action ensures that functional equivalence can be verified afterward by comparing the metadata mappings, while the actual code translation proceeds efficiently.

Inventive Principle:
Principle #10Preliminary action

3Loss of information

If detailed metadata mapping is generated to maintain traceability, then code relationship tracking is improved, but system complexity increases

Engineering Contradiction:
Improvecode relationship informationVSAvoidmetadata system complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent applies local quality by generating metadata only for specific symbols that require traceability, rather than creating comprehensive metadata for all code elements. The globally unique identifiers are injected only where needed to maintain functional equivalence, reducing overall system complexity while preserving essential traceability information.

Inventive Principle:
Principle #3Local quality

4Loss of information

If globally unique identifiers are injected into all symbols, then traceability is maintained, but processing time increases

Engineering Contradiction:
Improvesymbol identification informationVSAvoidcode processing time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system applies partial action by injecting globally unique identifiers only into symbols that require traceability (such as functions, classes, and variables that need mapping), rather than into all code elements. This selective approach maintains necessary traceability information while minimizing the processing time overhead associated with identifier injection.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS10592220B2Metadata-driven binding of converted source code to original source code
Publication Date: 2020.03.17 ORACLE INT CORP
  • US10592220B2 patent drawing
  • US10592220B2 patent drawing
  • US10592220B2 patent drawing

AI summary

Systems, apparatuses, and methods for converting computer program source code from a first high level language to a functionally equivalent second high level language different from the first high level language. Source code in a first high level language that includes a plurality of name spaces is analyzed by a code conversion tool. A data structure representing the source code in the first language is generated that includes at least an identification of each symbol used within the source code in the first language. An identifier is generated for each of the identified symbols, wherein the identifier is globally unique within an entire codebase of the source code in the first high level language. Source code in the second high level programming language is generated that is functionally equivalent to the source code in the first high level programming language. Metadata is also generated that maps symbols corresponding to a semantic entity in the source code of the second high level language to symbols corresponding to a semantic entity definition in the source code of the first high level language.