> your specification is simply "an optimized program always behaves the same as the original"
I wouldn't say it is simple, since it is undecidable for general programs.
I wouldn't say it is simple, since it is undecidable for general programs.
The decidability of the specification isn't important in this context. It is known there is no procedure to build a proof of this specification for any language or optimization, but as humans we can prove that it holds for a specific configuration of compilers, and optimizations, and have done so many times, for example CompCert, Alive, etc.