anchor.diff:      end.
   
   %% @doc Return the binding status of a given dataflow variable.
  +%%
   is_det(Id, Store) ->
       [{_Key, #dv{bound=Bound}}] = ets:lookup(Store, Id),
       {ok, Bound}.
   
   %% @doc Spawn a function.
  +%%
   thread(Module, Function, Args, _Store) ->
       Fun = fun() -> erlang:apply(Module, Function, Args) end,
       Pid = spawn(Fun),
  
positive.code: 
  %% @doc Determine if a change for a given type is a strict inflation or
  %%      not.
  is_lattice_strict_inflation(riak_dt_gset, undefined, Current) ->
      is_lattice_inflation(riak_dt_gset, undefined, Current);
  is_lattice_strict_inflation(riak_dt_gset, Previous, Current) ->
  
negative.code: write(Type, Value, Next, Key, Store) ->
      lager:info("Writing key: ~p next: ~p", [Key, Next]),
      [{_Key, #dv{waiting_threads=Threads,
                  binding_list=BindingList,
                  lazy=Lazy}}] = ets:lookup(Store, Key),
      lager:info("Waiting threads are: ~p", [Threads]),
      {ok, StillWaiting} = reply_to_all(Threads, [], {ok, Type, Value, Next}),
      V1 = #dv{type=Type,
               value=Value,
               next=Next,
               lazy=Lazy,
               bound=true,
               waiting_threads=StillWaiting},
      true = ets:insert(Store, {Key, V1}),
      notify_all(BindingList, Value, Store),
      ok.
  
  %% @doc Update a partially bound variable, when what it's been bound to
  %%      is bound.
  %%
  notify_value(Id, Value, Store) ->
      [{_, #dv{next=Next, type=Type}}] = ets:lookup(Store, Id),
      write(Type, Value, Next, Id, Store).
  
  %% @doc Notify a series of variables of bind.
  %%
  notify_all([H|T], Value, Store) ->
      notify_value(H, Value, Store),
      notify_all(T, Value, Store);
  notify_all([], _, _) ->
      ok.
  
  %% @doc Given a group of processes which are blocking on reads, notify
  %%      them of bound values or met thresholds.
  %%
  reply_to_all(List, Result) ->
      reply_to_all(List, [], Result).
  
  %% @doc Given a group of processes which are blocking on reads, notify
  %%      them of bound values or met thresholds.
  %%
  reply_to_all([{threshold, From, Type, Threshold}=H|T],
               StillWaiting0,
               {ok, Type, Value, Next}=Result) ->
  