Enumeration on Trees with Tractable Combined Complexity and Efficient Updates

We give an algorithm to enumerate the results on trees of monadic second-order (MSO) queries represented by nondeterministic tree automata. After linear time preprocessing (in the input tree), we can enumerate answers with linear delay (in each answer). We allow updates on the tree to take place at any time, and we can then restart the enumeration after logarithmic time in the tree. Further, all our combined complexities are polynomial in the automaton. Our result follows our previous circuit-based enumeration algorithms based on deterministic tree automata, and is also inspired by our earlier result on words and nondeterministic sequential extended variable-set automata in the context of document spanners. We extend these results and combine them with a recent tree balancing scheme by Niewerth, so that our enumeration structure supports updates to the underlying tree in logarithmic time (with leaf insertions, leaf deletions, and node relabelings). Our result implies that, for MSO queries with free first-order variables, we can enumerate the results with linear preprocessing and constant-delay and update the underlying tree in logarithmic time, which improves on several known results for words and trees. Building on lower bounds from data structure research, we also show unconditionally that up to a doubly logarithmic factor the update time of our algorithm is optimal. Thus, unlike other settings, there can be no algorithm with constant update time.

[1]  Pierre Senellart,et al.  Provenance Circuits for Trees and Treelike Instances , 2015, ICALP.

[2]  Luc Segoufin A glimpse on constant delay enumeration (Invited Talk) , 2014, STACS.

[3]  Stijn Vansummeren,et al.  Constant Delay Algorithms for Regular Document Spanners , 2018, PODS.

[4]  Stefan Mengel,et al.  Tractable QBF by Knowledge Compilation , 2019, STACS.

[5]  Nicole Schweikardt,et al.  Answering FO+MOD Queries under Updates on Bounded Degree Databases , 2017, ICDT.

[6]  Luc Segoufin,et al.  Enumeration of monadic second-order queries on trees , 2013, TOCL.

[7]  Mikołaj Bojańczyk Algebra for trees , 2021 .

[8]  Luc Segoufin,et al.  Enumeration of MSO Queries on Strings with Constant Delay and Logarithmic Updates , 2018, PODS.

[9]  François Le Gall,et al.  Powers of tensors and fast matrix multiplication , 2014, ISSAC.

[10]  Nicole Schweikardt,et al.  Answering Conjunctive Queries under Updates , 2017, PODS.

[11]  Nicole Schweikardt,et al.  Enumeration for FO Queries over Nowhere Dense Graphs , 2018, PODS.

[12]  Albert R. Meyer,et al.  WEAK MONADIC SECOND ORDER THEORY OF SUCCESSOR IS NOT ELEMENTARY-RECURSIVE , 1973 .

[13]  Joachim Niehren,et al.  Querying Unranked Trees with Stepwise Tree Automata , 2004, RTA.

[14]  Guillaume Bagan,et al.  MSO Queries on Tree Decomposable Structures Are Computable with Linear Delay , 2006, CSL.

[15]  James W. Thatcher,et al.  Generalized finite automata theory with an application to a decision problem of second-order logic , 1968, Mathematical systems theory.

[16]  Adnan Darwiche,et al.  New Compilation Languages Based on Structured Decomposability , 2008, AAAI.

[17]  Antoine Amarilli,et al.  Constant-Delay Enumeration for Nondeterministic Document Spanners , 2019, ICDT.

[18]  Arnaud Durand,et al.  On Acyclic Conjunctive Queries and Constant Delay Enumeration , 2007, CSL.

[19]  Matthias Niewerth,et al.  MSO Queries on Trees: Enumerating Answers under Updates Using Forest Algebras , 2018, LICS.

[20]  Markus Kröll,et al.  Enumeration Complexity of Conjunctive Queries with Functional Dependencies , 2018, ICDT.

[21]  Dan Olteanu,et al.  Factorized Databases , 2016, SGMD.

[22]  Yannis Papakonstantinou,et al.  Incremental validation of XML documents , 2003, TODS.

[23]  Antoine Amarilli,et al.  Enumeration on Trees under Relabelings , 2017, ICDT.

[24]  Antoine Amarilli,et al.  A Circuit-Based Approach to Efficient Enumeration , 2017, ICALP.

[25]  RONALD FAGIN,et al.  Document Spanners , 2015, J. ACM.

[26]  Arnaud Durand,et al.  First-order queries on structures of bounded degree are computable with constant delay , 2005, TOCL.

[27]  Igor Walukiewicz,et al.  Forest algebras , 2008, Logic and Automata.

[28]  Joachim Niehren,et al.  On the minimization of XML Schemas and tree automata for unranked trees , 2007, J. Comput. Syst. Sci..

[29]  Wim Martens,et al.  MSO queries on trees: enumerating answers under updates , 2014, CSL-LICS.

[30]  Torben Hagerup,et al.  Parallel Algorithms with Optimal Speedup for Bounded Treewidth , 1995, SIAM J. Comput..

[31]  Wim Martens,et al.  Evaluation and Enumeration Problems for Regular Path Queries , 2018, ICDT.

[32]  Erik D. Demaine,et al.  Logarithmic Lower Bounds in the Cell-Probe Model , 2005, SIAM J. Comput..

[33]  Adnan Darwiche,et al.  On the Tractable Counting of Theory Models and its Application to Truth Maintenance and Belief Revision , 2001, J. Appl. Non Class. Logics.

[34]  Stephen Alstrup,et al.  Marked ancestor problems , 1998, Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280).

[35]  Nicole Schweikardt,et al.  Answering UCQs under updates and in the presence of integrity constraints , 2017, ICDT.