3 ms·
I've been thinking about this today. Function equivalence is one thing, but detecting similar code fragements is another? Like why not assign a character to ea
by orf 3y ago
I've been thinking about this today. Function equivalence is one thing, but detecting similar code fragements is another?
Like why not assign a character to each keyword: 'if' = 'i', 'while' = 'w', 'true' = 't', etc. Then reduce code to this, removing all whitespace comments and identifiers. so `if True: while True: pass` would become `itwtp`.
then the similarity is just an edit distance between two given strings?