AIToday
Large Language ModelsApple Machine LearningPublished: Aug 20, 2026, 04:01 JST2 min read

Apple researchers prove Boolean query evaluation over search indexes is computationally hard

Apple researchers prove Boolean query evaluation over search indexes is computationally hard

Key takeaway

  • Apple researchers have proven that evaluating complex Boolean queries natively over search indexes is a computationally hard (P-Complete) problem, and introduced an algorithm called ComputePN that sidesteps the worst-case performance penalties of existing approaches.

  • By using a Positive-Negative dual representation and DAG memoization, ComputePN bounds query evaluation time to O(|Q| · |U_active|), making it possible for AI agents to execute sophisticated logic-based search workflows at scale without combinatorial explosion or full-database scans.

3 Key Points

  1. What happened

    Apple researchers published a paper establishing that evaluating complex Boolean queries (nested logical structures) over inverted search indexes is P-Complete—a theoretical hardness result. They introduced ComputePN, an algorithm that bounds evaluation time to O(|Q| · |U_active|) by decoupling logical negation from full-database materialization via a Positive-Negative dual representation and native DAG memoization.

  2. Why it matters

    Modern AI agents rely on search infrastructure for complex reasoning workflows that compile into deeply nested Boolean queries. Existing strategies suffer severe limits: Document-at-a-Time models face exponential O(2^|Q|) blowup in query complexity, while Term-at-a-Time models incur Ω(|U|) space cost when handling negation over the entire document universe. ComputePN avoids both bottlenecks, enabling native evaluation of theoretically hard queries without combinatorial explosion or universal-scale penalties.

  3. What to watch

    The paper was accepted in the Industry Track at SIGIR 2024, suggesting near-term practical application in production search systems supporting AI agent reasoning workflows.

Ask the AI about this article →

Context & Analysis

The paper addresses a gap between theoretical computer science and practical information retrieval: modern AI agents increasingly execute neuro-symbolic reasoning workflows that compile into complex, deeply nested Boolean queries over text. However, the dominant query evaluation strategies over inverted indexes—the workhorse data structure of search systems—face severe worst-case performance boundaries that have not been formally characterized until now.

By formalizing the query evaluation problem as a DAG-based retrieval language (L_R) and proving it P-Complete, the researchers establish that there is no known polynomial-time algorithm guaranteed to handle arbitrarily complex queries efficiently in the worst case. This theoretical result validates the practical struggles engineers have observed: existing iterator-based models (Document-at-a-Time and Term-at-a-Time) each incur a different catastrophic cost—exponential query blowup in one case, universe-scale space materialization in the other.

ComputePN's contribution is to sidestep this theoretical barrier in the cases that matter most: by separating logical negation from full-database enumeration and applying deterministic DAG memoization, the algorithm achieves linear scaling in active (relevant) document set size rather than the entire universe. The acceptance of this work in the SIGIR 2024 Industry Track indicates that the practical search and retrieval community considers the approach actionable for production systems powering AI agent reasoning.

FAQ

What is P-Completeness in this context?
The paper formalizes a retrieval language (L_R) based on Directed Acyclic Graphs (DAGs) and proves that the problem of evaluating complex Boolean queries expressed in this language over inverted indexes is P-Complete—meaning it is among the hardest problems solvable in polynomial time, and is believed to lack efficient solutions.
What are the limits of existing query evaluation strategies?
Document-at-a-Time models suffer worst-case O(2^|Q|) exponential blowup in query complexity due to structural limits in how they handle re-convergent logic. Term-at-a-Time models incur Ω(|U|) space complexity penalty—requiring full-database materialization—when evaluating negation over the document universe.
How does ComputePN improve performance?
ComputePN decouples logical negation from universe-scale materialization via a novel Positive-Negative dual representation and utilizes native DAG memoization, strictly bounding evaluation time to O(|Q| · |U_active|), thus avoiding both combinatorial tree-expansion and universal scan penalties.
Apple Machine LearningRead Original Article

Get the latest Large Language Models news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Ask AI

Ask AI anything about this article. Q&As are published on this page for other readers too.

Related Articles

Next articleAdronite launches Codistry AI coding platform, claims 48% lower token costs

The AI news that matters, in one minute each morning.

Sign up free