Most general unifier function