Patent ID: 9703547
Date: 2017-07-11
CPC Classifications: G06F

Claim:
1. A method for determining program equivalence between a first program and multiple candidate programs, the method comprising steps of: defining a program semantic representation for the first program; generating a search query based on said program semantic representation; executing said search query against an index of multiple programs, wherein said index comprises a program semantic representation for each of the multiple programs; outputting a set of candidate programs, among the multiple programs, as a result of executing said search query against the index; refactoring (i) the first program and (ii) each program in the set of candidate programs, wherein said refactoring is based on (a) one or more patterns of program equivalence and (b) one or more canonicalization operators; outputting a canonical representation of (i) the first program and (ii) each respective program in the set of candidate programs as a result of said refactoring; identifying one or more programs among the set of candidate programs that match the first program by performing one or more comparisons, across the set of candidate programs, of the canonical representation associated with each respective program in the identified set of candidate programs to the canonical representation associated with the first program, wherein said performing the one or more comparisons comprises: outputting the one or more identified programs that match the first program to at least one user; wherein the steps are carried out by at least one processor coupled to a memory.