cs.IRJan 26, 2026

The P\mathbf{P}-Completeness of Inverted Index Traversal: On the Complexity of Evaluating Boolean Query DAGs

Authors: Amir Aavani

Organizations: Apple Inc., USA

Abstract

Modern AI agents increasingly rely on search infrastructure to execute complex, neuro-symbolic reasoning workflows. These workflows often compile into deeply nested, non-monotonic Boolean queries over text fields. However, standard query evaluation strategies over inverted indices face severe theoretical limits when handling these structures. Stateful iterator models (Document-at-a-Time) are structurally bounded by NC1\text{NC}^1 formula evaluation, suffering a worst-case O(2Q)O(2^{|Q|}) exponential blowup in query complexity when unrolling re-convergent logic. Conversely, recursive materialization models (Term-at-a-Time) incur an Ω(U)Ω(|U|) space complexity penalty (the Universal Scan) when evaluating logical negation over the document universe. In this paper, we establish the theoretical boundaries of executing complex logic natively over an inverted index. We formalize a retrieval language (LR\mathcal{L}_R) based on Directed Acyclic Graphs (DAGs) and prove that its evaluation problem is strictly \textbf{P\mathbf{P}-Complete}. To make evaluation tractable, we introduce \texttt{ComputePN}, a deterministic, sparsity-aware evaluation algorithm. By decoupling logical negation from universe-scale materialization via a novel Positive-Negative dual representation, and utilizing native DAG memoization, \texttt{ComputePN} strictly bounds evaluation time to O(QUactive)O(|Q| \cdot |U_{\mathit{active}}|). This approach successfully evaluates P\mathbf{P}-Complete queries natively over the index, avoiding both the combinatorial tree-expansion bottleneck and the universal scan penalty, laying the formal foundation for computational retrieval.

Explore similar work

CardsList
  1. Reproducing Complex Set-Compositional Information Retrieval

    May 5, 2026Vincent Degenhart, Dewi Timman, Arjen P. de Vries +2RetrieversShortcuts

  2. RL-Index: Reinforcement Learning for Retrieval Index Reasoning

    Jun 15, 2026Yongjia Lei, Nedim Lipka, Zhisheng Qi +5