(** * Commutation with linking *)

Remark link_def_either:
  forall (gd1 gd2 gd: globdef fundef unit),
  link_def gd1 gd2 = Some gd -> gd = gd1 \/ gd = gd2.

(* Specifications: *)
Lemma link_valid_used_set: forall p1 p2 p used1 used2, link p1 p2 = Some p -> valid_used_set p1 used1 -> valid_used_set p2 used2 -> valid_used_set p (IS.union used1 used2).
Theorem link_match_program: forall p1 p2 tp1 tp2 p, link p1 p2 = Some p -> match_prog p1 tp1 -> match_prog p2 tp2 -> exists tp, link tp1 tp2 = Some tp /\ match_prog p tp.