(** 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_program_contextual: forall {A B V: Type} {LA: Linker A} {LV: Linker V} (match_fundef: program A V -> A -> B -> Prop) (transf_fun: A -> res B) (p: program A V) (tp: program B V), transform_partial_program transf_fun p = OK tp -> (forall f tf, transf_fun f = OK tf -> match_fundef p f tf) -> match_program match_fundef eq p tp.