anchor.diff:  map_data(emptymap) -> [];
   map_data({map, KV, L, R, _}) -> map_data(L) ++ [KV] ++ map_data(R).
   
  -split(S) -> split(S,"",[]).
  -split([],"",L) -> L;
  -split([],W,L) -> [W] ++ L;
  -split([$\n|T],"",L) -> split(T,"",L);
  -split([$\n|T],W,L) -> split(T,"",[W] ++ L);
  -split([H|T],W,L) -> split(T,[H|W],L).
  -
  -delfirst([$\n|T]) -> T;
  -delfirst([_|T]) -> delfirst(T).
  -
  -%% 単語リスト取得
  -getwords() ->
  -    case io:get_chars("",20000) of
  -        eof -> eof;
  -        {error, E} -> {error, E};
  -        S -> split(delfirst(S))
  -    end.
  
positive.code: 
  map_new() -> emptymap.
  
  map_get(FK, {map, {K,V}, L, R, _}) ->
      case comp(FK, K) of
          eq -> {ok, V};
          lt -> map_get(FK, L);
  
negative.code:     case LD - RD of
          X when X > 1 ->
              {_, KVL, LL, RL, _} = L,
              NR = map_rotate({map, KV, RL, R, 0}),  % map_rotateでDepthは使われないので0
              NRD = map_depth(NR),
              LLD = map_depth(LL),
              D = if LLD > NRD -> LLD; true -> NRD end,
              {map, KVL, LL, NR, D + 1};
          Y when Y < -1 ->
              {_, KVR, LR, RR, _} = R,
              NL = map_rotate({map, KV, L, LR, 0}),
              NLD = map_depth(NL),
              RRD = map_depth(RR),
              D = if RRD > NLD -> RRD; true -> NLD end,
              {map, KVR, NL, RR, D + 1};
          _Else ->
              D = if LD > RD -> LD; true -> RD end,
              {map, KV, L, R, D + 1}
  