Subroutine Graphs for Formal Language Processing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing formal language processing methods face challenges in efficiently managing intermediate representations of code, particularly in compilers, due to substantial memory usage and redundancy when expanding subgraphs during graph construction, leading to large generated files that are not manageable by modern compilers.

Innovation Solution

The method involves decomposing entire graphs into subroutine graphs, using stack-based processing to represent positions as node stacks, and employing pre-order traversal, path tracing, and labeling to navigate and analyze graphs without expanding them, thereby reducing memory usage and generating compact, efficient code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If subgraphs are expanded during graph construction in formal language processing, then complete graph representations can be obtained, but memory usage increases substantially and generated files become large and unmanageable

Engineering Contradiction:
Improvecompleteness of graph representationVSAvoidmemory usage and file size
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent divides the entire graph into multiple subroutine graphs, where each subroutine graph represents a portion of the overall computation. Instead of expanding and storing the complete graph, the system processes and stores individual subroutine graphs separately, then combines them during execution. This segmentation reduces memory usage while maintaining the ability to represent complete graph structures when needed.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements a nested structure where subroutine graphs contain embedded position information and references to other subroutine graphs. Each subroutine graph is self-contained with metadata about its position in the overall graph structure, allowing the system to reconstruct the complete graph representation through nested references without physically expanding all subgraphs simultaneously in memory.

Inventive Principle:
Principle #7Nested doll (Nesting)

2Measurement precision

If entire graphs are expanded for processing, then complete analysis can be performed, but runtime performance decreases due to large data structures

Engineering Contradiction:
Improvecompleteness of graph analysisVSAvoidruntime performance
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent performs preliminary classification of subroutines and pre-computation of position information during the graph construction phase. By organizing subroutine graphs with pre-calculated position metadata and establishing reference relationships in advance, the system eliminates the need for expensive graph expansion operations during runtime, thereby improving performance while maintaining analysis completeness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent extracts and stores only the essential position information and structural metadata from complete graph expansions. Instead of maintaining full graph expansions in memory, the system extracts critical position data and stores compact representations that can be used for analysis without requiring the complete graph structure to be physically present, thus improving runtime performance.

Inventive Principle:
Principle #2Taking out (Extraction)

3Measurement precision

If graph positions are tracked using traditional methods, then accurate position information can be obtained, but memory consumption increases

Engineering Contradiction:
Improveaccuracy of position trackingVSAvoidmemory consumption
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent implements local quality by storing position information in a distributed manner across individual subroutine graphs rather than maintaining a single global position structure. Each subroutine graph contains local position metadata that is sufficient for analyzing that specific subroutine, eliminating the need to load and maintain complete global graph position information in memory, thus reducing memory consumption while preserving position tracking accuracy.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS11262988B2Method and system for using subroutine graphs for formal language processing
Publication Date: 2022.03.01 CRAYMER III LORING G
  • US11262988B2 patent drawing
  • US11262988B2 patent drawing
  • US11262988B2 patent drawing

AI summary

A method to process subroutine-structured graph-based intermediate representations during formal language processing implemented by a computing device. The method includes classifying a set of subroutines identified in an intermediate representation of code according to mutually recursive relationships between subroutines in the set of subroutines, recording the mutually recursive relationships, labeling to track the mutually recursive relationships, constructing a set of graph representations, collecting partial positions that distinguish points of action in generated code, labeling nodes of the graph of the intermediate representation, generating a subsequent intermediate representation by serialization of the graph of the intermediate representation through pre-order depth-first traversal, and creating the generated code from the intermediate representation.