code: public Substitution getMGU(Function first, Function second) {
          SubstitutionImpl mgu = new SubstitutionImpl(termFactory);
          if (mgu.composeFunctions(first, second))
              return mgu;
          return null;
      }
docs: Computes the Most General Unifier (MGU) for two n-ary atoms.
  <p/>
  IMPORTANT: Function terms are supported as long as they are not nested.
  <p/>
  IMPORTANT: handling of AnonymousVariables is questionable --
  much is left to UnifierUtilities.apply (and only one version handles them)
  
  @param first
  @param second
  @return the substitution corresponding to this unification.