Compiler Switch Hierarchy for Large Rules Sets

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing compilers face limitations such as symbol length violations in switch statements and class size limits when compiling large rules sets, leading to errors, performance degradation, and overload issues.

Innovation Solution

A cascading hierarchy of switches is generated to process unique identifiers for de-duplicated action codes, with each switch handling a limited number of bits, and a hierarchy of classes is created with a method per class limit to distribute methods across fewer class files, avoiding symbol length and class size limits.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a single switch statement is used to process all action codes in large rules sets, then comprehensive rule processing is achieved, but symbol length limits are violated causing compiler errors

Engineering Contradiction:
Improverule processing capabilityVSAvoidswitch statement symbol length
Core Design Contradiction:
Adaptability or versatilityVSLength of moving object

Solution Approach 1:

The patent divides a single large switch statement into multiple smaller switch statements organized in a hierarchical tree structure. Each switch processes a portion of the action code (e.g., 8 bits at a time) rather than the entire action code space, thereby avoiding symbol length violations while maintaining comprehensive rule processing capability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transitions from a single-dimensional switch statement processing all action codes to a multi-dimensional hierarchical structure where multiple switches operate at different levels. This dimensional transformation allows the system to process large action code spaces by breaking them into manageable segments across multiple processing stages.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Device complexity

If all methods are placed in a single class to simplify structure, then class hierarchy simplicity is maintained, but class size limits are exceeded causing compilation failures

Engineering Contradiction:
Improveclass structure simplicityVSAvoidclass file size
Core Design Contradiction:
Device complexityVSVolume of stationary object

Solution Approach 1:

The patent divides methods across multiple classes organized in a hierarchical structure. Each class contains a limited subset of methods (e.g., 100 methods per class) rather than all methods in one class, thereby avoiding class size limits while maintaining organized structure through inheritance and polymorphism.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces intermediate classes in the hierarchy that act as mediators between the root class and leaf implementation classes. These intermediate classes facilitate method distribution and inheritance, allowing the system to maintain structural organization while distributing methods across multiple classes to avoid size limits.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Speed

If the compiler processes all rules in a single pass to improve speed, then compilation speed is increased, but memory overload and performance degradation occur

Engineering Contradiction:
Improvecompilation speedVSAvoidmemory consumption
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent processes rules in segmented passes corresponding to different levels of the hierarchical switch structure. Instead of processing all rules in a single pass, the compiler processes subsets of rules at each hierarchical level sequentially, thereby reducing memory consumption while maintaining reasonable compilation speed through the structured approach.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11144288B1System and method for compiling rules set into bytecode using switch and class hierarchies
Publication Date: 2021.10.12 ADOBE INC
  • US11144288B1 patent drawing
  • US11144288B1 patent drawing
  • US11144288B1 patent drawing

AI summary

Embodiments of the present disclosure are directed to a system, methods, and computer-readable media for compiling source code into bytecode using a compiler. Using a rules set as input, a compiler de-duplicates action codes in the rules and assigns a unique identifier to each action code. The compiler generates a cascading hierarchy of switches that process discrete portions of the unique identifiers in order to invoke methods. The methods are assigned to classes using a method-per-class limit, and bytecode is generated from the class-assigned methods.