anchor.diff:  	true = lists:all(F, ProdRefs),
   	ok = mnesia:delete(bucket, BId, write).
   
  --spec find_service(Identity) -> Result  
  +-spec find_service(Identity) -> Result 
   	when
   		Identity :: string() | binary(),
   		Result :: {ok, #service{}} | {error, Reason},
  
positive.code: 
  -spec query_bucket(Cont, Id, Product) -> Result
  	when
  		Cont :: start | eof | any(),
  		Id :: string() | undefined | '_',
  		Product :: string() | undefined | '_',
  		Result :: {Cont, [#bucket{}]} | {error, Reason},
  		Reason :: term().
  %% @doc Query bucket
  query_bucket(Cont, Id, undefined) ->
  	query_bucket(Cont, Id, '_');
  query_bucket(Cont, undefined, Product) ->
  	query_bucket(Cont, '_', Product);
  query_bucket(start, Id, Product) ->
  	MatchSpec = [{'_', [], ['$_']}],
  	F = fun F(start, Acc) ->
  				F(mnesia:select(bucket, MatchSpec,
  						?CHUNKSIZE, read), Acc);
  			F('$end_of_table', Acc) ->
  				lists:flatten(lists:reverse(Acc));
  			F({error, Reason}, _Acc) ->
  				{error, Reason};
  			F({Services, Cont}, Acc) ->
  				F(mnesia:select(Cont), [Services | Acc])
  	end,
  	case mnesia:transaction(F, [start, []]) of
  		{aborted, Reason} ->
  			{error, Reason};
  		{atomic, Buckets} ->
  			{eof, query_bucket1(Id, Product, Buckets)}
  	end.
  %% @hidden
  query_bucket1('_', Product, Buckets) ->
  	query_bucket2(Product, Buckets);
  query_bucket1(Id, Product, Buckets) ->
  	F = fun(#bucket{id = Id1}) -> lists:prefix(Id, Id1) end,
  	NewBuckets = lists:filter(F, Buckets),
  	query_bucket2(Product, NewBuckets).
  %% @hidden
  query_bucket2('_', Buckets) ->
  	Buckets;
  query_bucket2(Product, Buckets) ->
  	F1 = fun(#bucket{product = Products}) ->
  		F2 = fun(Product1) -> lists:prefix(Product, Product1) end,
  		lists:any(F2, Products)
  	end,
  	lists:filter(F1, Buckets).
  
  -spec delete_bucket(BucketId) -> ok
  	when
  
negative.code: match_condition(Var, {gte, Term}) ->
  	{'>=', Var, Term}.
  
  
  %% @hidden
  match(exact, String, String) ->
  	true;
  match(exact, _String1, _String2) ->
  	false;
  match(notexact, String, String) ->
  	false;
  match(notexact, _String1, _String2) ->
  	true;
  match(like, String1, String2) ->
  	case lists:last(String1) of
  		$% ->
  			Prefix = lists:droplast(String1),
  			lists:prefix(Prefix, String2);
  		_ ->
  			lists:prefix(String1, String2)
  	end.
  