anchor.diff:  %%% Attention: There is a case that checks the size of this tuple below!!
                    }.
   
  --type replies() :: {
  +-type gen_replies() :: {
                       non_neg_integer(), %% number of newest replies
                       non_neg_integer(), %% number of acks
                       non_neg_integer(), %% number of denies
  
positive.code:     ?PDB:set(NewEntry, TableName).
  
  %% abstract data type to collect quorum read/write replies
  -spec entry_new_read(any(), any(), ?RT:key(), module(),
                       comm:erl_local_pid(), non_neg_integer(), any(),
                       non_neg_integer())
                      -> entry().
  entry_new_read(Debug, ReqId, Key, DataType, Client, Period, Filter, RetriggerAfter) ->
      Replies = {_NumNewest = 0, _NumAcked = 0, _NumDenied = 0,
                 _MaxSeenWRound = pr:new(0,0), _Val = empty_new_read_entry},
      {ReqId, Debug, Period, Period + RetriggerAfter + 20, Key, DataType, Client,
       Filter, _ValueToWrite = is_read, _MyRound = pr:new(0, 0), Replies}.
  
  -spec entry_new_write(any(), any(), ?RT:key(), module(), comm:erl_local_pid(),
                        non_neg_integer(), tuple(), any(), non_neg_integer())
                       -> entry().
  entry_new_write(Debug, ReqId, Key, DataType, Client, Period, Filters, Value, RetriggerAfter) ->
      Replies = {_NumNewest = 0, _NumAcked = 0, _NumDenied = 0,
                 _MaxSeenRound = pr:new(0,0), _Val = empty_new_write_entry},
      {ReqId, Debug, Period, Period + RetriggerAfter, Key, DataType, Client,
       Filters, _ValueToWrite = Value, _MyRound = pr:new(0, 0), Replies}.
  
  -spec entry_reqid(entry())        -> any().
  entry_reqid(Entry)                -> element(1, Entry).
  
negative.code: 
  %% TODO: add support for *consistent* quorum by counting the number of
  %% same-round-number replies
  
  %% rr_replies are received after executing a read without round number
  %% to receive the current highest read round. If the replies are a
  %% consistent quorum, the read value can be directly delivered, otherwise
  %% a read with the highest round number is executed.
  -record(rr_replies, {reply_count :: non_neg_integer(),            %% total number of replies recieved
                       newest_r_reply_count :: non_neg_integer(),   %% number of replies with current highest read round
                       highest_r_round :: pr:pr(),                  %% highest read round received in replies
                       newest_w_reply_count ::non_neg_integer(),    %% number of replies with current highest write round
                       highest_w_round :: pr:pr(),                  %% highest write round recieved in replies
                       read_value :: any()                          %% value received in the reply with highest round
                      }).
  
  -type replies() :: gen_replies() | #rr_replies{}.
  
  -type entry() :: {any(), %% ReqId
                    any(), %% debug field
  