Program Module Hierarchical Structure Comparison for Semantic Equivalence
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
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
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.
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.
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
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.
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.
Data Source
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.


