Compiling Trees in Set Circuits • Constructions are bottom-up • Updates can be done in O ( depth ( T )) • Problem: depth ( T ) can be linear in T • Solution: Depict trees by forest algebra terms 10/16
Free Forest Algebra in a Nutshell concatenation = ‘ 11/16
Free Forest Algebra in a Nutshell concatenation = ‘ context = d application 11/16
Free Forest Algebra in a Nutshell concatenation = ‘ context = d application context = d application 11/16
Free Forest Algebra in a Nutshell tree 12/16
Free Forest Algebra in a Nutshell tree term d ‘ d ‘ 12/16
Free Forest Algebra in a Nutshell tree term d ‘ d ‘ 12/16
Free Forest Algebra in a Nutshell tree term d ‘ d ‘ 12/16
Free Forest Algebra in a Nutshell tree term d ‘ d ‘ 12/16
Free Forest Algebra in a Nutshell tree term alternative term d d ‘ d ‘ d ‘ ‘ 12/16
Free Forest Algebra in a Nutshell tree term alternative term d d ‘ d ‘ d ‘ ‘ 12/16
Free Forest Algebra in a Nutshell tree term alternative term d d ‘ d ‘ d ‘ ‘ 12/16
Free Forest Algebra in a Nutshell tree term alternative term d d ‘ d ‘ d ‘ ‘ The leaves of the formula correspond to the nodes of the tree 12/16
Rebalancing Forest Algebra Terms ‘ 3 ‘ 1 2 13/16
Rebalancing Forest Algebra Terms ‘ ‘ 3 1 ‘ ‘ 3 1 2 2 13/16
Rebalancing Forest Algebra Terms ‘ ‘ 3 1 ‘ ‘ 3 1 2 2 13/16
Rebalancing Forest Algebra Terms d d 3 1 d d 3 1 2 2 13/16
Rebalancing Forest Algebra Terms d d 3 1 d d 3 1 2 2 ‘ ‘ ‘ 4 1 ‘ ‘ ‘ ‘ 3 4 4 1 1 2 ‘ ‘ 3 3 2 2 13/16
Rebalancing Forest Algebra Terms d d 3 1 d d 3 1 2 2 d d d 4 1 d d d d 3 4 4 1 1 2 d d 3 3 2 2 13/16
Rebalancing Forest Algebra Terms d d 3 1 d d 3 1 2 2 d d d 4 1 d d d d 3 4 4 1 1 2 d d 3 3 2 2 13/16
Rebalancing Forest Algebra Terms d d 3 1 d d 3 1 2 2 d d d 4 1 d d d d 3 4 4 1 1 2 d d 3 3 2 2 ‘ d 3 2 d ‘ 3 1 1 2 1 contains the hole 13/16
Rebalancing Forest Algebra Terms d d 3 1 d d 3 1 2 2 d d d 4 1 d d d d 3 4 4 1 1 2 d d 3 3 2 2 ‘ d ‘ 3 2 1 d ‘ d 3 3 1 1 2 2 1 contains the hole 2 contains the hole 13/16
Main Result Theorem Enumertion of MSO formulas on trees can be done in time: O ( | T | × | Q | 4 ω + 1 ) Preprocessing O ( | Q | 4 ω × | S | ) Delay O ( log ( | T | ) × | Q | 4 ω + 1 ) Updates | T | size of tree | Q | number of states of a nondeterministic tree automaton | S | size of result exponent for Boolean matrix multiplication ω 14/16
Lower Bound
Lower Bound Existencial Marked Ancestor Queries Input : Tree t with some marked nodes Query : Does node v have a marked ancestor? Updates : Mark or unmark a node 15/16
Lower Bound Existencial Marked Ancestor Queries Input : Tree t with some marked nodes Query : Does node v have a marked ancestor? Updates : Mark or unmark a node log ( n ) � � Theorem: t query ∈ Ω log ( t update log ( n )) 15/16
Lower Bound Existencial Marked Ancestor Queries Input : Tree t with some marked nodes Query : Does node v have a marked ancestor? Updates : Mark or unmark a node log ( n ) � � Theorem: t query ∈ Ω log ( t update log ( n )) Reduction to Query Enumeration with Updates Fixed Query Q : Return all special nodes with a marked ancestor For every marked ancestor query v : 1. Mark node v special 2. Enumerate Q and return “yes”, iff Q produces some result 3. Mark v as non-special again 15/16
Lower Bound Existencial Marked Ancestor Queries Input : Tree t with some marked nodes Query : Does node v have a marked ancestor? Updates : Mark or unmark a node log ( n ) � � Theorem: t query ∈ Ω log ( t update log ( n )) Reduction to Query Enumeration with Updates Fixed Query Q : Return all special nodes with a marked ancestor For every marked ancestor query v : 1. Mark node v special 2. Enumerate Q and return “yes”, iff Q produces some result 3. Mark v as non-special again log ( n ) � � Theorem: max ( t delay , t update ) ∈ Ω log log ( n ) 15/16
Results Theorem Enumertion of MSO formulas on trees can be done in time: O ( | T | × | Q | 4 ω + 1 ) Preprocessing O ( | Q | 4 ω × | S | ) Delay O ( log ( | T | ) × | Q | 4 ω + 1 ) Updates | T | size of tree | Q | number of states of a nondeterministic tree automaton | S | size of result exponent for Boolean matrix multiplication ω Theorem log ( n ) � � max ( t delay , t update ) ∈ Ω log log ( n ) 16/16
Results Theorem Enumertion of MSO formulas on trees can be done in time: O ( | T | × | Q | 4 ω + 1 ) Preprocessing O ( | Q | 4 ω × | S | ) Delay O ( log ( | T | ) × | Q | 4 ω + 1 ) Updates | T | size of tree | Q | number of states of a nondeterministic tree automaton | S | size of result exponent for Boolean matrix multiplication ω Theorem Thank You log ( n ) � � max ( t delay , t update ) ∈ Ω log log ( n ) 16/16
References i Bagan, G. (2006). MSO queries on tree decomposable structures are computable with linear delay. In CSL . Kazana, W. and Segoufin, L. (2013). Enumeration of monadic second-order queries on trees. TOCL , 14(4). Losemann, K. and Martens, W. (2014). MSO queries on trees: Enumerating answers under updates. In CSL-LICS .
References ii Niewerth, M. (2018). Mso queries on trees: Enumerating answers under updates using forest algebras. In LICS . Niewerth, M. and Segoufin, L. (2018). Enumeration of MSO queries on strings with constant delay and logarithmic updates. In PODS .
Normalization: handling ∅ × y × x ⊥
Normalization: handling ∅ × y × {{ x }} ∅ x ⊥
Normalization: handling ∅ × {{ y }} ∅ y × {{ x }} ∅ x ⊥
Normalization: handling ∅ ∅ × {{ y }} ∅ y × {{ x }} ∅ x ⊥
Normalization: handling ∅ ∅ • Problem: if S ( g ) = ∅ we waste time × {{ y }} ∅ y × {{ x }} ∅ x ⊥
Normalization: handling ∅ ∅ • Problem: if S ( g ) = ∅ we waste time × {{ y }} • Solution: in preprocessing ∅ y × • compute bottom-up if S ( g ) = ∅ {{ x }} ∅ x ⊥
Normalization: handling ∅ ∅ • Problem: if S ( g ) = ∅ we waste time × {{ y }} • Solution: in preprocessing ∅ y × • compute bottom-up if S ( g ) = ∅ {{ x }} ∅ • then get rid of the gate x ⊥
Normalization: handling empty sets × × × × × x ×
Normalization: handling empty sets × {{}} × × {{}} × × {{ x }} {{}} x ×
Normalization: handling empty sets × {{}} × × {{ x }} {{}} × × {{ x }} {{}} x ×
Normalization: handling empty sets × {{ x }} {{}} × × {{ x }} {{}} × × {{ x }} {{}} x ×
Normalization: handling empty sets {{ x }} × {{ x }} {{}} × × {{ x }} {{}} × × {{ x }} {{}} x ×
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} {{}} in chains of × -gates × × {{ x }} {{}} × × {{ x }} {{}} x ×
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} {{}} in chains of × -gates × × • Solution: {{ x }} {{}} × × {{ x }} {{}} x ×
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} {{}} in chains of × -gates × × • Solution: {{ x }} {{}} • remove inputs with S ( g ) = {{}} for × -gates × × {{ x }} {{}} x ×
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} {{}} in chains of × -gates × × • Solution: {{ x }} {{}} • remove inputs with S ( g ) = {{}} for × -gates × × {{ x }} {{}} x ×
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} in chains of × -gates × • Solution: {{ x }} • remove inputs with S ( g ) = {{}} for × -gates × {{ x }} • collapse × -chains with fan-in 1 x
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} in chains of × -gates × • Solution: {{ x }} • remove inputs with S ( g ) = {{}} for × -gates × {{ x }} • collapse × -chains with fan-in 1 x
Normalization: handling empty sets {{ x }} × • Problem: if S ( g ) contains {} we waste time {{ x }} in chains of × -gates × • Solution: {{ x }} • remove inputs with S ( g ) = {{}} for × -gates × {{ x }} • collapse × -chains with fan-in 1 x → Now, traversing a × -gate ensures that we make progress: it splits the sets non-trivially
Recommend
More recommend