3 ms·
If only function equivalence was decidable[1]. [1]: Rice's theorem https://en.wikipedia.org/wiki/Rice%27s_theorem https://en.wikipedia.org/wiki/Rice%27s_theore
by ivanjermakov 3y ago
If only function equivalence was decidable[1].
[1]: Rice's theorem https://en.wikipedia.org/wiki/Rice%27s_theorem https://en.wikipedia.org/wiki/Rice%27s_theorem
- orf 3y agoI'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?