anchor.diff:  -module(doko_query).
  --ifdef(DISABLED_FOR_NOW).
  +-ifdef(TEST).
   -include_lib("proper/include/proper.hrl").
   -include_lib("eunit/include/eunit.hrl").
   -endif.
  
positive.code: prop_no_nested_or() ->
      ?FORALL(X, q(), not nested_or(dnf({X,depth(X)}))).
  
  nested_or({q,L,R}) ->
      (is_record(L, or_q) or is_record(R, or_q))
          orelse (nested_or(L) or nested_or(R));
  nested_or({or_q,L,R}) ->
      nested_or(L) or nested_or(R);
  nested_or({not_q,Q}) ->
      nested_or(Q);
  nested_or(_) ->
  
negative.code: -type q() :: {and_q,  q(), q()} |
               {or_q,   q(), q()} |
               {not_q,  q()     } |
               {term_q, string(), list(string())}.
  
  %%----------------------------------------------------------------------------
  %% API
  %%----------------------------------------------------------------------------
  
  -spec execute(atom(), doko_utf8:str()) -> gb_set().
  execute(IndexId, Str) ->
      %% parse and preprocess query
      Clauses = [partition(flatten(X))||X <- clauses(dnf(from_str(Str)))],
  