TY - GEN
T1 - Dynamic Direct Access of MSO Query Evaluation over Strings
AU - Bourhis, Pierre
AU - Capelli, Florent
AU - Mengel, Stefan
AU - Riveros, Cristian
N1 - Publisher Copyright:
© Pierre Bourhis, Florent Capelli, Stefan Mengel, and Cristian Riveros.
PY - 2025/3/21
Y1 - 2025/3/21
N2 - We study the problem of evaluating a Monadic Second Order (MSO) query over strings under updates in the setting of direct access. We present an algorithm that, given an MSO query with first-order free variables represented by an unambiguous variable-set automaton A with state set Q and variables X and a string s, computes a data structure in time O(|Q|ω · |X|2 · |s|) and, then, given an index i retrieves, using the data structure, the i-th output of the evaluation of A over s in time O(|Q|ω · |X|3 · log(|s|)2) where ω is the exponent for matrix multiplication. Ours is the first efficient direct access algorithm for MSO query evaluation over strings; such algorithms so far had only been studied for first-order queries and conjunctive queries over relational data. Our algorithm gives the answers in lexicographic order where, in contrast to the setting of conjunctive queries, the order between variables can be freely chosen by the user without degrading the runtime. Moreover, our data structure can be updated efficiently after changes to the input string, allowing more powerful updates than in the enumeration literature, e.g. efficient deletion of substrings, concatenation and splitting of strings, and cut-and-paste operations. Our approach combines a matrix representation of MSO queries and a novel data structure for dynamic word problems over semi-groups which yields an overall algorithm that is elegant and easy to formulate.
AB - We study the problem of evaluating a Monadic Second Order (MSO) query over strings under updates in the setting of direct access. We present an algorithm that, given an MSO query with first-order free variables represented by an unambiguous variable-set automaton A with state set Q and variables X and a string s, computes a data structure in time O(|Q|ω · |X|2 · |s|) and, then, given an index i retrieves, using the data structure, the i-th output of the evaluation of A over s in time O(|Q|ω · |X|3 · log(|s|)2) where ω is the exponent for matrix multiplication. Ours is the first efficient direct access algorithm for MSO query evaluation over strings; such algorithms so far had only been studied for first-order queries and conjunctive queries over relational data. Our algorithm gives the answers in lexicographic order where, in contrast to the setting of conjunctive queries, the order between variables can be freely chosen by the user without degrading the runtime. Moreover, our data structure can be updated efficiently after changes to the input string, allowing more powerful updates than in the enumeration literature, e.g. efficient deletion of substrings, concatenation and splitting of strings, and cut-and-paste operations. Our approach combines a matrix representation of MSO queries and a novel data structure for dynamic word problems over semi-groups which yields an overall algorithm that is elegant and easy to formulate.
KW - MSO queries
KW - Query evaluation
KW - direct access
UR - https://www.scopus.com/pages/publications/105001543516
U2 - 10.4230/LIPIcs.ICDT.2025.26
DO - 10.4230/LIPIcs.ICDT.2025.26
M3 - Conference contribution
AN - SCOPUS:105001543516
T3 - Leibniz International Proceedings in Informatics, LIPIcs
BT - 28th International Conference on Database Theory, ICDT 2025
A2 - Roy, Sudeepa
A2 - Kara, Ahmet
PB - Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
T2 - 28th International Conference on Database Theory, ICDT 2025
Y2 - 25 March 2025 through 28 March 2025
ER -