anchor.diff:  %% @doc Deletes the tuple saved under Key and returns the new DB.
   %%      If such a tuple does not exists nothing is changed.
   -spec delete(DB::db(), Key::key()) -> db().
  -delete({DB, FileName}, Key) ->
  +delete({DB, _FileName} = State, Key) ->
       toke_drv:delete(DB, ?IN(Key)),
  -    {DB, FileName}.
  +    State.
   
   %% @doc Returns the name of the DB specified in new/1.
   -spec get_name(DB::db()) -> nonempty_string().
  
positive.code: -spec new(DBName::nonempty_string()) -> db().
  new(_DBName) ->
      Dir = util:make_filename(atom_to_list(node())),
      FullDir = lists:flatten([config:read(db_directory), "/", Dir]),
      _ = case file:make_dir(FullDir) of
          ok -> ok;
          {error, eexist} -> ok;
          {error, Error} -> exit({db_toke, 'cannot create dir', FullDir, Error})
      end,
      {_Now_Ms, _Now_s, Now_us} = Now = erlang:now(),
      {{Year, Month, Day}, {Hour, Minute, Second}} =
                                                     calendar:now_to_local_time(Now),
      FileBaseName = util:make_filename(
              io_lib:format("db_~B~B~B-~B~B~B\.~B.tch",
                            [Year, Month, Day, Hour, Minute, Second, Now_us])),
      FullFileName = lists:flatten([FullDir, "/", FileBaseName]),
      new_db(FullFileName, [read, write, create, truncate]).
  
  
negative.code: -spec foldl(DB::db(), Fun::fun((Entry::entry(), AccIn::A) -> AccOut::A), Acc0::A,
                                 Intervall::backend_beh:interval(), MaxNum::non_neg_integer()) -> Acc1::A.
  foldl({DB, _FileName}, Fun, Acc, Interval, MaxNum) ->
      {_Left, Data} = toke_drv:fold(
                        fun(_Key, _Entry, {0, _} = AccIn) ->
                                AccIn;
                           (_Key, Entry, {Max, AccIn}) ->
                                DeCoded = ?OUT(Entry),
                                case is_in(Interval, element(1, DeCoded)) of
                                    true ->
                                        {Max - 1, [DeCoded | AccIn]};
                                    _ ->
                                        {Max, AccIn}
                                end
                        end, {MaxNum, []}, DB),
      lists:foldl(Fun, Acc, Data).
  
  %% @doc Is equivalent to ets:foldr(Fun, Acc0, DB).
  