Formal Semantics and Proof Techniques for Optimizing VHDL Models