API for Transforming Symbolic Description Language Representations

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing technologies for Java programming face limitations in reflecting and transforming source code due to the loss of language constructs during compilation to bytecode, and the insufficient information provided by code reflection for generating new code or transforming original programs.

Innovation Solution

An application programming interface (API) is developed for building and transforming symbolic description language (SDL) representations of source code, allowing for the preservation of language constructs and enabling transformations such as lowering SDL dialects and inlining anonymous functions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If Java source code is compiled to bytecode, then the code can be executed by the Java Virtual Machine, but language constructs such as lambda expressions, try/catch/finally blocks, loops, and patterns are lost

Engineering Contradiction:
ImproveexecutabilityVSAvoidlanguage constructs
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent introduces an intermediary representation called Symbolic Description Language (SDL) that preserves language constructs while enabling bytecode execution. The SDL acts as a mediator between source code and bytecode, maintaining structural information that would otherwise be lost during compilation.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the compilation process into multiple stages: source code → SDL representation → bytecode. This segmentation allows the SDL layer to preserve language constructs while still enabling eventual execution, resolving the contradiction between maintaining information and achieving executability.

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If code reflection is used to inspect runtime properties, then surface details such as type names, fields, and method declarations can be obtained, but the code of method bodies remains opaque and cannot be queried

Engineering Contradiction:
Improvereflection capabilityVSAvoidmethod body code
Core Design Contradiction:
Ease of operationVSLoss of information

Solution Approach 1:

The SDL representation serves as an intermediary that bridges the gap between bytecode and source code inspection. It provides a structured representation of method bodies that can be queried via reflection, making previously opaque code accessible while maintaining runtime operation capabilities.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent creates a symbolic copy of the source code structure in SDL format that preserves method body information. This copy can be inspected and transformed at runtime without affecting the actual executing bytecode, enabling reflection on method bodies while maintaining execution integrity.

Inventive Principle:
Principle #26Copying

3Difficulty of detecting and measuring

If ad-hoc solutions are implemented to access bytecode information, then some bytecode details can be obtained, but the solutions are platform dependent and require modifying the compiler itself

Engineering Contradiction:
Improvebytecode accessibilityVSAvoidplatform dependency
Core Design Contradiction:
Difficulty of detecting and measuringVSDevice complexity

Solution Approach 1:

The SDL representation provides a universal interface for accessing and transforming code information that works across different platforms and compiler implementations. It standardizes the representation of language constructs, eliminating platform dependency while maintaining bytecode accessibility.

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

Solution Approach 2:

The SDL layer acts as a platform-independent intermediary between the compiler and runtime environments. It provides standardized access to code information without requiring compiler modifications, resolving the contradiction between accessibility and platform dependency.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Adaptability or versatility

If reflection operations are performed on bytecode, then runtime query capabilities are available, but sufficient information is not provided to generate new code that preserves originating code's language structures

Engineering Contradiction:
Improvecode transformation capabilityVSAvoidlanguage structures
Core Design Contradiction:
Adaptability or versatilityVSLoss of information

Solution Approach 1:

The SDL representation creates a structured copy of the source code that preserves language constructs in a transformable format. This symbolic copy enables code generation and transformation operations while maintaining the structural information necessary to preserve language features in the output.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent transforms the code representation from bytecode format to SDL format, changing the parameters of the representation to include preserved language constructs. This parameter change enables transformations that generate new code while maintaining language structure information.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250045033A1Application Programming Interface For Building And Transforming Symbolic Description Language Representations Of Source Code
Publication Date: 2025.02.06 ORACLE INT CORP
  • US20250045033A1 patent drawing
  • US20250045033A1 patent drawing
  • US20250045033A1 patent drawing

AI summary

Techniques for building and transforming SDL representations of source code are disclosed, including: receiving, by an application programming interface (API), an API call including a symbolic description language (SDL) representation of a set of source code; determining, by the API based at least on the first API call, one or more transformations to perform on the SDL representation of the set of source code; generating, by the API, a transformed SDL representation at least by performing the one or more transformations on the SDL representation of the set of source code; supplying, by the API responsive to the first API call, the transformed SDL representation.