skip to main content
10.1145/3209108.3209144acmconferencesArticle/Chapter ViewAbstractPublication PageslicsConference Proceedingsconference-collections
research-article

MSO Queries on Trees: Enumerating Answers under Updates Using Forest Algebras

Published: 09 July 2018 Publication History

Abstract

We investigate efficient enumeration of answers to MSO-definable queries over trees which are subject to local updates. We exhibit an algorithm that uses an O(n) preprocessing phase and enumerates answers with O(log(n)) delay between them. When the tree is updated, the algorithm can avoid repeating expensive preprocessing and restart the enumeration phase within O(log(n)) time. This improves over previous results that require O(log2(n)) time after updates and have O(log2(n)) delay. Our algorithms and complexity results in the paper are presented in terms of node-selecting tree automata representing the MSO queries. To present our algorithm, we introduce a balancing scheme for parse trees of forest algebra formulas that is of its own interest to lift results from strings to trees.

References

[1]
G. Adelson-Velsky and E. Landis. 1962. An Algorithm for the Organization of Information. Doklady Akademii Nauk USSR 146, 2 (1962), 263--266.
[2]
A. Amarilli, P. Bourhis, L. Jachiet, and S. Mengel. 2017. A Circuit-Based Approach to Efficient Enumeration. In 44th International Colloquium on Automata, Languages, and Programming, ICALP 2017. 111:1--111:15.
[3]
A. Amarilli, P. Bourhis, and S. Mengel. 2018. Enumeration on Trees under Relabelings. In International Conference Database Theory (ICDT). 5:1--5:18.
[4]
G. Bagan. 2006. MSO Queries on Tree Decomposable Structures Are Computable with Linear Delay. In Computer Science Logic (CSL). 167--181.
[5]
A. Balmin, Y. Papakonstantinou, and V. Vianu. 2004. Incremental validation of XML documents. ACM Transactions on Database Systems (TODS) 29, 4 (2004), 710--751.
[6]
D. Barbosa, A.O. Mendelzon, L. Libkin, L. Mignet, and M. Arenas. 2004. Efficient Incremental Validation of XML Documents. In ICDE. 671--682.
[7]
C. Berkholz, J. Keppeler, and N. Schweikardt. 2017. Answering Conjunctive Queries under Updates. In International Symposium on Principles of Database Systems (PODS). 303--318.
[8]
C. Berkholz, J. Keppeler, and N. Schweikardt. 2017. Answering FO+MOD Queries Under Updates on Bounded Degree Databases. In International Conference Database Theory (ICDT). 8:1--8:18.
[9]
C. Berkholz, J. Keppeler, and N. Schweikardt. 2018. Answering UCQs under Updates and in the Presence of Integrity Constraints. In International Conference Database Theory (ICDT). 8:1--8:19.
[10]
H. Björklund, W. Gelade, and W. Martens. 2010. Incremental XPath evaluation. ACM Transactions on Database Systems (TODS) 35, 4 (2010), 29:1--29:43.
[11]
H. Björklund, W. Martens, and T. Timm. 2015. Efficient Incremental Evaluation of Succinct Regular Expressions. In ACM Conference on Information and Knowledge Management (CIKM). 1541--1550.
[12]
H. L. Bodlaender and T. Hagerup. 1998. Parallel Algorithms with Optimal Speedup for Bounded Treewidth. SIAM J. Comput. 27, 6 (1998), 1725--1746.
[13]
M. Bojańczyk. 2010. Algebra for trees. In In Handbook of Automata Theory. European Mathematical Society Publishing.
[14]
M. Bojańczyk and I. Walukiewicz. 2007. Forest algebras. In Automata and Logic: History and Perspectives. Amsterdam University Press, 107--132.
[15]
J. Carme, J. Niehren, and M. Tommasi. 2004. Querying Unranked Trees with Stepwise Tree Automata. In Rewriting Techniques and Applications (RTA). 105--118.
[16]
T. Colcombet. 2007. A Combinatorial Theorem for Trees. In International Colloquium on Automata, Languages and Programming (ICALP). 901--912.
[17]
B. Courcelle. 2009. Linear delay enumeration and monadic second-order logic. Discrete Applied Mathematics 157, 12 (2009), 2675--2700.
[18]
S. Datta, R. Kulkarni, A. Mukherjee, T. Schwentick, and T. Zeume. 2015. Reachability is in DynFO. In International Colloquium on Automata, Languages and Programming (ICALP). 159--170.
[19]
A. Durand and Y. Strozecki. 2011. Enumeration Complexity of Logical Query Problems with Second-order Variables. In Computer Science Logic (CSL). 189--202.
[20]
M. Frick and M. Grohe. 2004. The complexity of first-order and monadic second-order logic revisited. Annals of Pure and Applied Logic 130, 1-3 (2004), 3--31.
[21]
M. Frick, M. Grohe, and C. Koch. 2003. Query Evaluation on Compressed Trees (Extended Abstract). In Logic in Computer Science (LICS). 188.
[22]
W. Kazana and L. Segoufin. 2013. Enumeration of first-order queries on classes of structures with bounded expansion. In Symposium on Principles of Database Systems (PODS). 297--308.
[23]
W. Kazana and L. Segoufin. 2013. Enumeration of Monadic Second-Order Queries on Trees. ACM Transactions on Computational Logic (TOCL) 14, 4 (2013), 25:1--25:12.
[24]
K. Losemann and W. Martens. 2014. MSO Queries on Trees: Enumerating Answers under Updates. In Joint Meeting of Computer Science Logic (CSL) and Logic in Computer Science (LICS).
[25]
W. Martens and J. Niehren. 2007. On the minimization of XML Schemas and tree automata for unranked trees. J. Comput. System Sci. 73, 4 (2007), 550--583.
[26]
K. Mehlhorn and A. Tsakalidis. 1986. An Amortized Analysis of Insertions into AVL Trees. Siam Journal on Computing 15, 1 (Feb. 1986), 22--33.
[27]
F. Neven. 1999. Design and Analysis of Query Languages for Structured Documents. Ph.D. Dissertation. Limburgs Universitair Centrum.
[28]
J. Niehren, L. Planque, J.-M. Talbot, and S. Tison. 2005. N-Ary Queries by Tree Automata. In International Conference on Database Programming Languages (DBPL). 217--231.
[29]
M. Niewerth and L. Segoufin. 2018. Enumeration of MSO Queries on Strings with Constant Delay and Logarithmic Updates. In International Symposium on Principles of Database Systems (PODS). to appear.
[30]
S. Patnaik and N. Immerman. 1997. Dyn-FO: A Parallel, Dynamic Complexity Class. Journal of Computer and System Sciences (JCSS) 55, 2 (1997), 199--209.
[31]
L. Segoufin. 2013. Enumerating with constant delay the answers to a query. In International Conference on Database Theory (ICDT). 10--20.
[32]
I. Simon. 1990. Factorization Forests of Finite Height. Theoretical Computer Science (TCS) 72, 1 (1990), 65--94.
[33]
J. W. Thatcher and J. B. Wright. 1968. Generalized finite automata with an application to a decision problem of second-order logic. Mathematical Systems Theory 2, 1 (1968), 57--82.
[34]
T. Zeume and T. Schwentick. 2014. Dynamic Conjunctive Queries. In International Conference Database Theory (ICDT). 38--49.

Cited By

View all
  • (2025)Maintaining CMSO2 properties on dynamic structures with bounded feedback vertex numberACM Transactions on Computation Theory10.1145/3715884Online publication date: 29-Jan-2025
  • (2024)Enumeration for MSO-Queries on Compressed TreesProceedings of the ACM on Management of Data10.1145/36511412:2(1-17)Online publication date: 14-May-2024
  • (2023)Dynamic treewidth2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS)10.1109/FOCS57990.2023.00105(1734-1744)Online publication date: 6-Nov-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
LICS '18: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science
July 2018
960 pages
ISBN:9781450355834
DOI:10.1145/3209108
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 July 2018

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Funding Sources

Conference

LICS '18
Sponsor:

Acceptance Rates

Overall Acceptance Rate 215 of 622 submissions, 35%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)14
  • Downloads (Last 6 weeks)0
Reflects downloads up to 27 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Maintaining CMSO2 properties on dynamic structures with bounded feedback vertex numberACM Transactions on Computation Theory10.1145/3715884Online publication date: 29-Jan-2025
  • (2024)Enumeration for MSO-Queries on Compressed TreesProceedings of the ACM on Management of Data10.1145/36511412:2(1-17)Online publication date: 14-May-2024
  • (2023)Dynamic treewidth2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS)10.1109/FOCS57990.2023.00105(1734-1744)Online publication date: 6-Nov-2023
  • (2021)Database Principles and Challenges in Text AnalysisACM SIGMOD Record10.1145/3484622.348462450:2(6-17)Online publication date: 31-Aug-2021
  • (2021)Probabilistic Databases under UpdatesProceedings of the 40th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems10.1145/3452021.3458326(402-415)Online publication date: 20-Jun-2021
  • (2021)Constant-Delay Enumeration for Nondeterministic Document SpannersACM Transactions on Database Systems10.1145/343648746:1(1-30)Online publication date: 14-Apr-2021
  • (2020)Constant-Delay Enumeration for Nondeterministic Document SpannersACM SIGMOD Record10.1145/3422648.342265549:1(25-32)Online publication date: 4-Sep-2020
  • (2020)Constant delay enumeration for conjunctive queriesACM SIGLOG News10.1145/3385634.33856367:1(4-33)Online publication date: 24-Feb-2020
  • (2020)Trade-offs in Static and Dynamic Evaluation of Hierarchical QueriesProceedings of the 39th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems10.1145/3375395.3387646(375-392)Online publication date: 14-Jun-2020
  • (2019)Enumeration on Trees with Tractable Combined Complexity and Efficient UpdatesProceedings of the 38th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems10.1145/3294052.3319702(89-103)Online publication date: 25-Jun-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media