anchor.diff:  		    {Node, true};
   	       true -> {[], false}
   	    end;
  -	_ -> {[], false}
  -    end.
  -
  +	_ -> {[], false} 
  +    end.
  +
  +
  +
  +static_semantic_checking(BodyToInline, {Clause, App})->
  +    VarName ='WRANGLER_TEMP_VAR',
  +    {Clause1,_} = refac_util:stop_tdTP(fun do_replace_app_with_match/2, Clause,
  +				 {App, refac_syntax:variable(VarName)}),
  +    Clause2 = refac_syntax_lib:annotate_bindings(refac_util:reset_attrs(Clause1), []),
  +    BdVars = lists:usort([Name|| {Name,_Loc}<-refac_util:get_bound_vars(BodyToInline)]),
  +    case refac_util:once_tdTU(fun do_check_static_semantics/2, Clause2, {VarName, BdVars}) of
  +	{_, false} ->
  +	    ok;
  +	{_, true} ->
  +	    throw({error, "Unfolding this function application could change the semantics of the program!"})
  +    end.
  +
  +do_replace_app_with_match(Node, {App, Var}) ->
  +    case Node of
  +	App ->
  +	  {refac_syntax:match_expr(Var, App), true};
  +	_-> {Node, false}
  +    end.
  +
  +
  +do_check_static_semantics(Node, {VarName, BdsInFunToInline}) ->
  +    Bds = lists:usort([Name || {Name, _Loc} <-refac_util:get_bound_vars(Node)]),
  +    Envs = lists:usort([Name || {Name, _Loc} <-refac_util:get_env_vars(Node)]),
  +    case lists:member(VarName, Bds) of 
  +	true ->
  +	    case BdsInFunToInline -- Bds of
  +		[] ->
  +		    case lists:member(VarName, Envs) of
  +			true ->
  +			    case BdsInFunToInline -- Bds of 
  +				[] ->{[], false};
  +				_ -> {Node, true}
  +			    end;
  +			false ->
  +			    {[], false}
  +		    end;
  +		_ -> {Node, true}
  +	    end;
  +	_ -> 
  +	    case lists:member(VarName, Envs) of
  +		true ->
  +		    case BdsInFunToInline -- Bds of 
  +			[] ->{[], false};
  +			_ -> {Node, true}
  +		    end;
  +		false ->
  +		    {[], false}
  +	    end 
  +    end.
  +			     
  
positive.code: 	    case length(Cs) >1 of
  		true -> throw({error, "Inlining a function with multiple function clauses is not supported yet."});
  		false-> C = hd(Cs),
  			_B = refac_syntax:clause_body(C),
  			Ps = refac_syntax:clause_patterns(C),
  			G = refac_syntax:clause_guard(C),
  			case G of 
  
negative.code: 						       refac_syntax:type(P)==variable orelse
  							   refac_syntax:is_literal(P) 
  					       end, Ps) of
  				    true ->
  					case static_semantic_checking(Body, {Clause, App}) of
  					    {error, Reason} ->
  						throw({error, Reason});
  					    ok -> 
  						{ok, FunDef}
  					end;
  				    false ->
  					throw({error, "Inlining a function with complex parameters is not supported yet."})
  				end;
  