Model-Based Code Verification via Slicing and Graph Analysis
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
2Measurement precision
If manual verification is used to ensure code correctness, then verification accuracy is improved, but time consumption increases significantly
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.
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.
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
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.
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.
Data Source
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.


