anchor.diff:  -include("trecords.hrl").
   -include("../chordsharp.hrl").
   
  --export([new_tm_state/4, get_vote/3, store_vote/4, get_vote_acks/1, get_vote_acks/2, get_vote_acks/3, store_vote_acks/4, get_read_vote_acks/1, get_read_vote_acks/3, store_read_vote_acks/4, get_decision/3, store_decision/4, new_tm_item/4, new_translog/0, new_tm_message/2, new_vote/5, create_items/1]).
  -
  +-export([new_tm_state/4, get_vote/3, store_vote/4, get_vote_acks/1, get_vote_acks/2, get_vote_acks/3, store_vote_acks/4, get_read_vote_acks/3, store_read_vote_acks/4, new_tm_item/4, new_translog/0, new_tm_message/2, new_vote/5, create_items/1]).
  +%get_decision/3, store_decision/4, 
  +%get_read_vote_acks/1, 
   -import(dict).
   -import(lists).
   -import(?RT).
  
positive.code: 				       RVAcksReplica = lists:foldl(fun(Elem, Acc) ->
  									   dict:store(Elem, [], Acc)
  								   end,
  								   RVAcksDict,
  								   RKeys),
  				       DecReplica = lists:foldl(fun(Elem, Acc)->
  									dict:store(Elem, undecided, Acc)
  								end,
  								DecRepDict,
  								RKeys),
  				       
  				    {VotesReplica,%dict:store(Key, VotesReplica, MyVotes), 
  				     dict:store(Key, AcksReplica, MyAcks),
  				     dict:store(Key, RVAcksReplica, MyRVAcks),
  				     dict:store(Key, DecReplica, MyDec)}
  			    end,
  			    {Votes, Acks, RVAcks, Decisions},
  			    Items),
  
negative.code: %% Ack := {{AcceptedVote, AcceptedVoteTimestamp}, Timestamp}
  store_read_vote_acks(TMState, Key, RKey, Ack)->
      RVAcks = TMState#tm_state.read_vote_acks,
      RKeyAcks = dict:fetch(RKey, RVAcks),
      
      NewRKeyAcks = [Ack | RKeyAcks],
      
      NewVoteAcks = dict:store(RKey, NewRKeyAcks, RVAcks),
      TMState#tm_state{read_vote_acks = NewVoteAcks}.
  
  %% get_decision(TMState, Key, RKey)->
  %%     Decisions = TMState#tm_state.decisions,
  %%     dict:fetch(RKey, dict:fetch(Key, Decisions)).
  
  %% store_decision(TMState, Key, RKey, Decision)->
  %%     Decisions = TMState#tm_state.decisions,
  %%     ItemDecs = dict:fetch(Key, Decisions),
      
  %%     NewItemDecs = dict:store(RKey, Decision, ItemDecs),
  %%     NewDecisions = dict:store(Key, NewItemDecs, Decisions), 
  %%     TMState#tm_state{decisions = NewDecisions}.
   
  
  %%--------------------------------------------------------------------
  