anchor.diff:      ?RP_SCHED ! #sched{msg = spawn, pid = self(), misc = Pid},
       rep_yield(),
       Pid.
  +
  +%% Wait until the scheduler prompts to continue.
  +-spec wait() -> 'true'.
  +
  +wait() ->
  +    receive
  +	#sched{msg = continue} -> true
  +    end.
  
positive.code:         ReplayState ->
              ?debug_1("Running interleaving ~p~n", [RunCnt]),
              ?debug_1("----------------------~n"),
              %% Start LID service.
              lid:start(),
              %% Create the first process.
              %% The process is created linked to the scheduler, so that the
              %% latter can receive the former's exit message when it terminates.
              %% In the same way, every process that may be spawned in the course
              %% of the program shall be linked to this process.
  	    {Mod, Fun, Args} = Target,
              FirstPid = spawn_link(Mod, Fun, Args),
              %% Create the first LID and register it with FirstPid.
              lid:new(FirstPid, noparent),
              %% The initial `active` and `blocked` sets are empty.
              Active = sets:new(),
              Blocked = sets:new(),
              %% Create initial state.
              State = state:empty(),
  	    %% TODO: Not especially nice (maybe refactor into driver?).
              %% Receive the first message from the first process. That is, wait
              %% until it yields, blocks or terminates.
  	    InitInfo = #info{active = Active, blocked = Blocked,
  			     state = State, details = Det},
              NewInfo = dispatcher(InitInfo),
              %% Use driver to replay ReplayState.
              Ret = driver(NewInfo, ReplayState),
  	    ?debug_1("-----------------------~n"),
  	    ?debug_1("Run terminated.~n~n"),
  	    %% TODO: Proper cleanup of any remaining processes.
              %% Stop LID service (LID tables have to be reset on every run).
              lid:stop(),
              case Ret of
                  ok -> interleave_loop(Target, RunCnt + 1, Tickets, Det);
                  {error, ErrorType, ErrorDescr, ErrorState} ->
  
negative.code:     Parent ! {interleave_result, {Result, Time}}.
  
  %% Main loop for producing process interleavings.
  %% The first process (FirstPid) is created linked to the scheduler,
  %% so that the latter can receive the former's exit message when it
  %% terminates. In the same way, every process that may be spawned in
  %% the course of the program shall be linked to the scheduler process.
  interleave_loop(Target, RunCnt, Tickets, Det) ->
      %% Lookup state to replay.
      case state:load() of
  