anchor.diff:  %% {ok, Apps} = ?FULL_TD_TU([?COLLECT_LOC(?T("F@(Args@@)"), 
   %%                                                 lists:member(api_refac:fun_define_info(F@),
   %%                                                              OldMFAs))], Form),
  +
  +simplify_expr(NewExpr, OldExpr) ->
  +    NewExprStr = api_refac:pp(NewExpr),
  +    NewExpr1 = wrangler_misc:parse_annotate_expr(NewExprStr),
  +    {OldBoundVars,_} = lists:unzip(bound_used_vars(OldExpr)),
  +    {NewBoundVars,_}= lists:unzip(api_refac:bound_vars(NewExpr1)),
  +    NewVars = NewBoundVars--OldBoundVars,
  +    if NewVars==[] -> NewExpr;
  +       true ->
  +            case wrangler_syntax:type(NewExpr) of 
  +                match_expr ->
  +                    simplify_match_expr(NewExpr, NewVars);
  +                _ ->
  +                    simplify_expr_1(NewExpr, NewVars)
  +            end
  +    end.
  +
  +simplify_expr_1(Expr, NewVars) ->
  +    NewExpr = simplify_expr_2(Expr, NewVars),
  +    case NewExpr==Expr of 
  +        true ->
  +            Expr;
  +        false ->
  +            simplify_expr_1(NewExpr, NewVars)
  +    end.
  +
  +simplify_match_expr(Expr, NewVars) ->
  +    Left = wrangler_syntax:match_expr_pattern(Expr),
  +    Right = wrangler_syntax:match_expr_body(Expr),
  +    case wrangler_syntax:type(Left) of
  +        tuple ->
  +            Es = wrangler_syntax:tuple_elements(Left),
  +            EsWithIndex =lists:zip(lists:seq(1, length(Es)), Es),
  +            Underscores=[Index||{Index, E}<-EsWithIndex,
  +                                wrangler_syntax:type(E)==underscore],
  +            case Underscores of 
  +                [] ->
  +                    Expr;
  +                _ ->
  +                    {NewRight, RemovedIndexes}=do_simplify_match_expr(Right, Underscores, NewVars),
  +                    case RemovedIndexes of 
  +                        [] ->
  +                            Expr;
  +                        _ ->
  +                            NewLeft=[E||{Index, E}<-EsWithIndex, 
  +                                        not lists:member(Index, RemovedIndexes)],
  +                            case NewLeft of 
  +                                [E] -> wrangler_syntax:match_expr(E, NewRight);
  +                                _ -> wrangler_syntax:match_expr(
  +                                       wrangler_syntax:tuple(NewLeft), NewRight)
  +                            end
  +                    end
  +            end;
  +        _ -> Expr
  +    end.
  +
  +simplify_expr_2(Expr, Vars)->
  +    Expr1=wrangler_syntax_lib:annotate_expr(wrangler_misc:reset_ann(Expr)),
  +    F = fun(Node, _Others) ->
  +                case wrangler_syntax:type(Node) of 
  +                    variable ->
  +                        VarName = wrangler_syntax:variable_name(Node),
  +                        case api_refac:var_refs(Node) ==[] andalso lists:member(VarName, Vars) of 
  +                            true ->
  +                                {wrangler_syntax:underscore(), true};
  +                            false ->
  +                                {Node, false}
  +                        end;
  +                    match_expr -> 
  +                        Pattern = wrangler_syntax:match_expr_pattern(Node),
  +                        case wrangler_syntax:type(Pattern) of 
  +                            underscore ->
  +                                {wrangler_syntax:empty_node(),true};
  +                            tuple ->
  +                                Es = wrangler_syntax:tuple_elements(Pattern),
  +                                case lists:all(fun(E)-> 
  +                                                       wrangler_syntax:type(E)== underscore 
  +                                               end, Es) of 
  +                                    true ->
  +                                        {wrangler_syntax:empty_node(),true};
  +                                    false ->
  +                                        {Node, false}
  +                                end;
  +                            _ -> {Node, false}
  +                        end;
  +                    _ ->
  +                        {Node, false}
  +                end
  +        end,
  +    element(1,api_ast_traverse:full_tdTP(F, Expr1, [])).
  +
  +                
  +do_simplify_match_expr(MatchExprRight, Indexes, NewVars) ->
  +    case wrangler_syntax:type(MatchExprRight) of
  +        case_expr ->
  +            Cs = wrangler_syntax:case_expr_clauses(MatchExprRight),
  +            {NewCs, RmIndexes} = do_simplify_match_expr_1(Cs, Indexes, NewVars),
  +            case RmIndexes of 
  +                [] -> {MatchExprRight, []};
  +                _ ->
  +                    Arg = wrangler_syntax:case_expr_argument(MatchExprRight),
  +                    {wrangler_syntax:case_expr(Arg, NewCs), RmIndexes}
  +            end;
  +        try_expr ->
  +            Cs = wrangler_syntax:try_expr_clauses(MatchExprRight),
  +            {NewCs, RmIndexes} = do_simplify_match_expr_1(Cs, Indexes, NewVars),
  +            case RmIndexes of 
  +                [] -> {MatchExprRight, []};
  +                _ ->
  +                    B = wrangler_syntax:try_expr_body(MatchExprRight),
  +                    H = wrangler_syntax:try_expr_handlers(MatchExprRight),
  +                    A = wrangler_syntax:try_expr_after(MatchExprRight),
  +                    {wrangler_syntax:try_expr(B, NewCs, H, A), RmIndexes}
  +            end;
  +        _ ->
  +            {MatchExprRight, []}
  +    end.
  +        
  +do_simplify_match_expr_1(Cs, Is, NewVars) ->
  +    do_simplify_match_expr_1(Cs, Is, NewVars, 0, []).
  +
  +do_simplify_match_expr_1(Cs, [], _NewVars, _Num, Rmd) ->
  +    {Cs, Rmd};
  +do_simplify_match_expr_1(Cs, [I], NewVars, Num, Rmd) ->
  +    case do_simplify_match_expr_2(Cs, I, NewVars, Num) of 
  +        false -> {Cs, Rmd};
  +        NewCs ->
  +            {NewCs, [I|Rmd]}
  +    end;   
  +do_simplify_match_expr_1(Cs,[I|Is], NewVars, Num, Rmd) ->
  +    case do_simplify_match_expr_2(Cs, I, NewVars, Num) of 
  +        false ->
  +            do_simplify_match_expr_1(Cs, Is, NewVars,Num, Rmd);
  +        NewCs ->
  +            do_simplify_match_expr_1(NewCs, Is,NewVars, Num+1,[I|Rmd])
  +    end.
  +        
  +
  +do_simplify_match_expr_2(Cs, I, NewVars, Num) ->
  +    Res=[do_simplify_match_expr_3(C,I, NewVars, Num)||C<-Cs],
  +    case lists:member(false, Res) of 
  +        true ->
  +            false;
  +        _ -> Res
  +    end.
  +
  +do_simplify_match_expr_3(C, I, NewVars, Num) ->
  +    Pats = wrangler_syntax:clause_patterns(C),
  +    Body = wrangler_syntax:clause_body(C),
  +    case lists:reverse(Body) of 
  +        [_] ->
  +            false;
  +        [E|Es] ->
  +            case wrangler_syntax:type(E) of 
  +                tuple->
  +                    TupleEs = wrangler_syntax:tuple_elements(E),
  +                    NewTupleEs = lists:sublist(TupleEs, 1, I-Num-1)++
  +                        lists:nthtail(I-Num, TupleEs),
  +                    NewE=wrangler_syntax:tuple(NewTupleEs),
  +                    Body1= wrangler_syntax:block_expr(Es++[NewE]),
  +                    NewBody = wrangler_syntax:block_expr_body(
  +                                simplify_expr_1(Body1, NewVars)),
  +                    NewBody1 = [B||B<-NewBody, not is_empty_node(B)],
  +                    case length(NewBody1) == length(Es)+1 of 
  +                        true ->
  +                            false;
  +                        false ->
  +                            
  +                            wrangler_syntax:clause(Pats, none, NewBody1)
  +                    end;
  +                _ ->
  +                    false
  +            end
  +    end.
  +           
  +bound_used_vars(Nodes) when is_list(Nodes) ->
  +    lists:usort(lists:flatmap(fun (Node) -> 
  +                                      bound_used_vars(Node) 
  +                              end, Nodes));
  +bound_used_vars(Node) ->
  +    Fun = fun (N, Acc) ->
  +                  Ann = wrangler_syntax:get_ann(N),
  +                  case lists:keyfind(bound,1,Ann) of
  +                      {bound, Vs} ->
  +                          case lists:keyfind(use, 1, Ann) of 
  +                              {use,Locs} ->
  +                                 if length(Locs)>1 ->
  +                                         Vs ++ Acc;
  +                                    true -> Acc
  +                                 end;
  +                              false->
  +                                  Acc
  +                          end;
  +                      false ->
  +                          Acc 
  +                  end
  +          end, 
  +    Vars=api_ast_traverse:fold(Fun, [], Node),
  +    lists:usort(Vars).
  +             
  +        
  +is_empty_node(Node) ->
  +    is_tree(Node) andalso wrangler_syntax:type(Node) == empty_node.
  +       
  +is_tree(Node) ->
  +    wrangler_syntax:is_tree(Node) orelse wrangler_syntax:is_wrapper(Node).
  +
  
positive.code:                          TabWidth::integer()) -> 
               [{{filename(),filename()}, syntaxTree()}]).
  do_api_migration_1(CallBackMod, OldMFAs, File, SearchPaths, TabWidth) ->
      {ok, {AnnAST, Info}} =wrangler_ast_server:parse_annotate_file(
                               File, true, SearchPaths, TabWidth),
      case lists:keysearch(module, 1, Info) of
  
negative.code:         {error, Reason} ->
              {error, Reason};
          NewFileName ->
              try wrangler_ast_server:parse_annotate_file(FileName, true) of 
                  {ok, {AnnAST, Info}} ->
                      case lists:keysearch(module, 1, Info) of
                          {value, {module, ModName}} ->
  