Model-Based Code Verification via Slicing and Graph Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The verification of code generated from models is challenging due to its complexity and the need for both automated and manual verification, especially in safety-critical systems, where existing methods are costly and time-consuming, and often require partial verification approaches.

Innovation Solution

A code verifier is used to automatically verify the generated code by comparing its internal representation with the model's internal representation, creating element connectivity lists and program dependency graphs, and providing partial verification through slicing and manual review interfaces.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If automated verification methods are used to verify code generated from models, then verification efficiency is improved, but verification completeness deteriorates due to the need for partial verification approaches

Engineering Contradiction:
Improveverification efficiencyVSAvoidverification completeness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The verification system segments the verification process into multiple independent analysis dimensions including data flow analysis, control flow analysis, and semantic analysis. Each dimension can be verified automatically to improve efficiency, while the segmented structure allows selective manual review of specific segments to maintain completeness without requiring full manual verification of the entire codebase.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements partial verification by focusing automated verification efforts on critical code paths and high-risk areas identified through model analysis. This allows the system to achieve sufficient verification completeness for safety-critical portions while using automated methods, and applies manual verification selectively to areas where automated methods are insufficient, rather than requiring complete manual verification of all code.

Inventive Principle:
Principle #16Partial or excessive action

2Measurement precision

If manual verification is used to ensure code correctness, then verification accuracy is improved, but time consumption increases significantly

Engineering Contradiction:
Improveverification accuracyVSAvoidtime consumption
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary automated analysis of the model and generated code to identify critical verification points, potential errors, and areas requiring manual review. This preliminary action prepares verification artifacts and guides manual verifiers to focus only on high-priority areas, thereby maintaining high verification accuracy while significantly reducing the time required for manual verification compared to comprehensive manual review.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary automated verification system that acts as a bridge between model specification and final code validation. This intermediary performs initial correctness checks and generates verification reports that guide subsequent manual verification efforts, reducing the burden on manual verifiers while maintaining overall verification accuracy through the combined automated-manual approach.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If comprehensive verification of all code is performed, then code correctness is improved, but resource costs increase due to the complexity of verification processes

Engineering Contradiction:
Improvecode correctnessVSAvoidverification complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The verification system applies different verification depths and methods to different portions of the code based on their criticality and risk levels. Safety-critical code paths receive comprehensive verification with multiple analysis passes, while less critical portions receive streamlined verification. This local quality approach ensures high code correctness for critical areas while reducing overall verification complexity and resource requirements by avoiding uniform comprehensive verification across all code.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent implements configurable verification parameters that allow the verification process to adjust its depth, scope, and resource allocation based on project requirements, code criticality levels, and available resources. By changing verification parameters dynamically, the system can achieve high code correctness when needed while reducing verification complexity and resource costs for less critical scenarios, avoiding the need for fixed comprehensive verification of all code.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS9612806B2Verification of computer-executable code generated from a model
Publication Date: 2017.04.04 MATHWORKS INC
  • US9612806B2 patent drawing
  • US9612806B2 patent drawing
  • US9612806B2 patent drawing

AI summary

In an embodiment, a model is sliced into a plurality of slices. A slice in the plurality of slices is selected. A portion of code, that corresponds to the selected slice, is identified from code generated from the model. The identified code is verified to be equivalent to the selected slice. Equivalence may include equivalent functionality, equivalent data types, equivalent performance, and or other forms of equivalence between the selected slice and the identified generated code.