Research Article
Detecting Copy Directions among Programs Using Extreme Learning Machines
Algorithm 3
Reconstruction of control dependence subgraph.
| Input: PDG whose partial control subgraph has been deleted; | | Output: PDG after reconstruction of control subgraph; | | () Generate ’s control dependence subgraph set ; | | () foreach control dependence subgraph in do | | () Mark irremovable nodes in ; | | () foreach irremovable node in do | | () Build an empty irremovable node Set; | | () Build a queue and put nodes that is data-dependent on into ; | | () while is not empty do | | () ; | | () if is irremovable node then | | () Put into Set; | | () else | | () Put nodes that is data-dependent on into ; | | () Add into each node’s data dependence in Set; | | () Delete all removable nodes and their dependencies in ; | | () return ; |
|