(** In many cases, the context for [match_program_gen] is the source program or
  source compilation unit itself.  We provide a specialized definition for this case. *)

Definition match_program {F1 V1 F2 V2: Type} {LF: Linker F1} {LV: Linker V1}
                         (match_fundef: program F1 V1 -> F1 -> F2 -> Prop)
                         (match_varinfo: V1 -> V2 -> Prop)
                         (p1: program F1 V1) (p2: program F2 V2) : Prop :=
  match_program_gen match_fundef match_varinfo p1 p1 p2.

Theorem match_transform_partial_program2: forall {C F1 V1 F2 V2: Type} {LC: Linker C} {LF: Linker F1} {LV: Linker V1} (match_fundef: C -> F1 -> F2 -> Prop) (match_varinfo: V1 -> V2 -> Prop) (transf_fun: ident -> F1 -> res F2) (transf_var: ident -> V1 -> res V2) (ctx: C) (p: program F1 V1) (tp: program F2 V2), transform_partial_program2 transf_fun transf_var p = OK tp -> (forall i f tf, transf_fun i f = OK tf -> match_fundef ctx f tf) -> (forall i v tv, transf_var i v = OK tv -> match_varinfo v tv) -> match_program_gen match_fundef match_varinfo ctx p tp.