Anomaly Analyzer Detects Semantic Code Defects

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional compilers fail to identify semantic code errors, which can lead to hardware faults and substantial financial, safety, and public relations damage, as they only detect syntactical errors and not the semantic issues that can cause code defects.

Innovation Solution

The development of an anomaly analyzer system that generates directed acyclic graphs (DAGs) from code blocks, performs abstraction to identify invariants, and compares these to learned models to detect semantic defects, providing notifications and corrections for code errors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional compilers are used for code error checking, then syntactical errors can be detected, but semantic code errors cannot be identified

Engineering Contradiction:
Improvecode error detection capabilityVSAvoidcode quality
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The patent introduces an anomaly analyzer as an intermediary component between the traditional compiler and the code. This analyzer uses machine learning models trained on code invariants to detect semantic errors that traditional compilers miss. The intermediary processes the compiled code and identifies anomalies based on learned patterns of correct code behavior, thereby improving both detection precision and code reliability without replacing the traditional compilation process.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical, rule-based error checking system of traditional compilers with an intelligent system based on machine learning. Instead of relying on fixed syntactical rules, the system uses trained models that have learned semantic patterns from large datasets of correct and incorrect code. This substitution enables the detection of semantic errors that cannot be caught by conventional mechanical checking methods.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Measurement precision

If anomaly analyzer with machine learning models is implemented, then semantic code errors can be detected, but system complexity increases

Engineering Contradiction:
Improvesemantic error detection accuracyVSAvoidsystem architecture complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by training the machine learning models on comprehensive datasets of code invariants before deployment. The models are pre-trained to recognize patterns of correct code behavior across various programming languages and code structures. This preliminary training phase captures semantic rules and patterns that will be used during actual code analysis, enabling the system to detect semantic errors without requiring complex real-time processing rules.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by creating abstract representations of code invariants from large datasets of correct code. Instead of analyzing every aspect of code semantics directly, the system creates simplified copies or models of typical correct code patterns and behaviors. These copied invariants serve as reference models that the anomaly analyzer compares against actual code to identify semantic deviations, reducing the complexity of direct semantic analysis.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11704226B2Methods, systems, articles of manufacture and apparatus to detect code defects
Publication Date: 2023.07.18 INTEL CORP
  • US11704226B2 patent drawing
  • US11704226B2 patent drawing
  • US11704226B2 patent drawing

AI summary

Methods, apparatus, systems, and articles of manufacture are disclosed to detect code defects. An example apparatus includes repository interface circuitry to retrieve code repositories corresponding to a programming language of interest, tree generating circuitry to generate parse trees corresponding to code blocks contained in the code repositories, directed acyclic graph (DAG) circuitry to generate DAGs corresponding to respective ones of the parse trees, the DAGs including control flow information and data flow information, abstraction generating circuitry to abstract the DAGs, invariant identification circuitry to extract invariants from the abstracted DAGs, and DAG comparison circuitry to cluster respective ones of the extracted invariants to identify respective ones of the abstracted DAGs with common invariants.