Data Flow Graph Equivalence Checking for FBD Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The validation of software for safety control systems, particularly in nuclear power plants, is inefficient due to the need for redundant verification of function block diagrams (FBDs) that have not changed, leading to false positives from code generation differences in sequentialization and identifiers, making it difficult to determine functional equivalence.
Innovation Solution
A computer-implemented method that generates data flow graphs from source code, allowing for a node-by-node comparison of FBDs to check functional equivalence by abstracting from differences in sequentialization and identifiers, ensuring accurate identification of equivalent functionality.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual verification of each redundant division and version is performed, then validation completeness is ensured, but verification overhead and time consumption increase significantly
Solution Approach 1:
The patent transforms the verification approach by changing the parameter being compared from source code text to data flow graph structure. This parameter transformation enables automatic equivalence detection between redundant divisions and versions, eliminating manual verification while maintaining validation completeness through structural comparison of parsed code representations
Solution Approach 2:
The patent creates intermediate representations (data flow graphs) as copies of the source code semantics. These graph-based copies capture the essential functional structure without being affected by superficial code differences, allowing efficient comparison of redundant divisions and versions through graph isomorphism checking rather than direct code comparison
2Measurement precision
If line-by-line diff of source codes is performed, then code differences are identified, but false positives increase due to code generation variations
Solution Approach 1:
The patent extracts the essential functional semantics from source code by parsing and converting to data flow graphs. This extraction process removes superficial variations (identifiers, sequentialization differences) while preserving the core functional structure, enabling accurate equivalence detection without false positives from code generation artifacts
Solution Approach 2:
The patent introduces data flow graphs as an intermediary representation between source code and comparison operations. This mediator transforms code into a normalized structural form that eliminates false positives, allowing accurate functional equivalence checking by comparing graph structures rather than raw code text
3Adaptability or versatility
If code generation uses multiple sequentialization rules, then code flexibility and adaptability improve, but code equivalence determination becomes more difficult
Solution Approach 1:
The patent creates equipotential representation by converting different sequentializations into unified data flow graphs. This transformation places functionally equivalent codes at the same representational level, where their structural equivalence becomes apparent regardless of sequentialization variations, simplifying the equivalence checking process
Data Source
Figure 1
Figure 2~3
Figure 4
AI summary
A method for checking the functional equivalence of two pieces of software for control systems, in particular control systems based on programmable logic controllers, engineered from function block diagrams (120, 196) with a plurality of interconnected function blocks, the method comprising the following steps: a) generating a first instance of compilable source code from a first plurality of function block diagrams (70, 74, 78) by virtue of a first code generator obeying to a first set of sequentialization rules; b) parsing said first instance of source code and identifying the set of all function block I/O ports and junction points (nodes) and the set of all connections between them (arcs) of the data flow; c) using the information from step b) to reconstruct a first data flow graph (86) of said first instance of source code in the upstream direction; d) generating a second instance of compilable source code from a second plurality of function block diagrams (90, 94, 98) by virtue of the same or a second code generator obeying a second set of sequentialization rules; e) parsing said second instance of source code and identifying the set of all function block I/O ports and junction points (nodes) and the set of all connections between them (arcs) of the data flow; f) using the information from step e) to reconstruct a second data flow graph (106) of said second instance of source code in the upstream direction; g) comparing said first identified data flow graph (86) and said second identified data flow graph (106) with each other, node by node, and thereby checking if the transitive closure of input up to that node in said second instance of source code is the same as in said first instance of source code.