anchor.diff:  %%  to force renaming if variables in the scope occurs as pattern
   %%  variables.
   
  -sub_new() -> #sub{v=orddict:new(),s=gb_sets:empty(),t=[]}.
  +sub_new() -> #sub{v=orddict:new(),s=cerl_sets:new(),t=[]}.
   
   sub_new(#sub{}=Sub) ->
       Sub#sub{v=orddict:new(),t=[]}.
  
positive.code: 
  sub_add_scope(Vs, #sub{s=Scope0}=Sub) ->
      Scope = foldl(fun(V, S) when is_integer(V); is_atom(V) ->
  			  gb_sets:add(V, S)
  		  end, Scope0, Vs),
      Sub#sub{s=Scope}.
  
  sub_subst_scope(#sub{v=S0,s=Scope}=Sub) ->
      S = [{-1,#c_var{name=Sv}} || Sv <- gb_sets:to_list(Scope)]++S0,
      Sub#sub{v=S}.
  
  sub_is_val(#c_var{name=V}, #sub{v=S,s=Scope}) ->
  
negative.code: verify_scope(E, #sub{s=Scope}) ->
      Free0 = cerl_trees:free_variables(E),
      Free = [V || V <- Free0, not is_tuple(V)],	%Ignore function names.
      case ordsets:is_subset(Free, cerl_sets:to_list(Scope)) of
  	true -> true;
  	false ->
  	    io:format("~p\n", [E]),
  	    io:format("~p\n", [Free]),
  	    io:format("~p\n", [cerl_sets:to_list(Scope)]),
  	    false
      end.
  -endif.
  