loops and overloops for tree walking automata

Loops and Overloops for Tree Walking Automata Pierre-Cyrille Ham, - PowerPoint PPT Presentation

Loops and Overloops for Tree Walking Automata Pierre-Cyrille Ham, Vincent Hugot, Olga Kouchnarenko {pcheam,vhugot,okouchnarenko}@lifc.univ-fcomte.fr University of Franche-Comt DGA & LIFC-INRIA/CASSIS, project ACCESS July 13, 2011 1/24


  1. Loops and Overloops for Tree Walking Automata Pierre-Cyrille Héam, Vincent Hugot, Olga Kouchnarenko {pcheam,vhugot,okouchnarenko}@lifc.univ-fcomte.fr University of Franche-Comté DGA & LIFC-INRIA/CASSIS, project ACCESS July 13, 2011 1/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  2. Tree Walking Automata Old formalism ( ≈ 1970, Aho & Ullman) Sequential model, as opposed to branching tree automata Less extensively studied model for a long while. . . . . . but long standing questions solved in recent years Recent surge in interest, due mostly to connection to XML (Fragments of Core XPath, streaming etc) Research focused on fundamental problems (expressiveness. . . ) Our focus: practical, efficient algorithms Finality: efficient XML queries; compact Model-Checking Starting Point: Transformation from TWA to BUTA 2/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  3. Preliminaries Definition of Tree Walking Automata A Tree-Walking Automaton is a tuple A = � Σ , Q , I , F , ∆ � ∆ ⊆ Σ × Q × { ⋆, 0 , 1 } × { ↑ , � � , ւ , ց } × Q � � �� � � �� � T : types M : moves Notations “ � f , p , τ → µ, q � ” for the tuple ( f , p , τ, µ, q ) ∈ ∆ . � , q � def � Σ 2 , p , T → � � = { ( σ, p , τ, � � � , q ) | σ ∈ Σ 2 , τ ∈ T } Remarks Ranked (binary) vs. unranked alphabet � Σ 0 , Q , T → { ւ , ց } , Q � ∪ � Σ , Q , ⋆ → ↑ , Q � invalid 3/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  4. Preliminaries Example Tree Walking Automaton A Very Simple TWA: X = � Σ , Q , I , F , ∆ � Σ 0 = { a , b , c } and Σ 2 = { f , g , h } Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � � , q u � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � X accepts exactly all trees whose left-most leaf is labelled by a — and the tree a itself. 4/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  5. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � , q u � � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f a h a b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  6. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � � , q u � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f [ q ℓ ] a h a b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  7. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � , q u � � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f h [ q ℓ ] a a b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  8. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � � , q u � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f a h a [ q ℓ ] b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  9. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � � , q u � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f a h a [ q u ] b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  10. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � , q u � � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f h [ q u ] a a b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  11. Preliminaries Example Tree Walking Automaton Q = { q ℓ , q u } , I = { q ℓ } , F = { q u } ∆ = � a , q ℓ , { ⋆, 0 } → � � � , q u � ∪ � Σ , q u , 0 → ↑ , q u � ∪ � Σ 2 , q ℓ , { ⋆, 0 } → ւ , q ℓ � f [ q u ] a h a b 5/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  12. Given a TWA A , build an equivalent BUTA B . Known solution outlined in the literature [Bojańczyk, Samuelides] Based on the idea of tree loops Resulting states for B : T × 2 Q 2 (or det. ( 2 Q 2 ) T ) Only proof sketches. No explicit algorithm is given. We argue that things are slightly less straightforward: Needed states space: Σ × T × 2 Q 2 (or det. Σ × ( 2 Q 2 ) T ) Because of this, some existing implementations are only almost correct [dtwa-tools] We introduce tree overloops This time we really have T × 2 Q 2 (or det. ( 2 Q 2 ) T ) Lower upper bound if A is deterministic: | T | · 2 | Q | log 2 ( | Q | + 1 ) 6/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  13. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. Loops of X on. . . f t : {} t | 0 : {} a h t | 0 . 0 : {} t | 0 . 1 : {} t | 1 : {} a b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  14. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. f [ q ℓ ] Loops of X on. . . t : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } t | 0 : {} a h t | 0 . 0 : {} t | 0 . 1 : {} t | 1 : {} a b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  15. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. Loops of X on. . . f t : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } t | 0 : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } h [ q ℓ ] a t | 0 . 0 : {} t | 0 . 1 : {} t | 1 : {} a b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  16. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. f Loops of X on. . . t : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } t | 0 : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } a h t | 0 . 0 : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } t | 0 . 1 : {} t | 1 : {} a [ q ℓ ] b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  17. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. f Loops of X on. . . t : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } t | 0 : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } a h t | 0 . 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } t | 0 . 1 : {} t | 1 : {} a [ q u ] b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  18. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. Loops of X on. . . f t : { ( q ℓ , ? ) , ( q ℓ , q ℓ ) } t | 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } h [ q u ] a t | 0 . 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } t | 0 . 1 : {} t | 1 : {} a b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  19. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. f [ q u ] Loops of X on. . . t : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } t | 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } a h t | 0 . 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } t | 0 . 1 : {} t | 1 : {} a b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  20. The Idea of Tree Loops ( p , q ) ∈ Q 2 is a loop of A on t | α if there exists a run which starts in p , ends in q (at the root α ), and always stays in the subtree. Loops of X on. . . f t : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } t | 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } a h t | 0 . 0 : { ( q ℓ , q u ) , ( q ℓ , q ℓ ) , ( q u , q u ) } t | 0 . 1 : { ( q ℓ , q ℓ ) , ( q u , q u ) } t | 1 : { ( q ℓ , q ℓ ) , ( q u , q u ) } a b 7/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

  21. Computing Tree Loops Simple Loops, Computation for Leaves A loop is a simple loop on t | α if there is a run which forms it and reaches α exactly twice ( simple looping run ). Proposition: Loops Decomposition If S ⊆ Q 2 is the set of all simple loops of A on a given subtree u = t | α , then S ∗ is the set of all loops of A on u . We denote ℧ τ ( u ) the set of all loops of A on a subtree u , where τ is the type of the root of u . Compute loops on u = a ∈ Σ 0 . Simple looping run: run of the form ( ε, p ) ։ ( ε, q ) only. def H τ = { ( p , q ) | � σ, p , τ → � � , q � ∈ ∆ } . � σ a ) ∗ . So we have ℧ τ ( a ) = ( H τ 8/24 CIAA’11 Vincent HUGOT Loops & Overloops for TWA

Recommend


More recommend