anchor.diff:  %% lets us quickly delete those edges.
   -type process_map() :: dict:dict(pid(), {id(), id()}).
   
  -%% Stored metadata for a lasp process.
  -%% We don't store the input(s) and output vertices as that information
  -%% is implicitly stored by edges in the graph.
  --record(process_metadata, {read :: function(),
  -                           transform :: function(),
  -                           write :: function()}).
  -
  -%% We store a mapping Id -> {Pid, Path, MetadataList} to identify the list of
  -%% vertices and relationships that get removed as part of a path contraction.
  -%%
  -%% Used during the cleaving step.
  --type contract_process_id() :: non_neg_integer().
  --type pid_table() :: dict:dict(pid(), contract_process_id()).
  --type optimized_map() :: dict:dict(contract_process_id(),
  -                                   {pid(),
  -                                    contract_path(),
  -                                    list(#process_metadata{})}).
  -
  +%% State. The graph is constructed using the digraph module.
  +%% See definitions above for further information.
   -record(state, {dag :: digraph:graph(),
                   process_map :: process_map(),
                   optimized_map :: optimized_map(),
                   pid_table :: pid_table(),
  -                contraction_step :: non_neg_integer()}).
  +                contraction_step :: contraction_step()}).
   
   %% We store the function metadata as the edge label.
  +%% An edge in the graph represents a lasp process, and contains
  +%% the various functions used by it.
  +%%
  +%% Processes that have n inputs are modeled by n edges, all with the same
  +%% pid, connecting each input to the output. This means that we only have
  +%% to collect a single read function.
  +%% @todo merge with process_metadata record
   -record(edge_label, {pid :: pid(),
  -                    read :: function(),
  -                    transform :: function(),
  -                    write :: function()}).
  -
  -%% @todo Move somewhere else
  -%% A tuple of the arguments of a lasp process.
  --type process_args() :: {[{lasp_vertex(), function()}],
  -                         function(),
  -                         {lasp_vertex(), function()}}.
  -
  --record(vertex_label, {process_pointer :: contract_process_id()}).
  -
  +                     read :: function(),
  +                     transform :: function(),
  +                     write :: function()}).
  +
  +%% A vertex in the dag represents either a crdt value or a lasp process pid
  +%% Pids are used to model reads and updates to a value.
   -type lasp_vertex() :: id() | pid().
   
   %% Return type of digraph:edge/2
  
positive.code:     apply_sequentially(Int(H(X)), T, Int, Final).
  
  %% @doc Get an unique identifier for a process in the graph.
  -spec process_hash(process_args()) -> contract_process_id().
  process_hash(Args) ->
      erlang:phash2(Args).
  
  
negative.code:     end.
  
  %% @doc Get the tail of the process that contracted a path.
  -spec get_process_tail(process_hash(), optimized_map()) -> lasp_vertex().
  get_process_tail(Id, OptMap) ->
      {_, [Tail | _], _} = dict:fetch(Id, OptMap),
      Tail.
  