anchor.diff:  sub_new(Temp) ->
       #sub{t=Temp}.
   
  -%% Folds the sub into a new one if the variables in nodes are not disjoint
  +%% Folds the sub into a new one.
  +%% If the variables are disjoint, it means we can continue reusing
  +%% the patterns collected so far. Otherwise, it means a variable
  +%% was reassigned, so we build a new sub with fresh patterns.
   sub_fold(VarNames, #sub{v=SubNames}=Sub) ->
       case is_disjoint_variables(VarNames, SubNames) of
           true  -> Sub#sub{t={temp,Sub#sub.t}};
           false -> sub_new({sub,Sub})
       end.
   
  -%% Unfolds the sub in case one was folded in the previous step
  +%% Unfolds the sub in case one was folded in the previous step,
  +%% otherwise returns the (root) Sub itself.
  +sub_unfold(#sub{t=none}=Sub) ->
  +    Sub;
   sub_unfold(#sub{t={temp,Temp}}=Sub) ->
       Sub#sub{t=Temp};
   sub_unfold(#sub{t={sub,Sub}}) ->
  
positive.code: def({#c_var{name={F,Arity}}=Name,B0}) ->
      try
          put(new_var_num, 0),
          {B1,_} = cerl_trees:mapfold(fun pre/2, fun post/2, sub_new(undefined), B0),
          erase(new_var_num),
          {Name,B1}
      catch
  
negative.code:                 error ->
                      {Node,Sub0}
              end
      end;
  
  pre(Node, Sub) -> {Node, Sub}.
  
  post(#c_clause{}=Node, #sub{t={clause,Pats0,Keys,V,T}}=Sub0) ->
      {Sub1,PostKeys} = sub_take_keys(Keys, Sub0),
  