Balanced N-ary Parse Tree Height Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Compiler parsing processes often result in skewed trees, which increase stack memory usage and compile time due to inefficient binary tree representations.

Innovation Solution

A method to generate a balanced parse tree by determining whether an n-ary parse tree is full, and accordingly, either increasing or maintaining the tree height based on the token stream, ensuring optimal height and reduced memory usage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a binary tree is used to represent concatenated operations in syntax analysis, then the associate laws are guaranteed, but the tree becomes skewed which increases stack memory usage and compile time

Engineering Contradiction:
Improveassociate laws guaranteeVSAvoidcompile time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent changes the fundamental parameter of tree structure from binary to n-ary, allowing nodes to have multiple children instead of just two. This structural parameter change enables the tree to accommodate concatenated operations more efficiently, reducing height and improving balance while maintaining the associate laws through proper node organization

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent transitions from a two-dimensional binary tree structure to an n-ary tree structure that effectively utilizes additional dimensional space in the tree hierarchy. This allows operations to be organized in a more balanced manner across multiple branches, reducing the height and improving overall tree balance

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

2Reliability

If a binary tree is used to represent concatenated operations in syntax analysis, then the associate laws are guaranteed, but the tree becomes skewed which increases stack memory usage

Engineering Contradiction:
Improveassociate laws guaranteeVSAvoidstack memory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent changes the fundamental parameter of tree structure from binary to n-ary, allowing nodes to have multiple children instead of just two. This structural parameter change enables the tree to accommodate concatenated operations more efficiently, reducing height and improving balance while maintaining the associate laws through proper node organization

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent transitions from a two-dimensional binary tree structure to an n-ary tree structure that effectively utilizes additional dimensional space in the tree hierarchy. This allows operations to be organized in a more balanced manner across multiple branches, reducing the height and improving overall tree balance

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

3Adaptability or versatility

If the parse tree height is increased to accommodate more tokens, then the tree can represent more operations, but the compile time and memory usage increase

Engineering Contradiction:
Improvetoken accommodation capacityVSAvoidcompile time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent changes the fundamental parameter of tree structure from binary to n-ary, allowing nodes to have multiple children instead of just two. This structural parameter change enables the tree to accommodate operations more efficiently, reducing height and improving balance while maintaining the associate laws through proper node organization

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent merges multiple operations into single n-ary nodes, combining what would traditionally require multiple binary tree levels into a single level. This consolidation reduces the overall tree height and improves efficiency by handling multiple operations simultaneously at each node level

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS10416971B2Method of creating the balanced parse tree having optimized height
Publication Date: 2019.09.17 TMAXTIBERO CO LTD
  • US10416971B2 patent drawing
  • US10416971B2 patent drawing
  • US10416971B2 patent drawing

AI summary

Provided is a computer program stored in a computer readable storage medium, which includes encoded commands, wherein when the computer program is executed by one or more processors of a computer system, the computer program allows the one or more processor to perform the following steps for generating a balanced parse tree having an optimized height, the steps including: receiving a token stream including at least one token—the token stream meets an associate law—; determining whether an n-ary parse tree is full—the n-ary parse tree includes at least one node and the at least one node each includes n or less child nodes; a first node generating operation of generating a node while increasing a height of the parse tree based on the token stream when the n-ary parse tree is full; and a second node generating operation of generating the node while maintaining the height of the parse tree based on the token stream when the n-ary parse tree is not full.