Apple researchers have formally proven that evaluating complex Boolean queries over inverted indexes is a P-Complete problem, establishing a theoretical ceiling for traditional search infrastructure. The paper, authored by Amir Aavani and published on Apple's Machine Learning Research site in August 2026, demonstrates that standard evaluation strategies — Document-at-a-Time (DAAT) and Term-at-a-Time (TAAT) — hit fundamental complexity barriers when handling the deeply nested, non-monotonic Boolean DAGs generated by modern neuro-symbolic AI agents.
DAAT's stateful iterator model is structurally bounded by NC¹ formula evaluation, suffering a worst-case O(2^|Q|) exponential blowup when unrolling re-convergent logic. TAAT's recursive materialization incurs an Ω(|U|) space penalty — the "Universal Scan" — when evaluating logical negation over the entire document universe. Both approaches were optimized for monotonic top-k retrieval, not the re-convergent DAG structures produced by LLM-driven reasoning workflows.
What's New
The paper formalizes a retrieval language ℒ_R based on Directed Acyclic Graphs and proves its evaluation problem is strictly P-Complete. To make such queries tractable, Apple introduces ComputePN, a deterministic, sparsity-aware algorithm that decouples logical negation from universe-scale materialization through a novel Positive-Negative dual representation. By combining this representation with native DAG memoization, ComputePN bounds evaluation time to O(|Q| · |U_active|), where U_active is the set of documents actually relevant to the query rather than the full universe.
The algorithm avoids both the combinatorial tree-expansion bottleneck of DAAT and the universal scan penalty of TAAT. The work also outlines a "Computational Retrieval Architecture" positioning the inverted index as a programmable execution substrate — effectively a CPU for Boolean logic — rather than a passive lookup structure.
Why It Matters
As AI agents increasingly compile complex reasoning into precise Boolean constraints — arithmetic filters, exclusivity rules, and nested negations — search infrastructure must evaluate these natively without falling back to expensive post-filtering or neural approximation. The P-Completeness result means no sub-polynomial algorithm exists unless P = NC, so the practical path forward is sparsity-aware evaluation that scales with active documents, not the corpus size. This has direct implications for hybrid search systems, relational databases using GIN indexes, and any platform where LLMs drive structured retrieval.
Our Take
The paper reframes the inverted index from a retrieval primitive into a computational primitive. That shift matters because it gives system architects a complexity-theoretic basis for choosing evaluation strategies: if your workload is P-Complete, you need an algorithm like ComputePN that respects sparsity, not a faster iterator. The open question is how quickly this theory translates into production engines — PostgreSQL's GIN, Lucene, and vector-hybrid platforms all still default to DAAT/TAAT hybrids.