anchor.diff:  
   -define(COUNTER, riak_dt_gcounter).
   
  +%% The maximum number of impressions for each advertisement to display.
  +-define(MAX_IMPRESSIONS, 5).
  +
  +%% The number of events to sent to clients.
  +-define(NUM_EVENTS, 5000).
  +
  +%% The number of clients.
  +-define(NUM_CLIENTS, 10).
  +
   -record(ad, {id, image, counter}).
   
   -record(contract, {id}).
  
positive.code:                                       undefined)
                  end, Ids),
  
      %% Debug; print the list of advertisements to the log.
      {ok, {_, _, Contracts0}} = lasp:read(Contracts, undefined),
      lager:info("Current contracts: ~p",
                 [?SET:value(Contracts0)]),
  
      %% Compute the Cartesian product of both ads and contracts.
      {ok, AdsContracts} = lasp:declare(?SET),
      ok = lasp:product(Ads, Contracts, AdsContracts),
  
      %% Debug; print the product.
      timer:sleep(500),
      {ok, {_, _, AdsContracts0}} = lasp:read(AdsContracts, undefined),
      lager:info("Current ads-contracts: ~p",
                 [?SET:value(AdsContracts0)]),
  
      %% Filter items by join on item it.
      {ok, AdsWithContracts} = lasp:declare(?SET),
  
negative.code:     {ok, Ads} = lasp:declare(?SET),
      ok = lasp:union(RovioAds, TriforkAds, Ads),
  
      %% For each identifier, generate a contract.
      {ok, Contracts} = lasp:declare(?SET),
      lists:map(fun(Id) ->
  