<p><pre><code>    Is there a form of static analysis that transforms source code into a normalized representation, such that two semantically identical programs with different source can be proved identical?
</code></pre>
No, there isn&#x27;t. Not in the general case. Solving program equivalence would also provide a solution to the Halting problem.<p>One way to prove this is as follows:<p>Given an arbitrary function, <i>f</i>, we choose a number <i>x</i> and define a function <i>f&#x27;</i>, which on input <i>n</i> returns 1 if <i>n = x</i>, and otherwise calls <i>f(n)</i>.<p>We now statically know that <i>f&#x27;</i> halts on at least one input. If functional equivalence were decidable, then deciding whether <i>f</i> is identical to <i>f&#x27;</i> decides whether <i>f</i> (which, recall, is an arbitrary function) halts on input <i>x</i>. That would solve the Halting problem. Thus, functional equivalence is undecidable.<p>You can design normalized forms which will tell you if <i>some</i> classes of programs are functionally equivalent or not (and it&#x27;s a darn good thing, too, or it would be impossible to do compiler optimizations), but any realizable algorithm for such must always have edge cases where it either gets the answer wrong, or has to output &quot;I don&#x27;t know&quot;.