What do you do if a computational object fails a specification? Target ∉ ∈ ... We have studied this problem over words: 1. “Regular repair of specifications”, in LICS 2011. 2. “The cost of traveling between languages”, in ICALP 2011. We study this problem over XML Documents (trees).
What do you do if a computational object fails a specification? Target Restriction ... ... We have studied this problem over words: 1. “Regular repair of specifications”, in LICS 2011. 2. “The cost of traveling between languages”, in ICALP 2011. We study this problem over XML Documents (trees).
Can we repair each XML document with an uniformly bounded number of modifications? Bounded Repair Problem Example r → d c* r → a* e R : T : d → a* b* e → b* c* a → EMPTY a → EMPTY b → EMPTY b → EMPTY c → EMPTY c → EMPTY r r r c c a a c c a a e d b b a a b b b b c c
Can we repair each XML document with an uniformly bounded number of modifications? Bounded Repair Problem Example r → a r → a R ′ : T ′ : a → b* a → b*, c b → EMPTY b → EMPTY c → EMPTY r r a a b . . . b b . . . b c b b
Can we repair each XML document with an uniformly bounded number of modifications? Bounded Repair Problem Example r → a* r → a* R ′ : T ′ : a → b* a → b*, c b → EMPTY b → EMPTY c → EMPTY r r . . . . . . a a a a b . . . b b . . . b b . . . b b . . . b c c
Can we repair each XML document with an uniformly bounded number of modifications? Bounded Repair Problem Example r → a, d r → d, c* R ′′ : T ′′ : a → a ∣ EMPTY d → a, a d → b, c* a → a ∣ b b → a b → EMPTY c → EMPTY c → EMPTY ? ? ? ?
We give an effective characterization for bounded repairability for every pair of regular tree languages 1. Effective characterization based on: ▸ strongly connected components and ▸ tree representation for the cyclic behavior of tree automata. 2. Decidability of the bounded repair problem. ▸ Between EXPTIME and Π EXP . 2 ▸ Complexity analisys for other subcases.
Bounded repairability for regular tree languages Cristian Riveros University of Oxford Gabriele Puppis CNRS/LaBRI Bordeaux Slawek Staworko University of Lille ICDT 2012
Outline Problem definition Characterization tools Characterization and proof Concluding remarks
Outline Problem definition Characterization tools Characterization and proof Concluding remarks
Trees and regular tree languages XML Documents Unranked trees over Σ person ❁♣❡rs♦♥❃ ❁♥❛♠❡❃ ❈❤r✐s ❁✴♥❛♠❡❃ name address ❁❛❞❞r❡ss❃ ❁str❃ ❘♦❛❞ ❁✴str❃ str num Chris ❁♥✉♠❃ ✸✻✾ ❁✴♥✉♠❃ ❁✴❛❞❞r❡ss❃ Road 369 ❁✴♣❡rs♦♥❃ XML Schemas: D Unranked tree automata: T L( D ) = { t ∈ XML ∣ t ⊧ D } L( T ) = { t ∈ Trees ( Σ ) ∣ T accepts t }
Edit operations over trees Edit operations: deletion, insertion, and relabeling. r r r delete insert x c a c a x d b d d a b b c All operations have equal cost. Definition For trees t , t ′ and tree language T : dist ( t , t ′ ) shortest sequence of operations that transform t into t ′ = dist ( t , T ) t ′ ∈ T { dist ( t , t ′ ) } = min
Bounded repair problem Definition Given unranked tree automata R (restriction) and T (target), determine if there exists a uniform bound N ∈ N such that: dist ( t , L ( T )) ≤ N for all t ∈ L ( R ) Generalization of language containment.
Outline Problem definition Characterization tools Characterization and proof Concluding remarks
How to repair trees? (intuition) Target Restriction Restriction t ′ t t 1. Cyclic behavior: ▸ Stepwise tree automata over curry encoding of trees. ▸ Strongly connected components of stepwise tree automata. ▸ Tree representation of cyclic behavior (Synopsis trees). 2. Mapping: ▸ Covering relation between synopsis trees.
Curry encoding Definition The curry encoding of an unranked tree over Σ is a complete binary tree that has two types of nodes: Internal nodes: @. Leaf nodes: Σ . Example r @ @ b d r @ enc a b @ a c c b c @ c @ a d @ b a
Curry encoding Definition enc ( a ) = a a a enc ( t n ) @ ( enc ( . . . t n − 1 ) , enc ( t n )) = . . . t 1 t 1 @ horizontal vertical Example r @ @ b d r @ enc a b @ a c c b c @ c @ a d @ b a
Stepwise tree automata Definition A stepwise (tree) automata is a tuple A = ( Q , Σ , δ, δ 0 , F ) such that: 1. δ ∶ Q × Q → 2 Q is the transition function, 2. δ 0 ∶ Σ → 2 Q is the initial function, 3. F ⊆ Q is the final set of states. Example R : r → c b* R : δ ( p c , p a ) → q a q b Tree: @ c → a + δ ( q a , p a ) → q a q b p b @ b a → EMPTY δ ( p r , q a ) → q b q b p b @ b b → EMPTY δ ( q b , p b ) → q b p r q a r @ δ 0 ( a ) → p a q a p a a @ δ 0 ( b ) → p b p c p a r c a δ 0 ( c ) → p c δ 0 ( r ) → p r c b b a a
Stepwise tree automata Definition A stepwise (tree) automata is a tuple A = ( Q , Σ , δ, δ 0 , F ) such that: 1. δ ∶ Q × Q → 2 Q is the transition function, 2. δ 0 ∶ Σ → 2 Q is the initial function, 3. F ⊆ Q is the final set of states. Example R : r → c b* R : δ ( c , a ) → q a q b Tree: @ c → a + δ ( q a , a ) → q a q b p b @ b a → EMPTY δ ( r , q a ) → q b q b p b @ b b → EMPTY δ ( q b , b ) → q b p r q a r @ q a p a a @ p c p a r c a c b b a a
Stepwise tree automata Definition A stepwise (tree) automata is a tuple A = ( Q , Σ , δ, δ 0 , F ) such that: 1. δ ∶ Q × Q → 2 Q is the transition function, 2. δ 0 ∶ Σ → 2 Q is the initial function, 3. F ⊆ Q is the final set of states. Example R : r → c b* R : c @ a → q a q b Tree: @ c → a + q a @ a → q a q b p b @ b a → EMPTY r @ q a → q b q b p b @ b b → EMPTY q b @ b → q b p r q a r @ q a p a a @ p c p a r c a c b b a a
Stepwise tree automata Definition A stepwise (tree) automata is a tuple A = ( Q , Σ , δ, δ 0 , F ) such that: 1. δ ∶ Q × Q → 2 Q is the transition function, 2. δ 0 ∶ Σ → 2 Q is the initial function, 3. F ⊆ Q is the final set of states. @ L ( A ) = { t ∈ Trees ( Σ ) ∣ @ b ∃ an accepting run of A over t } . @ b r @ contexts. a @ ● a concatenation between contexts: C 1 ○ C 2 . run of A on a context C from q .
Stepwise tree automata Definition A stepwise (tree) automata is a tuple A = ( Q , Σ , δ, δ 0 , F ) such that: 1. δ ∶ Q × Q → 2 Q is the transition function, 2. δ 0 ∶ Σ → 2 Q is the initial function, 3. F ⊆ Q is the final set of states. @ L ( A ) = { t ∈ Trees ( Σ ) ∣ @ b ∃ an accepting run of A over t } . @ b ● r ○ contexts. @ a @ concatenation between contexts: ● a C 1 ○ C 2 . run of A on a context C from q .
Stepwise tree automata Definition A stepwise (tree) automata is a tuple A = ( Q , Σ , δ, δ 0 , F ) such that: 1. δ ∶ Q × Q → 2 Q is the transition function, 2. δ 0 ∶ Σ → 2 Q is the initial function, 3. F ⊆ Q is the final set of states. q b @ L ( A ) = { t ∈ Trees ( Σ ) ∣ q b ∃ an accepting run of A over t } . @ b q b @ b q a r contexts. @ q a a @ concatenation between contexts: ● a q a C 1 ○ C 2 . run of A on a context C from q .
Cyclic behavior of stepwise automata (components) Definition Given A = ( Q , Σ , δ, δ 0 , F ) , the transition G A q E h E v graph of A is the graph G A = ( Q , E h ∪ E v ) such that for every q ∈ δ ( q 1 , q 2 ) : q 1 q 2 SCC ( A ) is the set of strongly connected component X of G A . L ( A ∣ X ) = { C ∈ context Σ ∣ ∃ p , q ∈ X ∶ q ∈ δ ( p , C )} Example q f → r @ a q a → a ∗ ⋅ b r → q a @ a q a → a EMPTY → q a b q a @ b q f → b ∗ b → b @ b b r a = horizontal, = vertical
Synopsis trees Definition A synopsis tree of A is a binary tree with labels in SCC ( A ) that respect the transition relation of A . q ∈ X q ∈ δ ( q 1 , q 2 ) q 1 ∈ Y q 2 ∈ Z Example Transition graph of A : Synopsis tree q f q f q a q a b b r a r a
How to repair trees? (intuition) Target Restriction Restriction t ′ t t 1. Cyclic behavior: ▸ Stepwise tree automata over curry encoding of trees. ▸ Strongly connected components of stepwise tree automata. ▸ Tree representation of cyclic behavior (Synopsis trees). 2. Mapping: ▸ Covering relation between synopsis trees.
Coverings Definition Given two synopsis trees τ of R and σ of T , we say that σ covers τ iff there exists a mapping λ from nodes of τ to nodes of σ : 1. λ preserves language containment of components, L ( R ∣ τ ( x )) ⊆ L ( T ∣ σ ( λ ( x ))) 2. λ preserves the post-order of nodes, x ≼ post y iff λ ( x ) ≼ post λ ( y ) τ σ 3. λ preserves the ancestorship of vertical nodes, x ≼ anc y iff λ ( x ) ≼ anc λ ( y ) with x a vertical node τ σ for every non-trivial nodes x and y of τ .
Coverings σ covers τ iff there exists a mapping λ from nodes of τ to nodes of σ : 1. λ preserves language containment of components, 2. λ preserves the post-order of nodes, and 3. λ preserves the ancestorship of vertical nodes. Example R : r → c b* T : r → d c → a* d → a* b* b ∗ ǫ ǫ a ∗ ǫ b ∗ b ∗ ǫ ǫ ǫ a ∗ ǫ ǫ ǫ
Recommend
More recommend