Semantic Diff Generation via Parse Tree Classification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current systems lack the ability to effectively generate and present semantic differences between electronic documents written in common coding languages, making it difficult to highlight and analyze textual variations between them.

Innovation Solution

A special-purpose machine is configured to parse documents into parse trees, classify subtrees, select comparison procedures based on shared classifications, and generate differential subtrees to indicate textual differences, ultimately presenting a graphical representation of these differences.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional diff commands are used to compare documents, then textual differences can be identified, but semantic differences cannot be effectively detected or presented

Engineering Contradiction:
Improvesemantic difference detection accuracyVSAvoiddocument analysis capability
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent segments documents into parse trees with hierarchical structures, dividing the document into grammatical components (sentences, phrases, words, tokens) that can be individually analyzed and compared for semantic meaning rather than just textual similarity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms the comparison parameter from simple text matching to semantic classification by assigning grammatical and semantic categories to parse tree nodes, enabling detection of meaningful differences beyond surface-level text changes

Inventive Principle:
Principle #35Parameter changes

2Reliability

If document comparison is performed without structured analysis, then processing is simple, but accuracy and usefulness of differences identified are limited

Engineering Contradiction:
Improvedocument comparison accuracyVSAvoidcomparison system structure
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent performs preliminary parsing and classification of documents into structured parse trees before comparison, organizing content by grammatical and semantic categories so that subsequent comparison operations can focus on meaningful semantic differences rather than raw text matching

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces parse trees as an intermediary representation between the original documents and the comparison process, serving as a structured medium that captures semantic relationships and enables more accurate semantic diff generation

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If semantic diff generation is implemented, then accurate semantic differences can be presented, but processing time and computational resources increase

Engineering Contradiction:
Improvesemantic difference accuracyVSAvoiddocument processing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent divides the semantic comparison task into hierarchical segments at the parse tree level, allowing comparison to proceed from root to leaves in a structured manner that can be optimized and parallelized, rather than analyzing entire documents as single units

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10558737B2Generating a semantic diff
Publication Date: 2020.02.11 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10558737B2 patent drawing
  • US10558737B2 patent drawing
  • US10558737B2 patent drawing

AI summary

Generation of a semantic diff is described. A machine according to some example embodiments generates first and second parse trees by parsing the first and second documents using a grammar of a coding language common to both documents. The machine classifies subtrees within these parse trees and determines that a first subtree from the first document shares a classification with a second subtree from the second document. Based on their sharing of the classification, the machine selects these two subtrees for comparison to each other and also chooses a comparison procedure based on the shared classification. The machine then executes the selected comparison procedure with the selected two subtrees as input and generates a differential subtree that indicates one or more differences between the two subtrees. The machine may also generate a differential tree that indicates differences between the entireties of the first and second documents.