anchor.diff:      Secs = (ElapsedTime rem 60000) / 1000,
       ?debug_1("Done in ~wm~.2fs\n", [Mins, Secs]),
       {Mins, Secs}.
  -
  -%% Remove and return a state.
  -%% If no states available, return 'no_state'.
  -state_load() ->
  -    {Len1, Len2} = get(?NT_STATELEN),
  -    case get(?NT_STATE1) of
  -        [State | Rest] ->
  -            put(?NT_STATE1, Rest),
  -            concuerror_log:progress(log, Len1-1),
  -            put(?NT_STATELEN, {Len1-1, Len2}),
  -            concuerror_state:pack(State);
  -        [] -> no_state
  -    end.
  -
  -%% Return a state without removing it.
  -%% If no states available, return 'no_state'.
  -state_peak() ->
  -    case get(?NT_STATE1) of
  -        [State|_] -> State;
  -        [] -> no_state
  -    end.
  -
  -%% Add some states to the current `state` table.
  -state_save(State) ->
  -    Size = length(State),
  -    {Len1, Len2} = get(?NT_STATELEN),
  -    put(?NT_STATELEN, {Len1+Size, Len2}),
  -    put(?NT_STATE1, State ++ get(?NT_STATE1)).
  -
  -%% Add some states to the next `state` table.
  -state_save_next(State) ->
  -    Size = length(State),
  -    {Len1, Len2} = get(?NT_STATELEN),
  -    put(?NT_STATELEN, {Len1, Len2+Size}),
  -    put(?NT_STATE2, State ++ get(?NT_STATE2)).
  -
  -%% Initialize state tables.
  -state_start() ->
  -    put(?NT_STATE1, []),
  -    put(?NT_STATE2, []),
  -    put(?NT_STATELEN, {0, 0}),
  -    ok.
  -
  -%% Clean up state table.
  -state_stop() ->
  -    ok.
  -
  -%% Swap names of the two state tables and clear one of them.
  -state_swap() ->
  -    {_Len1, Len2} = get(?NT_STATELEN),
  -    concuerror_log:progress(swap, Len2),
  -    put(?NT_STATELEN, {Len2, 0}),
  -    put(?NT_STATE1, put(?NT_STATE2, [])).
   
   
   %%%----------------------------------------------------------------------
  
positive.code: %%%----------------------------------------------------------------------
  %%% Records
  %%%----------------------------------------------------------------------
  
  %% Scheduler state
  %%
  %% active  : A set containing all processes ready to be scheduled.
  %% blocked : A set containing all processes that cannot be scheduled next
  %%          (e.g. waiting for a message on a `receive`).
  %% current : The LID of the currently running or last run process.
  %% actions : The actions performed (concuerror_proc_action:proc_action()).
  %% error   : A term describing the error that occurred.
  %% state   : The current state of the program.
  -record(context, {active         :: ?SET_TYPE(concuerror_lid:lid()),
                    blocked        :: ?SET_TYPE(concuerror_lid:lid()),
                    current        :: concuerror_lid:lid(),
                    actions        :: [concuerror_proc_action:proc_action()],
                    error          :: ?NO_ERROR | concuerror_error:error(),
                    state          :: concuerror_state:state()}).
  
  
  %% 'next' messages are about next instrumented instruction not yet dispatched
  
negative.code:         Tickets -> {error, RunCnt, Tickets}
      end.
  
  %%%----------------------------------------------------------------------
  %%% Helper functions
  %%%----------------------------------------------------------------------
  