let match_terms ~(recompute: bool) ?(p_preserving: bool = false)
  (term1: term) (offset1: int) (term2: term) (offset2: int) : subst =

  if not recompute && p_preserving then
    UnificationPPreserving.match_terms term1 offset1 term2 offset2

  else if not recompute && not p_preserving then
    Unification_Preserving.match_terms term1 offset1 term2 offset2

  else if recompute && p_preserving then
    UnificationRPPreserving.match_terms term1 offset1 term2 offset2

  else
    Unification_RPreserving.match_terms term1 offset1 term2 offset2