anchor.diff:  %%      we have to know when it happens so we can delete the appropiate
   %%      edges in the graph.
   %%
  -handle_info({'DOWN', _, process, Pid, _Reason}, #state{dag=Dag,
  -                                                       process_map=PM,
  -                                                       optimized_map=OptMap}=State) ->
  +handle_info({'DOWN', _, process, Pid, Reason}, #state{dag=Dag,
  +                                                      process_map=PM,
  +                                                      optimized_map=OptMap}=State) ->
       {ok, Edges} = dict:find(Pid, PM),
       NewDag = lists:foldl(fun({F, T}, G) ->
           delete_with_pid(G, F, T, Pid)
       end, Dag, Edges),
   
  -    %% @todo Update the tags in the unnecessary vertices.
  +    %% If terminated by supervisor, cleave any associated paths.
  +    case Reason of
  +        shutdown -> cleave_associated_path(Dag, Pid, OptMap);
  +        _ -> ok
  +    end,
  +
  +    %% @todo Update the tags in the unnecessary vertices when killed.
  +    %%
  +    %%       Optimized vertices hold a pointer to the optimized process,
  +    %%       so this tag should be updated every time the process changes
  +    %%       its pid.
  +    %%
  +    %%       Not quite as simple, since lasp processes have no
  +    %%       identity (all metadata can change from time to time,
  +    %%       even if all details stay the same), we have no way
  +    %%       of correctly identifying what vertices to tag.
  +    %%
       {noreply, State#state{dag=NewDag,
                             process_map=dict:erase(Pid, PM),
                             optimized_map=dict:erase(Pid, OptMap)}};
  
positive.code:     end, Edges).
  
  %% @doc Tag the unnecessary vertices in the given path with a pid.
  -spec tag_unnecessary(digraph:graph(), contract_path(), pid()) -> ok.
  tag_unnecessary(Dag, VSeq, Pid) ->
      lists:foreach(fun(V) ->
          digraph:add_vertex(Dag, V, #vertex_label{pointer_pid=Pid})
      end, VSeq).
  
  %% @doc Get the list of pids from the edges between V1 and V2
  
negative.code:          terminate/2,
           code_change/3]).
  
  %% Defines how often an optimization pass happens.
  %% A value of 0 means the optimization happens every time.
  -define(CONTRACTION_INTERVAL, 0).
  