anchor.diff:  
   %% @doc Sets up a new slide operation with the node's successor or predecessor
   %%      after a request for a slide has been received.
  --spec setup_slide_with(State::dht_node_state:state(), Type::slide_op:type(),
  -                       MoveFullId::slide_op:id(),
  -                       MyNode::node:node_type(), TargetNode::node:node_type(),
  -                       TargetId::?RT:key(), Tag::any(),
  -                       MaxTransportBytes::pos_integer(),
  -                       SourcePid::comm:erl_local_pid() | null, First::boolean())
  +-spec setup_slide(State::dht_node_state:state(), Type::slide_op:type(),
  +                  MoveFullId::slide_op:id(), MyNode::node:node_type(),
  +                  TargetNode::node:node_type(), TargetId::?RT:key(),
  +                  Tag::any(), MaxTransportBytes::pos_integer(),
  +                  SourcePid::comm:erl_local_pid() | null, First::boolean())
           -> dht_node_state:state().
  -setup_slide_with(State, Type, MoveFullId, MyNode,
  -                 TargetNode, TargetId, Tag, MaxTransportBytes, SourcePid, First) ->
  +setup_slide(State, Type, MoveFullId, MyNode, TargetNode, TargetId, Tag,
  +            MaxTransportBytes, SourcePid, First) ->
       case get_slide_op(State, MoveFullId) of
           % If there already is a slide operation which was previously set up or
           % due to a second message after a timeout hit on the other node,
  
positive.code:                     abort_slide(State, SlideOp, changed_parameters, true)
              end;
          not_found ->
              setup_slide_with2_not_found(
                State, Type, MoveFullId, MyNode, TargetNode, TargetId, Tag,
                MaxTransportBytes, SourcePid, First);
          {wrong_neighbor, _PredOrSucc, SlideOp} -> % wrong pred or succ
              abort_slide(State, SlideOp, wrong_pred_succ_node, true)
      end.
      
  %% @doc Sets up a new slide operation with the node's successor or predecessor
  %%      after a request for a slide has been received and setup_slide_with/9
  %%      checked that the slide to create did not exist yet.
  -spec setup_slide_with2_not_found(State::dht_node_state:state(),
          Type::slide_op:type(), MoveFullId::slide_op:id(),
          MyNode::node:node_type(), TargetNode::node:node_type(),
          TargetId::?RT:key(), Tag::any(), MaxTransportBytes::pos_integer(),
          SourcePid::comm:erl_local_pid() | null, First::boolean())
              -> dht_node_state:state().
  setup_slide_with2_not_found(State, Type, MoveFullId,
                              MyNode, TargetNode, TargetId, Tag,
                              MaxTransportBytes, SourcePid, First) ->
      PredOrSucc = slide_op:get_predORsucc(Type),
      CanSlide = case PredOrSucc of
                     pred -> can_slide_pred(State, TargetId, Type);
                     succ -> can_slide_succ(State, TargetId, Type)
                 end,
      % correct pred/succ info? did pred/succ know our current ID (compare node info)
      NodesCorrect = MyNode =:= dht_node_state:get(State, node) andalso
                         TargetNode =:= dht_node_state:get(State, PredOrSucc),
      MoveDone = (PredOrSucc =:= pred andalso node:id(TargetNode) =:= TargetId) orelse
                 (PredOrSucc =:= succ andalso node:id(MyNode) =:= TargetId),
      case CanSlide andalso NodesCorrect andalso not MoveDone of
          true ->
              case slide_op:is_leave(Type, 'send') of
  
negative.code:                     % graceful leave (slide with succ, send all data)
                      % note: may also be a jump operation!
                      % TODO: check for running slide, abort it if possible, eventually extend it
                      case slide_op:is_jump(Type) of
                          true ->
                              TIdInRange = dht_node_state:is_responsible(
                                                  TId, State),
                              TIdInSuccRange =
                                  intervals:in(TId,
                                               dht_node_state:get(State, succ_range)),
                              if % convert jump to slide?
                                  TIdInRange     -> {ok, slide, succ, 'send'};
                                  TIdInSuccRange -> {ok, slide, succ, 'rcv'};
                                  true ->
                                      SlideSucc =
                                          dht_node_state:get(State, slide_succ),
                                      SlidePred =
                                          dht_node_state:get(State, slide_pred),
                                      case SlideSucc =/= null andalso
                                               SlidePred =/= null of
                                          true -> {ok, jump, 'send'};
                                          _    -> {abort, ongoing_slide}
                                      end
                              end;
                          _ -> {ok, leave, 'send'}
                      end;
                  _ ->
                      TIdInRange = dht_node_state:is_responsible(TId, State),
                      SendOrReceive = slide_op:get_sendORreceive(Type),
                      case SendOrReceive =:= 'send' andalso not TIdInRange of
                          true -> {abort, target_id_not_in_range};
                          _    -> {ok, slide, PredOrSucc, SendOrReceive}
                      end
              end;
          _ when not CanSlide -> {abort, ongoing_slide};
          _ when not NodesCorrect -> {abort, wrong_pred_succ_node};
          _ -> {ok, move_done} % MoveDone, i.e. target id already reached (noop)
      end.
  
  %% @doc Creates a new slide operation with the node's successor or
  %%      predecessor and the given parameters according to the command created
  %%      by check_setup_slide_not_found/5.
  %%      Note: assumes that such a slide does not already exist.
  -spec exec_setup_slide_not_found(
          Command::command(), State::dht_node_state:state(),
          Type::slide_op:type(), MoveFullId::slide_op:id(),
          TargetNode::node:node_type(),
          TargetId::?RT:key(), Tag::any(), MaxTransportBytes::pos_integer(),
          SourcePid::comm:erl_local_pid() | null, First::boolean())
              -> dht_node_state:state().
  exec_setup_slide_not_found(Command, State, Type, MoveFullId, TargetNode,
                             TargetId, Tag, MaxTransportBytes, SourcePid, First) ->
      case Command of
          {abort, Reason} ->
              abort_slide(State, TargetNode, MoveFullId, null, SourcePid, Tag,
                          Type, Reason, not First);
          {ok, jump, 'send'} ->
              SlideOp = slide_op:new_sending_slide_jump(MoveFullId, TargetId, Tag, State),
              notify_other_slide(SlideOp, State);
          {ok, leave, 'send'} ->
              SlideOp = slide_op:new_sending_slide_leave(MoveFullId, leave, State),
              notify_other_slide(SlideOp, State);
          {ok, slide, pred, 'send'} ->
              % slide with pred, send data
              SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
              State1 = dht_node_state:add_db_range(State, slide_op:get_interval(SlideOp)),
              notify_other_slide(SlideOp, State1);
          {ok, slide, succ, 'send'} ->
              % slide with succ, send data
              SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
              case First of
                  true -> notify_other_slide(SlideOp, State);
                  _    -> State1 = dht_node_state:add_db_range(
                                     State, slide_op:get_interval(SlideOp)),
                          change_my_id(State1, SlideOp, TargetId)
              end;
          {ok, slide, pred, 'rcv'} ->
              % slide with pred, receive data
              SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
              State1 = dht_node_state:add_msg_fwd(
                         State, slide_op:get_interval(SlideOp),
                         node:pidX(slide_op:get_node(SlideOp))),
              notify_other_slide(SlideOp, State1);
          {ok, slide, succ, 'rcv'} ->
              % slide with succ, receive data
              SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
              case First of
                  true -> notify_other_slide(SlideOp, State);
                  _    -> State1 = dht_node_state:add_msg_fwd(
                                     State, slide_op:get_interval(SlideOp),
                                     node:pidX(slide_op:get_node(SlideOp))),
                          change_my_id(State1, SlideOp, TargetId)
              end;
          {ok, move_done} ->
              % TODO: notify other node if not first
              notify_source_pid(SourcePid, {move, result, Tag, ok}),
              State
      end.
  