anchor.diff:               LastMap, LastFlags) ->
     v2_solve_conj(Is, Tail, I+1, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
                  LastMap, LastFlags).
  +
  +-ifdef(DEBUG_LOOP_DETECTION).
  +report_detected_loop(Conj) ->
  +  io:format("A loop was detected in ~w\n", [Conj#constraint_list.id]).
  +-else.
  +report_detected_loop(_) ->
  +  ok.
  +-endif.
   
   add_mask_to_flags(Flags, [Im|M], I, L) when I > Im ->
     add_mask_to_flags(Flags, M, I, [Im|L]);
  
positive.code:                                                     format_type(NewType)]),
    NewFunMap.
  
  %% Solver v2
  
  -record(v2_state, {constr_data = maps:new() :: map(),
  		   state :: state()}).
  
  solve(Fun, FunMap, 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.
  
  v2_solve(#constraint{}=C, Map, V2State) ->
    case solve_one_c(C, Map) of
  
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)).
  