Source Code Modularization for Static Verification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current static verification tools face challenges in efficiently analyzing large software code, either taking too long when analyzing the entire code at once or providing less accurate results when analyzing it part by part, due to the lack of knowledge about interactions between code parts.

Innovation Solution

A software verification tool that automatically modularizes source code into smaller modules based on a graph of variables and functions, minimizing public variables and functions in each module, allowing for serial or parallel verification and improving accuracy by reducing the complexity of each module.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the static verification tool analyzes the entire source code at once, then the verification completeness is improved, but the verification time increases significantly

Engineering Contradiction:
Improveverification completenessVSAvoidverification time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent divides the source code into multiple modules based on a graph representation where nodes represent code elements and edges represent dependencies. This segmentation allows the verification tool to process each module separately rather than analyzing the entire codebase at once, thereby reducing verification time while maintaining completeness through systematic coverage of all modules.

Inventive Principle:
Principle #1Segmentation

2Loss of time

If the static verification tool analyzes the source code part by part, then the verification time is reduced, but the verification accuracy decreases due to lack of knowledge about interactions between code parts

Engineering Contradiction:
Improveverification timeVSAvoidverification accuracy
Core Design Contradiction:
Loss of timeVSMeasurement precision

Solution Approach 1:

The patent performs preliminary actions by creating a comprehensive graph of the source code that captures all dependencies and interactions between code elements before segmentation. This graph is used to guide the modularization process, ensuring that when code is divided into modules, the essential interactions are preserved through carefully selected public interfaces. This preliminary graph construction enables accurate verification of individual modules while maintaining knowledge of their interactions.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary structure (the graph-based module interface definition) that mediates between the segmented code modules. This intermediary captures the interactions between modules through defined public variables and functions, allowing the verification tool to check module interfaces and ensure proper interactions without requiring full knowledge of internal implementations, thus maintaining verification accuracy across modular boundaries.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If the source code is divided into modules with many public variables and functions, then the interaction knowledge is preserved, but the module complexity increases

Engineering Contradiction:
Improveinteraction knowledge preservationVSAvoidmodule complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies parameter changes by optimizing the number and selection of public variables and functions in each module. Rather than exposing all possible interactions, the system selectively defines public interfaces based on the graph analysis, adjusting the parameters of module interfaces to minimize complexity while preserving essential interaction knowledge. This selective exposure reduces module complexity while maintaining sufficient interaction information for accurate verification.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentEP2788867B1Automatic modularization of source code
Publication Date: 2018.10.10 MATHWORKS INC
  • EP2788867B1 patent drawingFigure 1
  • EP2788867B1 patent drawingFigure 2
  • EP2788867B1 patent drawingFigure 3

AI summary

A device creates a graph based on source code, and analyzes the source code to identify private variables and functions of the source code and public variables and functions of the source code. The device determines, based on the graph, a size threshold and semantics-related characteristics of functions and variables for each module, of multiple modules, and assigns, based on the graph, the private variables and functions to a corresponding module of the multiple modules. The device reduces, based on the graph, a number of the public variables and functions assigned to each module, and generates the multiple modules based on one or more of the graph, the size threshold, the assigned private variables and functions, and the number of the public variables and functions assigned to each module.