C++ Inheritance Remover for Analysis-Friendly Program Transformation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional analysis techniques for C++ programs are ineffective due to features like multiple class inheritance, complex expressions, and implicit function calls, which complicate program analysis and testing by introducing analysis-hindering elements such as virtual function pointer tables and runtime libraries.

Innovation Solution

A system and method that transform C++ programs to remove inheritance, converting implicit expressions and function calls to explicit ones, and eliminating virtual-function pointer tables and runtime libraries, resulting in an analysis-friendly program that preserves the original program's semantics, using techniques like the CHROME and FORM object models.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If multiple class inheritance is used in C++ programs, then program functionality and abstraction are improved, but program analysis complexity increases due to virtual function pointer tables and runtime libraries

Engineering Contradiction:
Improveprogram functionalityVSAvoidprogram analysis complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent extracts and removes inheritance-related components (virtual function pointer tables, runtime libraries, implicit expressions) from the C++ program to create a simplified version suitable for analysis. This extraction process separates the problematic inheritance features while preserving the core program logic and semantics, directly resolving the contradiction between maintaining program functionality and reducing analysis complexity

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent segments the C++ program into distinct components: inheritance-related elements (virtual function tables, implicit expressions) and core program logic. By segmenting and treating these separately, the analysis tool can focus on the core logic without being overwhelmed by inheritance complexity, while still accounting for inheritance effects through systematic transformation rules

Inventive Principle:
Principle #1Segmentation

2Speed

If conventional lowering techniques are used to translate C++ programs, then run-time performance is optimized, but program analysis effectiveness deteriorates due to complex pointer arithmetic and virtual function tables

Engineering Contradiction:
Improverun-time performanceVSAvoidprogram analysis effectiveness
Core Design Contradiction:
SpeedVSDifficulty of detecting and measuring

Solution Approach 1:

The patent implements a dynamic transformation approach that adapts the program representation based on the analysis needs. Rather than using a fixed conventional lowering, the system dynamically removes or simplifies inheritance-related features that hinder analysis, while preserving enough structure to maintain semantic equivalence. This dynamic adaptation allows the same framework to serve both performance-optimized and analysis-friendly scenarios

Inventive Principle:
Principle #15Dynamics

3Reliability

If inheritance-related features are preserved in the translated program, then semantic equivalence is maintained, but analysis-hindering features such as virtual function pointer tables remain

Engineering Contradiction:
Improvesemantic equivalenceVSAvoidanalysis-hindering features
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent converts the harmful effect of inheritance features (which complicate analysis) into a benefit by systematically transforming and removing these features while preserving their semantic effects. The virtual function pointer tables and implicit expressions are eliminated, but their behavioral consequences are maintained through explicit transformation rules, turning analysis-obstructing elements into analysis-friendly constructs

Inventive Principle:
Principle #22Blessing in disguise (Convert harm into benefit)

Solution Approach 2:

The patent introduces an intermediate transformation phase between conventional lowering and final analysis. This intermediary step systematically processes the lowered program to remove inheritance-related features while maintaining semantic equivalence. The intermediary transformation acts as a mediator that bridges the gap between performance-optimized lowered code and analysis-friendly simplified code

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8707278B2Embedding class hierarchy into object models for multiple class inheritance
Publication Date: 2014.04.22 NEC CORP
  • US8707278B2 patent drawing
  • US8707278B2 patent drawing
  • US8707278B2 patent drawing

AI summary

A model is provided for transforming a program with a priori given class hierarchy that is induced by inheritance. An inheritance remover is configured to remove inheritance from a given program to produce an analysis-friendly program which does not include virtual-function pointer tables and runtime libraries associated with inheritance-related operations. The analysis-friendly program preserves the semantics of the given program with respect to a given class hierarchy. A clarifier is configured to identify implicit expressions and function calls and transform the given program into at least one intermediate program having explicit expressions and function calls.