Section Correctness.
(** A peephole optimizer is correct if it replaces an instruction with a semantically equivalent sequence of instructions. *)
Definition ph_correct (ph : peephole_optimization) :=
forall (i:instr),
@eq_asm_denotations_EQ Exit unit _ (fun _ => denote_instr i) (fun _ => denote_list (ph i)).

Lemma peephole_block_correct :
forall (ph : peephole_optimization)
(H : ph_correct ph)
(lbl1 lbl2 : nat)
(b : block (fin lbl2)),
@eq_asm_denotations_EQ Exit (fin lbl1) (fin lbl2)
(fun _ => denote_bk b)
(fun _ => denote_bk (peephole_optimize_block ph b)).