anchor.diff:            logger                       :: pid(),
             last_scheduled               :: pid(),
             message_info                 :: message_info(),
  +          need_to_replay     = false   :: boolean(),
             non_racing_system  = []      :: [atom()],
             optimal            = true    :: boolean(),
             previous_was_enabled = true   :: boolean(),
  
positive.code:   #scheduler_state{
       current_warnings = Warnings,
       depth_bound = Bound,
       trace = [#trace_state{index = I}|Old]} = State) when I =:= Bound + 1->
    NewState =
      State#scheduler_state{
        current_warnings = [{depth_bound, Bound}|Warnings],
        trace = Old},
    {none, NewState};
  get_next_event(State) ->
    #scheduler_state{
       last_scheduled = LastScheduled,
       logger = Logger,
       system = System,
       trace = [Last|_]} = State,
    #trace_state{
       actors      = Actors,
       scheduling_bound = SchedulingBound,
       index       = I,
       sleeping    = Sleeping,
       wakeup_tree = WakeupTree
      } = Last,
    PreviousWasEnabled = concuerror_callback:enabled(LastScheduled),
    SortedActors = schedule_sort(Actors, State),
    AvailableActors = filter_sleeping(Sleeping, SortedActors),
    case WakeupTree of
      [] ->
        Event = #event{label = make_ref()},
        NewState =
          State#scheduler_state{
            bound_consumed = 0,
            previous_was_enabled = PreviousWasEnabled
           },
        get_next_event(Event, System ++ AvailableActors, NewState);
      [#backtrack_entry{
          event = #event{actor = Actor, label = Label} = Event,
          origin = N}|_] ->
        ?log(Logger, ?ldebug,"By: ~p~n", [N]),
        false = lists:member(Actor, Sleeping),
        BoundConsumed =
          case SchedulingBound =/= infinity of
  
negative.code:     end,
    count_delay(Rest, Actor, NN).
  
  free_schedule(Event, [{Channel, Queue}|_], State) ->
    %% Pending messages can always be sent
    MessageEvent = queue:get(Queue),
    UpdatedEvent = Event#event{actor = Channel, event_info = MessageEvent},
    {ok, FinalEvent} = get_next_event_backend(UpdatedEvent, State),
    update_state(FinalEvent, State);
  free_schedule(Event, [P|ActiveProcesses], State) ->
    case get_next_event_backend(Event#event{actor = P}, State) of
      retry -> free_schedule(Event, ActiveProcesses, State);
      {ok, UpdatedEvent} -> update_state(UpdatedEvent, State)
    end;
  free_schedule(_Event, [], State) ->
    %% Nothing to do, trace is completely explored
    #scheduler_state{
       current_warnings = Warnings,
  