anchor.diff:  % type definitions
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  --type round()       :: {non_neg_integer(), non_neg_integer()}.
  +-type round()       :: non_neg_integer().
   -type session_id()  :: {round(), comm:mypid()}.
   -type principal_id():: comm:mypid() | none.
   
  
positive.code:     end.
  
  -spec next_round(round()) -> round().
  next_round({R, _Fork}) -> {R + 1, 0}.
  
  -spec new_session(round(), comm:mypid(), rr_recon:method(), principal_id()) -> session().
  new_session(Round, Pid, RCMethod, Principal) ->
      #session{ id = {Round, Pid}, rc_method = RCMethod, ttl = get_session_ttl(), principal = Principal }.
  
  -spec session_id_equal(session_id(), session_id()) -> boolean().
  session_id_equal({{R, _}, Pid}, {{R, _}, Pid}) -> true;
  session_id_equal(_, _) -> false.
  
  -spec fork_session(session_id()) -> session_id().
  fork_session({{R, F}, Pid}) ->
      {{R, F + 1}, Pid}.
  
  -spec extract_session(session_id() | null, [session()]) -> {session(), Remain::[session()]} | not_found.
  extract_session(null, _Sessions) -> not_found;
  
negative.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  -export([start_link/1, init/1, on/2, check_config/0,
           session_id_equal/2,
           select_sync_node/2]).
  
  -ifdef(with_export_type_support).
  