English

Semantic Tree-Width and Path-Width of Conjunctive Regular Path Queries

Logic in Computer Science 2025-03-12 v6 Databases Formal Languages and Automata Theory

Abstract

We show that the problem of whether a query is equivalent to a query of tree-width kk is decidable, for the class of Unions of Conjunctive Regular Path Queries with two-way navigation (UC2RPQs). A previous result by Barcel\'o, Romero, and Vardi [SIAM Journal on Computing, 2016] has shown decidability for the case k=1k=1, and here we extend this result showing that decidability in fact holds for any arbitrary k1k\geq 1. The algorithm is in 2ExpSpace, but for the restricted but practically relevant case where all regular expressions of the query are of the form aa^* or (a1++an)(a_1 + \dotsb + a_n) we show that the complexity of the problem drops to Π2P\Pi^P_2. We also investigate the related problem of approximating a UC2RPQ by queries of small tree-width. We exhibit an algorithm which, for any fixed number kk, builds the maximal under-approximation of tree-width kk of a UC2RPQ. The maximal under-approximation of tree-width kk of a query qq is a query qq' of tree-width kk which is contained in qq in a maximal and unique way, that is, such that for every query qq'' of tree-width kk, if qq'' is contained in qq then qq'' is also contained in qq'. Our approach is shown to be robust, in the sense that it allows also to test equivalence with queries of a given path-width, it also covers the previously known result for k=1k=1, and it allows to test for equivalence of whether a (one-way) UCRPQ is equivalent to a UCRPQ of a given tree-width (or path-width).

Keywords

Cite

@article{arxiv.2212.01679,
  title  = {Semantic Tree-Width and Path-Width of Conjunctive Regular Path Queries},
  author = {Diego Figueira and Rémi Morvan},
  journal= {arXiv preprint arXiv:2212.01679},
  year   = {2025}
}
R2 v1 2026-06-28T07:21:18.563Z