anchor.diff:              )
       end.
   
  --spec remove_from_local_table(Name :: any()) -> ok.
  -remove_from_local_table(Name) ->
  -    mnesia:dirty_delete(syn_registry_table, Name).
  -
  --spec find_processes_entry_by_pid(Pid :: pid()) -> Entries :: [#syn_registry_table{}].
  -find_processes_entry_by_pid(Pid) when is_pid(Pid) ->
  -    mnesia:dirty_index_read(syn_registry_table, Pid, #syn_registry_table.pid).
  -
  --spec find_process_entry_by_name(Name :: any()) -> Entry :: #syn_registry_table{} | undefined.
  -find_process_entry_by_name(Name) ->
  -    case mnesia:dirty_read(syn_registry_table, Name) of
  -        [Entry] -> Entry;
  -        _ -> undefined
  -    end.
  -
  --spec get_registry_tuples_for_node(Node :: node()) -> [syn_registry_tuple()].
  -get_registry_tuples_for_node(Node) ->
  -    %% build match specs
  -    MatchHead = #syn_registry_table{name = '$1', pid = '$2', node = '$3', meta = '$4', _ = '_'},
  -    Guard = {'=:=', '$3', Node},
  -    RegistryTupleFormat = {{'$1', '$2', '$4'}},
  -    %% select
  -    mnesia:dirty_select(syn_registry_table, [{MatchHead, [Guard], [RegistryTupleFormat]}]).
  -
  --spec handle_process_down(Name :: any(), Pid :: pid(), Meta :: any(), Reason :: any(), #state{}) -> ok.
  -handle_process_down(Name, Pid, Meta, Reason, #state{
  -    custom_event_handler = CustomEventHandler
  -}) ->
  -    case Name of
  -        undefined ->
  -            error_logger:warning_msg(
  -                "Syn(~p): Received a DOWN message from an unregistered process ~p with reason: ~p~n",
  -                [node(), Pid, Reason]
  -            );
  -        _ ->
  -            syn_event_handler:do_on_process_exit(Name, Pid, Meta, Reason, CustomEventHandler)
  -    end.
  -
  --spec sync_registry_tuples(RemoteNode :: node(), RegistryTuples :: [syn_registry_tuple()], #state{}) -> ok.
  -sync_registry_tuples(RemoteNode, RegistryTuples, State) ->
  -    %% ensure that registry doesn't have any joining node's entries (here again for race conditions)
  -    purge_registry_entries_for_remote_node(RemoteNode),
  -    %% loop
  -    F = fun({Name, RemotePid, RemoteMeta}) ->
  -        %% check if same name is registered
  -        case find_process_entry_by_name(Name) of
  -            undefined ->
  -                %% no conflict
  -                register_on_node(Name, RemotePid, RemoteMeta);
  -
  -            Entry ->
  -                LocalPid = Entry#syn_registry_table.pid,
  -                LocalMeta = Entry#syn_registry_table.meta,
  -
  -                error_logger:warning_msg(
  -                    "Syn(~p): Conflicting name in auto merge for: ~p, processes are ~p, ~p~n",
  -                    [node(), Name, {LocalPid, LocalMeta}, {RemotePid, RemoteMeta}]
  -                ),
  -
  -                resolve_conflict(Name, {LocalPid, LocalMeta}, {RemotePid, RemoteMeta},
  -                    fun() ->
  -                        ok = rpc:call(RemoteNode, syn_registry, remove_from_local_table, [Name])
  -                    end,
  -                    fun() ->
  -                        add_to_local_table(Name, RemotePid, RemoteMeta, undefined)
  -                    end,
  -                    State
  -                )
  -        end
  -    end,
  -    %% add to table
  -    lists:foreach(F, RegistryTuples).
  -
   -spec purge_registry_entries_for_remote_node(Node :: atom()) -> ok.
   purge_registry_entries_for_remote_node(Node) when Node =/= node() ->
       %% NB: no demonitoring is done, hence why this needs to run for a remote node
  
positive.code: -export([count/0, count/1]).
  
  %% sync API
  -export([sync_register/4, sync_unregister/2]).
  -export([sync_get_local_registry_tuples/1]).
  -export([add_to_local_table/4]).
  -export([remove_from_local_table/1]).
  
  
negative.code: -spec multicast_register(Name :: any(), Pid :: pid(), Meta :: any()) -> pid().
  multicast_register(Name, Pid, Meta) ->
      spawn_link(fun() ->
          rpc:eval_everywhere(nodes(), ?MODULE, add_remote_to_local_table, [Name, Pid, Meta])
      end).
  
  -spec multicast_unregister(Name :: any()) -> pid().
  multicast_unregister(Name) ->
      spawn_link(fun() ->
          rpc:eval_everywhere(nodes(), ?MODULE, remove_from_local_table, [Name])
      end).
  
  -spec multicast_inconsistent_name_data(Name :: any(), Pid :: pid(), Meta :: any()) -> pid().
  multicast_inconsistent_name_data(Name, Pid, Meta) ->
      spawn_link(fun() ->
          lists:foreach(fun(RemoteNode) ->
              raise_inconsistent_name_data(RemoteNode, node(), Name, Pid, Meta)
          end, nodes())
      end).
  
  