mso queries on trees
play

MSO Queries on Trees Enumerating Answers under Updates Using Forest - PowerPoint PPT Presentation

Introduction Monoids + HPD Forest Algebras Circuits MSO Queries on Trees Enumerating Answers under Updates Using Forest Algebras Matthias Niewerth 1 Introduction Monoids + HPD Forest Algebras Circuits Problem Description Query


  1. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Stepwise Tree Automaton Node Selecting String Automaton 11

  2. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Stepwise Tree Automaton Node Selecting String Automaton Extended Transition Monoid 11

  3. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Stepwise Tree Automaton Node Selecting String Automaton Tree Extended Transition Monoid 11

  4. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Stepwise Tree Automaton Node Selecting String Automaton Tree HPD Extended Strings Transition Monoid 11

  5. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Stepwise Tree Automaton Node Selecting String Automaton Tree HPD Extended Strings Transition Monoid Index Structure 11

  6. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Node Selecting Stepwise Tree Automaton Stepwise Tree Automaton Node Selecting String Automaton Tree HPD Extended Strings Transition Monoid Index Structure 11

  7. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Node Selecting Stepwise Tree Automaton Stepwise Tree Automaton Node Selecting String Automaton Tree HPD Extended Extended Strings Transition Algebra Transition Monoid Index Structure 11

  8. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Node Selecting Stepwise Tree Automaton Stepwise Tree Automaton Node Selecting String Automaton Tree HPD Extended Extended Strings Tree Transition Algebra Transition Monoid Index Structure 11

  9. Introduction Monoids + HPD Forest Algebras Circuits Structure of Algorithm Node Selecting Node Selecting Stepwise Tree Automaton Stepwise Tree Automaton Node Selecting String Automaton Tree HPD Extended Extended Strings Tree Transition Algebra Transition Monoid Index Index Structure Structure 11

  10. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Examples a a b b = b d ‘ d b d d concatenation c c 12

  11. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Examples a a b b = b d ‘ d b d d concatenation c c a c a d context = d e c e application b f b d � f 12

  12. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Examples a a b b = b d ‘ d b d d concatenation c c a c a d context = d e c e application b f b d � f a c a � context = d e c e application b � f b � f 12

  13. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra Free Forest Algebra all forests H V all contexts concatenation ‘ context application d 13

  14. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra Free Forest Algebra all forests H V all contexts concatenation ‘ context application d Atomic Formulas empty forest ε empty context � atomic forests a , b , . . . a � , b � , . . . atomic contexts 13

  15. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra Free Forest Algebra all forests H V all contexts concatenation ‘ context application d Atomic Formulas empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  16. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra tree Free Forest Algebra a all forests H e b V all contexts concatenation c ‘ d context application d Atomic Formulas empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  17. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula tree Free Forest Algebra a d all forests H a � e b ‘ V all contexts concatenation c e ‘ d d context application d b � ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  18. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula tree Free Forest Algebra a d all forests H a � e b ‘ V all contexts concatenation c e ‘ d d context application d b � ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  19. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula tree Free Forest Algebra a d all forests H a � e b ‘ V all contexts concatenation c e ‘ d d context application d b � ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  20. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula tree Free Forest Algebra a d all forests H a � e b ‘ V all contexts concatenation c e ‘ d d context application d b � ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  21. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula tree a d a � e b ‘ c e d d b � ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  22. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula alternative formula tree a d d a � e b ‘ d ‘ a � c e c d d ‘ d b � b � e ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  23. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula alternative formula tree a d d a � e b ‘ d ‘ a � c e c d d ‘ d b � b � e ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  24. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula alternative formula tree a d d a � e b ‘ d ‘ a � c e c d d ‘ d b � b � e ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts 13

  25. Introduction Monoids + HPD Forest Algebras Circuits Forest Algebras in a Nutshell Free Forest Algebra formula alternative formula tree a d d a � e b ‘ d ‘ a � c e c d d ‘ d b � b � e ‘ Atomic Formulas c d empty forest ε a empty context � a � = atomic forests a , b , . . . � a � , b � , . . . atomic contexts The leaves of the formula correspond to the nodes of the tree. 13

  26. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t 14

  27. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t How to decompose a tree? 14

  28. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t How to decompose a tree? 1 t = c d f c d c f f c 1 c 2 c 3 f 1 c 4 f 2 14

  29. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t How to decompose a tree? 1 t = c d f c d c f f c 1 c 2 c 3 f 1 c 4 f 2 14

  30. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t How to decompose a tree? 1 t = c d f c 1 2 c = c 1 d c 2 c 2 d d f f c 1 c 2 c 3 f 1 c 4 f 2 14

  31. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t How to decompose a tree? 1 t = c d f c 1 2 c = c 1 d c 2 3 c 2 = f 1 ‘ c 3 c 3 f 1 d d f f c 1 ‘ c 3 f 1 c 4 f 2 14

  32. Introduction Monoids + HPD Forest Algebras Circuits How to Decompose a Tree (to a log-depth Formula) t How to decompose a tree? 1 t = c d f c 1 2 c = c 1 d c 2 3 c 2 = f 1 ‘ c 3 c 4 c 3 4 f 1 = c 4 d f 2 d f 2 d f f c 1 ‘ c 3 d c 4 f 2 14

  33. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas ‘ 3 ‘ 1 2 15

  34. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas ‘ ‘ 3 1 ‘ ‘ 1 2 2 3 15

  35. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas ‘ ‘ 3 1 ‘ ‘ 1 2 2 3 15

  36. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas d d 3 1 d d 1 2 2 3 15

  37. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas d d 3 1 d d 1 2 2 3 ‘ ‘ ‘ 4 1 ‘ ‘ ‘ ‘ 1 1 2 3 4 4 ‘ ‘ 2 3 2 3 15

  38. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas d d 3 1 d d 1 2 2 3 d d d 4 1 d d d d 1 1 2 3 4 4 d d 2 3 2 3 15

  39. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas d d 3 1 d d 1 2 2 3 15

  40. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas d d 3 1 d d 1 2 2 3 ‘ d 2 3 d ‘ 1 3 1 2 1 is a context 2 is a forest 15

  41. Introduction Monoids + HPD Forest Algebras Circuits Rebalancing Forest Algebra Formulas d d 3 1 d d 1 2 2 3 ‘ d ‘ 2 3 1 d ‘ d 1 3 1 2 2 3 1 is a context 2 is a forest 1 is a forest 2 is a context 15

  42. Introduction Monoids + HPD Forest Algebras Circuits Result Theorem Enumertion of MSO formulas on trees can be done in time: O ( | Q | 6 · | S | · 2 k · n ) Preprocessing O ( | Q | 6 · | S | · 2 k · k · log( n ) ) Delay O ( | Q | 6 · | S | · 2 k · log( n ) ) Updates n size of tree | Q | number of states | S | number of accepting tuples k arity of the query 16

  43. Introduction Monoids + HPD Forest Algebras Circuits Contents Monoids and Heavy Path Decomposition ( M , d , ε ) Forest Algebras Enumeration using Circuits = d 17

  44. Introduction Monoids + HPD Forest Algebras Circuits Related Work Simons Heavy Path Set valued Krohn Rhodes Factorization Decomposition Circuits Theorem Forests [ABJM17] [BPV04,LM14] [NS17] Forest [KS13] Algebras O (1) O (log 2 ( n )) O (1) O (1) O (log 2 ( n )) O (log( n )) Krohn Rhodes only strings Theorem This Paper for Trees? O (log( n )) O (log( n )) Follow-Up? O (1) O (log( n )) Reference Delay Update 18

  45. Introduction Monoids + HPD Forest Algebras Circuits Related Work Simons Heavy Path Set valued Krohn Rhodes Factorization Decomposition Circuits Theorem Forests [ABJM17] [BPV04,LM14] [NS17] Forest [KS13] Algebras O (1) O (log 2 ( n )) O (1) O (1) O (log 2 ( n )) O (log( n )) Krohn Rhodes only strings [ABM18] Theorem O (1) This Paper for Trees? O (log( n )) O (log( n )) only relabel O (log( n )) Follow-Up? O (1) O (log( n )) Reference Amarilli, Bourhis, Mengel Delay Enumeration on Trees under Relabelings ICDT 2018 Update 18

  46. Introduction Monoids + HPD Forest Algebras Circuits Enumeration using Circuits [ABM18] ∪ ⊠ ⊠ ¬ � B :1 � ∪ ∪ � B :1 � ⊠ ⊠ ⊠ ⊠ ¬ � x :2 � ¬ � x :3 � � B :2 � � x :2 � � B :3 � � x :3 � � B :2 � � B :3 � 19

  47. Introduction Monoids + HPD Forest Algebras Circuits Enumeration using Circuits [ABM18] ∪ ⊠ ⊠ ¬ � B :1 � ∪ ∪ � B :1 � ⊠ ⊠ ⊠ ⊠ ¬ � x :2 � ¬ � x :3 � � B :2 � � x :2 � � B :3 � � x :3 � � B :2 � � B :3 � Problem: depth(circuit) ∈ Ω(depth(tree)) 19

  48. Introduction Monoids + HPD Forest Algebras Circuits Enumeration using Circuits [ABM18] ∪ ⊠ ⊠ ¬ � B :1 � ∪ ∪ � B :1 � ⊠ ⊠ ⊠ ⊠ ¬ � x :2 � ¬ � x :3 � � B :2 � � x :2 � � B :3 � � x :3 � � B :2 � � B :3 � Problem: depth(circuit) ∈ Ω(depth(tree)) Solution: tree decomposition of input tree 19

  49. Introduction Monoids + HPD Forest Algebras Circuits Enumeration using Circuits [ABM18] ∪ ⊠ ⊠ ¬ � B :1 � ∪ ∪ � B :1 � ⊠ ⊠ ⊠ ⊠ ¬ � x :2 � ¬ � x :3 � � B :2 � � x :2 � � B :3 � � x :3 � � B :2 � � B :3 � Problem: depth(circuit) ∈ Ω(depth(tree)) Solution: tree decomposition of input tree Better Solution: use forest algebra formulas 19

  50. Introduction Monoids + HPD Forest Algebras Circuits Related Work Simons Heavy Path Set valued Krohn Rhodes Factorization Decomposition Circuits Theorem Forests [ABJM17] [BPV04,LM14] [NS17] Forest [KS13] Algebras O (1) O (log 2 ( n )) O (1) O (1) O (log 2 ( n )) O (log( n )) Krohn Rhodes only strings [ABM18] Theorem O (1) This Paper for Trees? O (log( n )) O (log( n )) only relabel O (log( n )) Follow-Up? O (1) O (log( n )) Reference Amarilli, Bourhis, Mengel Delay Enumeration on Trees under Relabelings ICDT 2018 Update 20

  51. Introduction Monoids + HPD Forest Algebras Circuits Related Work Simons Heavy Path Set valued Krohn Rhodes Factorization Decomposition Circuits Theorem Forests [ABJM17] [BPV04,LM14] [NS17] Forest [KS13] Algebras O (1) O (log 2 ( n )) O (1) O (1) O (log 2 ( n )) O (log( n )) Krohn Rhodes only strings [ABM18] Theorem O (1) This Paper for Trees? O (log( n )) O (log( n )) only relabel O (log( n )) Follow-Up? O (1) O (log( n )) Future Reference O (1) Delay Update O (log( n )) 20

  52. Introduction Monoids + HPD Forest Algebras Circuits Related Work Simons Heavy Path Set valued Krohn Rhodes Factorization Decomposition Circuits Theorem Forests [ABJM17] [BPV04,LM14] [NS17] Forest [KS13] Algebras O (1) O (log 2 ( n )) O (1) O (1) O (log 2 ( n )) O (log( n )) Krohn Rhodes only strings [ABM18] Theorem O (1) This Paper for Trees? O (log( n )) O (log( n )) only relabel O (log( n )) Follow-Up? O (1) O (log( n )) Future Reference O (1) Delay Update O (log( n )) Thank You! 20

  53. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 q 0 a q 1 , q 3 , q 4 q 1 , q 3 q 0 , q 2 q 1 q 2 b q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  54. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a b b b q 1 , q 3 , q 4 q 1 , q 3 b q 0 , q 2 q 1 q 2 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  55. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 b q 0 , q 2 q 1 q 2 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  56. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 b q 0 , q 2 q 1 q 2 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  57. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  58. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  59. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  60. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  61. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 2 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  62. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 2 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  63. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 2 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  64. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 a q 0 a q 1 q 2 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

  65. Introduction Monoids + HPD Forest Algebras Circuits Node Selecting Stepwise Tree Automaton (Example) q 1 , q 3 q 4 a q 0 a q 1 q 2 q 1 b b b q 1 , q 3 , q 4 q 1 , q 3 q 2 b q 0 , q 2 q 1 q 2 q 0 b a q 1 , q 3 q 1 , q 3 q 2 q 3 q 4 a S = { ( q 4 , q 0 ) } Output all pairs of a -nodes that are connected by a path of b -nodes. 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend