anchor.diff:                                                      format_type(NewType)]),
     NewFunMap.
   
  +solve(Fun, FunMap, State) ->
  +  {ok, Map} = v2_solve_ref(Fun, FunMap, State),
  +  Map.
  +
   %% Solver v2
   
   -record(v2_state, {constr_data = maps:new() :: map(),
   		   state :: state()}).
   
  -solve(Fun, FunMap, State) ->
  +v2_solve_ref(Fun, Map, State) ->
     V2State = #v2_state{state = State},
  -  try v2_solve_reference(Fun, FunMap, V2State) of
  -    {ok, NewMap, _, _} -> NewMap
  -  catch
  -    throw:infinite_loop:Stack ->
  -        erlang:raise(error,
  -                     {"Infinite loop detected, please report this bug.",
  -                      Fun,
  -                      State#state.module},
  -                     Stack)
  -  end.
  +  {ok, NewMap, _, _} = v2_solve_reference(Fun, Map, V2State),
  +  {ok, NewMap}.
   
   v2_solve(#constraint{}=C, Map, V2State) ->
     case solve_one_c(C, Map) of
  
positive.code:       ?debug("conjunct finished Id=~w\n", [Conj#constraint_list.id]),
        {ok, Map, V2State, lists:umerge([U|VarsUp])};
      NewFlags when NewFlags =:= LastFlags, Map =:= LastMap ->
        %% We're stuck in an infinite loop, so we'll crash in the hopes of
        %% getting a report. Trying to return anyway will yield potentially
        %% misleading results.
        throw(infinite_loop);
      NewFlags ->
        ?debug("conjunct restart Id=~w\n", [Conj#constraint_list.id]),
        #constraint_list{type = conj, list = Cs} = Conj,
  
negative.code: %%-define(DEBUG_CONSTRAINTS, true).
  -ifdef(DEBUG).
  -define(DEBUG_NAME_MAP, true).
  -define(DEBUG_LOOP_DETECTION, true).
  -endif.
  %%-define(DEBUG_NAME_MAP, true).
  %%-define(DEBUG_LOOP_DETECTION, true).
  
  -ifdef(DEBUG).
  -define(debug(__String, __Args), io:format(__String, __Args)).
  