anchor.diff:          %% Uncontracted -> Contracted forms a loop if there exists a path
           %% from the source of the child to the parent, or the source is
           %% the parent.
  -        {[], {true, Pid}} ->
  -
  -            Tail = get_process_tail(Pid, OptMap),
  +        {[], {true, Id}} ->
  +
  +            Tail = get_process_tail(Id, OptMap),
   
               lists:any(fun(V) ->
                   not (digraph:get_path(G, Tail, V) =:= false)
  
positive.code: %%      all unnecessary vertices with the given Pid, that should
  %%      represent the resulting lasp process of the path contraction.
  %%
  -spec remove_edges(digraph:graph(), contract_path(), pid(), optimized_map()) -> optimized_map().
  remove_edges(Dag, VSeq, Pid, OptMap) ->
  
      %% Store process metadata in the optimized map
      Metadata = get_metadata(Dag, VSeq),
  
      %% Tag all unnecessary vertices in the path with the new process Pid
      UnnecesaryVertices = lists:sublist(VSeq, 2, length(VSeq) - 2),
      tag_vertices(Dag, UnnecesaryVertices, #vertex_label{pointer_pid=Pid}),
  
      %% Delete the intermediate edges and kill the associated processes.
      OldPids = collect_pids(Dag, VSeq),
  
negative.code: %%
  handle_info({'DOWN', _, process, Pid, Reason}, #state{dag=Dag,
                                                        process_map=PM,
                                                        optimized_map=OptMap,
                                                        pid_table=PidTable}=State) ->
  
      {ok, Edges} = dict:find(Pid, PM),
      NewDag = lists:foldl(fun({F, T}, G) ->
          delete_with_pid(G, F, T, Pid)
      end, Dag, Edges),
  
      %% If terminated by supervisor, cleave any associated paths.
      NewState = case dict:find(Pid, PidTable) of
          {ok, Id} -> case Reason of
              shutdown ->
                  cleave_associated_path(Dag, Id, OptMap),
                  State#state{optimized_map=dict:erase(Id, OptMap),
                              pid_table=dict:erase(Pid, PidTable)};
  
              _ ->
                  State#state{pid_table=dict:erase(Pid, PidTable)}
          end;
          _ -> State
      end,
  
      {noreply, NewState#state{dag=NewDag,
                               process_map=dict:erase(Pid, PM)}};
  
  handle_info({process_created, Id, Pid, VSeq}, #state{dag=Dag,
                                                       optimized_map=OptMap,
                                                       pid_table =PidTable}=State) ->
      %% @todo Assume the dag didn't change since last call.
      %%       Test it once the cleaving has been implemented.
      %%
      %%       If data races happen even with the cleaving step, we should
      %%       perform a check here, before removing the edges.
      %%
      NewOptMap = remove_edges(Dag, VSeq, Id, Pid, OptMap),
      {noreply, State#state{optimized_map=NewOptMap, pid_table=dict:store(Pid, Id, PidTable)}};
  
  handle_info(Msg, State) ->
      _ = lager:warning("Unhandled messages ~p", [Msg]),
  