Program Module Hierarchical Structure Comparison for Semantic Equivalence

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing program comparison techniques, such as those disclosed in Patent Document 1, struggle to accurately identify semantically equivalent parts during program maintenance, especially when programming languages or environments change, leading to incorrect identification of differences.

Innovation Solution

An apparatus that compares two modules by analyzing their hierarchical structures formed through conditional statements, including executable-on-satisfaction and executable-on-failure statements, to determine if the structures are identical, thereby identifying semantically equivalent parts.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If program comparison is performed using token arrangements (reserved words, character constants), then syntactic differences can be detected, but semantically equivalent parts are incorrectly identified as different when programming languages or environments change

Engineering Contradiction:
Improvedifference detection accuracyVSAvoidapplicability to program conversion
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent segments the program comparison process into two distinct levels: (1) token-level comparison for syntactic differences, and (2) hierarchical structure comparison for semantic equivalence. By dividing the comparison into these segments, the system can detect both syntactic changes and semantic equivalences independently, resolving the contradiction between detection accuracy and adaptability to language changes.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a new dimension of comparison by analyzing the hierarchical structure of conditional statements (IF-THEN-ELSE, CASE-OF-END) separately from token arrangements. This adds a structural dimension to the comparison process, allowing the system to evaluate semantic equivalence through control flow hierarchy while token comparison handles syntactic details, thus enabling both precise detection and conversion applicability.

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

2Reliability

If every sentence of a large program system is examined for conversion, then completeness of conversion is improved, but the complexity and difficulty of verification increases significantly

Engineering Contradiction:
Improveconversion completenessVSAvoidverification system complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the verification task by comparing hierarchical structures at different levels: top-level module structure, conditional statement hierarchy, and nested control flow. This segmentation allows verification to be performed systematically on large programs without overwhelming complexity, as each segment can be analyzed independently while contributing to overall conversion completeness.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by focusing verification efforts on the hierarchical structure of conditional statements, which represents a critical subset of program logic. Rather than requiring complete analysis of every single sentence, the system concentrates on the structural hierarchy that determines semantic equivalence, achieving reliable verification with reduced complexity.

Inventive Principle:
Principle #16Partial or excessive action

3Adaptability or versatility

If program maintenance is performed to adapt to environment replacement (OS, middleware, hardware), then program adaptability is improved, but verification of correct maintenance becomes difficult

Engineering Contradiction:
Improveprogram environment compatibilityVSAvoidmaintenance verification accuracy
Core Design Contradiction:
Adaptability or versatilityVSMeasurement precision

Solution Approach 1:

The patent addresses environment adaptation verification by introducing hierarchical structure comparison as an additional dimension beyond token-level analysis. When programs are maintained for different environments, the hierarchical control flow structure often remains semantically equivalent even if tokens change. This dimensional addition enables accurate verification of maintenance correctness by focusing on structural invariance.

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

Solution Approach 2:

The patent uses hierarchical structure analysis as an intermediary mechanism between token-level changes and semantic equivalence verification. When environment adaptation causes token changes, the hierarchical structure serves as an intermediary layer that can detect whether the underlying logic remains equivalent, thus enabling accurate verification of maintenance correctness despite environmental differences.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9792197B2Apparatus and program
Publication Date: 2017.10.17 I SYST
  • US9792197B2 patent drawing
  • US9792197B2 patent drawing
  • US9792197B2 patent drawing

AI summary

This apparatus is provided with a storage device and a CPU. The storage device has two or more modules stored therein. The CPU acquires, from the storage device, a first module and a second module from among the modules stored in the storage device. Furthermore, the CPU creates a message that indicates whether a hierarchical structure of the first module matches a hierarchical structure of the second module.