anchor.diff:  	    insert_trace(clean_trace(Trace)),
   	    loop_percept_db();
   	{select, Pid, Query} ->
  -	    Pid ! select_query(Query),
  +	    Pid ! {result, select_query(Query)},
   	    loop_percept_db();
   	{action, stop} -> 
   	    stopped;
  
positive.code: 	    loop_percept_db();
          {operate, Pid, {Table, {Fun, Start}}} ->
  	    Result = ets:foldl(Fun, Start, Table),
  	    Pid ! Result,
  	    loop_percept_db();
  	Unhandled -> 
  	    io:format("loop_percept_db, unhandled query: ~p~n", [Unhandled]),
  
negative.code: 
  select(Query) -> 
      percept_db ! {select, self(), Query},
      receive {result, Match} -> Match end.
  
  %% @spec select(atom(), list()) -> Result
  %% @equiv select({Table,Options}) 
  
  select(Table, Options) -> 
      percept_db ! {select, self(), {Table, Options}},
      receive {result, Match} -> Match end.
  
  %% @spec consolidate() -> Result
  %% @doc Checks timestamp and state-flow inconsistencies in the
  