(** * Properties related to labels *)

(** If labels are globally unique and the Linear code [c] contains
  a subsequence [Llabel lbl :: c1], then [find_label lbl c] returns [c1].
*)

Fixpoint unique_labels (c: code) : Prop :=
  match c with
  | nil => True
  | Llabel lbl :: c => ~(In (Llabel lbl) c) /\ unique_labels c
  | i :: c => unique_labels c
  end.

Lemma add_branch_correct: forall lbl c k s f tf sp ls m, transf_function f = OK tf -> is_tail k tf.(fn_code) -> find_label lbl tf.(fn_code) = Some c -> plus step tge (State s tf sp (add_branch lbl k) ls m) E0 (State s tf sp c ls m).