AI-Generated Programs Using Compiler Semantic Context

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

AI models often limit the amount of contextual information that can be included with a request, making it difficult to provide all relevant information for determining code attributes, and the processing cost and time increase with the amount of content provided.

Innovation Solution

A computer program is generated by an AI model using compiler-gathered semantic information, allowing it to determine code attributes efficiently and accurately by utilizing an AI prompt and semantic information gathered by a compiler at compile time, reducing the need for extensive input to the AI model.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If all relevant contextual information is provided to the AI model, then the accuracy of code attribute determination is improved, but the processing cost and time increase substantially

Engineering Contradiction:
Improveaccuracy of code attribute determinationVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the information processing task into two phases: (1) The compiler performs static analysis and extracts semantic information during compile time, organizing it into structured representations; (2) The AI model receives only this pre-processed semantic information rather than the entire codebase. This segmentation allows comprehensive code analysis without overwhelming the AI model with raw code volume, resolving the contradiction between providing complete contextual information and maintaining efficient processing.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The compiler performs preliminary action by conducting static analysis, building abstract syntax trees, and extracting semantic information before the AI model processes the code. This pre-processing prepares the code representation in advance, transforming the raw code into structured semantic data that captures all relevant contextual information in a condensed format, thereby enabling accurate code attribute determination without requiring the AI model to process the entire original codebase.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If all relevant contextual information is provided to the AI model, then the accuracy of code attribute determination is improved, but the processing cost increases substantially

Engineering Contradiction:
Improveaccuracy of code attribute determinationVSAvoidprocessing cost
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system segments the computationally intensive static analysis task from the AI model processing task. The compiler handles the heavy lifting of code analysis, abstraction, and semantic extraction during compilation, while the AI model only processes the resulting compact semantic representations. This division of labor reduces the AI model's computational burden and associated costs while preserving access to comprehensive code context through the structured semantic information.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Instead of providing the AI model with copies of the entire original codebase, the system creates a compact copy or representation of the code's semantic structure through compiler-generated abstract syntax trees and intermediate representations. These copied semantic structures capture all essential contextual information in a condensed format that is much more efficient for the AI model to process, thereby reducing processing costs while maintaining determination accuracy.

Inventive Principle:
Principle #26Copying

3Device complexity

If AI models are used to analyze code directly without compiler assistance, then implementation simplicity is maintained, but the ability to access deep semantic information is limited

Engineering Contradiction:
Improveimplementation simplicityVSAvoidsemantic information access
Core Design Contradiction:
Device complexityVSLoss of information

Solution Approach 1:

The patent introduces the compiler as an intermediary between the code and the AI model. The compiler transforms raw code into structured semantic representations (abstract syntax trees, intermediate representations) that encode deep semantic information about code structure, data flow, and control flow. This intermediary translation layer enables the AI model to access rich semantic information without requiring the model itself to perform complex static analysis, thus resolving the contradiction between implementation simplicity and semantic information access.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP4632556A1Ai-based generation of a computer program using compiler-gathered semantic information about target code
Publication Date: 2025.10.15 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4632556A1 patent drawingFigure 1
  • EP4632556A1 patent drawingFigure 2
  • EP4632556A1 patent drawingFigure 3

AI summary

Techniques are described herein that are capable of performing AI-based generation of a computer program using compiler-gathered semantic information about target code. A user-generated request that requests information about target code is converted into an AI prompt, which requests that the AI model generate a computer program to determine the information. An AI model is caused to generate the computer program, which comprises configuring the computer program to determine, at runtime of the computer program, the information using semantic information about the target code gathered by a compiler and provided to the computer program by an API, by providing the AI prompt as an input to the AI model. A response to the AI prompt that includes the computer program is received from the AI model. Presentation of a representation of the computer program and/or automatic execution of the computer program against the target code is triggered.