compositions of tree series transformations
play

Compositions of Tree Series Transformations Andreas Maletti a - PowerPoint PPT Presentation

Compositions of Tree Series Transformations Andreas Maletti a Technische Universit at Dresden Fakult at Informatik D01062 Dresden, Germany maletti@tcs.inf.tu-dresden.de December 03, 2004 1. Motivation 2. Semirings, Tree Series, and


  1. Compositions of Tree Series Transformations Andreas Maletti a Technische Universit¨ at Dresden Fakult¨ at Informatik D–01062 Dresden, Germany maletti@tcs.inf.tu-dresden.de December 03, 2004 1. Motivation 2. Semirings, Tree Series, and Tree Series Substitution 3. Distributivity, Associativity, and Linearity 4. Tree Series Transducers and Composition Results a Financially supported by the German Research Foundation (DFG, GK 334) 1 December 03, 2004

  2. Motivation Tree series transducers are a straightforward generalization of (i) tree transducers, which are applied in • syntax-directed semantics, • functional programming, and • XML querying, (ii) weighted automata, which are applied in • (tree) pattern matching, • image compression and speech-to-text processing. Applications: • can be used for code selection [Borchardt 04] • potential uses in connection with tree banks Motivation 2 December 03, 2004

  3. Generalization Hierarchy tree series transducer τ : T Σ − → A � � T ∆ � � weighted tree weighted transducer tree transducer automaton τ : Σ ∗ − τ : T Σ − → B � � T ∆ � � � ∆ ∗ � → A � � L ∈ A � � T Σ � � generalized weighted automaton tree automaton sequential machine L ∈ B � � T Σ � � � Σ ∗ � L ∈ A � � τ : Σ ∗ − � ∆ ∗ � → B � � string automaton � Σ ∗ � L ∈ B � � Motivation 3 December 03, 2004

  4. Trees Σ ranked alphabet, Σ k ⊆ Σ symbols of rank k , X = { x i | i ∈ N + } • T Σ ( X ) set of Σ -trees indexed by X , • T Σ = T Σ ( ∅ ) , • t ∈ T Σ ( X ) is linear (resp., nondeleting ) in Y ⊆ X , if every y ∈ Y occurs at most (resp., at least) once in t , • t [ t 1 , . . . , t k ] denotes the tree substitution of t i for x i in t Semirings, Tree Series, and Tree Series Substitution 4 December 03, 2004

  5. Semirings A semiring is an algebraic structure A = ( A, ⊕ , ⊙ ) • ( A, ⊕ ) is a commutative monoid with neutral element 0 , • ( A, ⊙ ) is a monoid with neutral element 1 , • 0 is absorbing wrt. ⊙ , and • ⊙ distributes over ⊕ . Examples: • semiring of non-negative integers N ∞ = ( N ∪ { ∞ } , + , · ) • Boolean semiring B = ( { 0, 1 } , ∨ , ∧ ) • tropical semiring T = ( N ∪ { ∞ } , min , +) • any ring, field, etc. Semirings, Tree Series, and Tree Series Substitution 5 December 03, 2004

  6. Properties of Semirings We say that A is • commutative , if ⊙ is commutative, • idempotent , if a ⊕ a = a , • complete , if there is an operation � I : A I − → A such that 1. � i ∈ I a i = a i 1 ⊕ · · · ⊕ a i n , if I = { i 1 , . . . , i n } , and 2. � i ∈ I a i = � � i ∈ I j a i , if I = � j ∈ J I j is a partition of I , and j ∈ J �� � 3. � i ∈ I ( a ⊙ a i ) = a ⊙ � i ∈ I a i and � i ∈ I ( a i ⊙ a ) = ⊙ a , i ∈ I a i • completely idempotent , if it is complete with � i ∈ I a = a for every non-empty I . Semiring Commutative Idempotent Complete Completely Idempotent YES no YES no N ∞ YES YES YES YES B YES YES YES YES T Semirings, Tree Series, and Tree Series Substitution 6 December 03, 2004

  7. Tree Series A = ( A, ⊕ , ⊙ ) semiring, Σ ranked alphabet Mappings ϕ : T Σ ( X ) − → A are also called tree series • the set of all tree series is A � � T Σ ( X ) � � , • the coefficient of t ∈ T Σ ( X ) in ϕ , i.e., ϕ ( t ) , is denoted by ( ϕ, t ) , • the sum is defined pointwise ( ϕ 1 ⊕ ϕ 2 , t ) = ( ϕ 1 , t ) ⊕ ( ϕ 2 , t ) , • the support of ϕ is supp ( ϕ ) = { t ∈ T Σ ( X ) | ( ϕ, t ) � = 0 } , • ϕ is linear (resp., nondeleting in Y ⊆ X ), if supp ( ϕ ) is a set of trees, which are linear (resp., nondeleting in Y ), • the series ϕ with supp ( ϕ ) = ∅ is denoted by � 0 . Example: ϕ = 1 α + 1 β + 3 σ ( α, α ) + . . . + 3 σ ( β, β ) + 5 σ ( α, σ ( α, α )) + . . . Semirings, Tree Series, and Tree Series Substitution 7 December 03, 2004

  8. Tree Series Substitution A = ( A, ⊕ , ⊙ ) complete semiring, ϕ, ψ 1 , . . . , ψ k ∈ A � � T Σ ( X ) � � Pure substitution of ( ψ 1 , . . . , ψ k ) into ϕ : � − ( ψ 1 , . . . , ψ k ) = ( ϕ, t ) ⊙ ( ψ 1 , t 1 ) ⊙ · · · ⊙ ( ψ k , t k ) t [ t 1 , . . . , t k ] ϕ ← t ∈ supp ( ϕ ) , ( ∀ i ∈ [ k ]): t i ∈ supp ( ψ i ) o -substitution of ( ψ 1 , . . . , ψ k ) into ϕ : � o ( ϕ, t ) ⊙ ( ψ 1 , t 1 ) | t | x1 ⊙· · ·⊙ ( ψ k , t k ) | t | xk t [ t 1 , . . . , t k ] − ( ψ 1 , . . . , ψ k ) = ϕ ← t ∈ supp ( ϕ ) , ( ∀ i ∈ [ k ]): t i ∈ supp ( ψ i ) o Example: 5 σ ( x 1 , x 1 ) ← − ( 2 α ) = 10 σ ( α, α ) and 5 σ ( x 1 , x 1 ) − ( 2 α ) = 20 σ ( α, α ) ← Semirings, Tree Series, and Tree Series Substitution 8 December 03, 2004

  9. Distributivity �� � � � � � � m m − = − ( ψ 1i 1 , . . . , ψ ki k ) ϕ i ψ 1i 1 , . . . , ψ ki k ϕ i ← ← i ∈ I i 1 ∈ I 1 i k ∈ I k i ∈ I, ( ∀ j ∈ [ k ]): i j ∈ I j Substitution Sufficient condition for distributivity pure substitution always o -substitution ϕ i linear, A completely idempotent OI -substitution ϕ i linear and nondeleting [Kuich 99] Distributivity, Associativity, and Linearity 9 December 03, 2004

  10. Associativity � � m m m m m − ( ψ 1 , . . . , ψ k ) − ( τ 1 , . . . , τ n ) = ϕ − ( ψ 1 − ( τ 1 , . . . , τ n ) , . . . , ψ k − ( τ 1 , . . . , τ n )) ϕ ← ← ← ← ← Substitution Sufficient condition for associativity pure substitution A completely idempotent, conforming partition ( I j ) j ∈ [ k ] of [ n ] , τ i boolean τ i singletons with idempotent coefficients special associativity law o -substitution ϕ, ψ 1 , . . . , ψ k linear, A zero-divisor free and completely idempotent ϕ linear, A zero-divisor free, τ i singletons OI -substitution ϕ i linear and nondeleting [Kuich 99] Special associativity law: partition ( I j ) j ∈ J of I with var ( ψ j ) ⊆ X I j for every j ∈ J � � � � − ( ψ j ) j ∈ J − ( τ i ) i ∈ I = ϕ ← − − ( τ i ) i ∈ I j ϕ ← ψ j ← ← j ∈ J Distributivity, Associativity, and Linearity 10 December 03, 2004

  11. Linearity m m ( a ⊙ ϕ ) − ( a 1 ⊙ ψ 1 , . . . , a k ⊙ ψ k ) = a ⊙ a 1 ⊙ · · · ⊙ a k ⊙ ϕ − ( ψ 1 , . . . , ψ k ) ← ← Substitution Sufficient condition for distributivity pure substitution always o -substitution a i ∈ { 0, 1 } or special linearity law OI -substitution ϕ i linear and nondeleting [Kuich 99] Special linearity law: tree t ∈ T Σ ( X k ) � � o o − ( a 1 ⊙ ψ 1 , . . . , a k ⊙ ψ k ) = a ⊙ a | t | 1 ⊙ · · · ⊙ a | t | k ⊙ − ( ψ 1 , . . . , ψ k ) ( a t ) t ← ← 1 k Distributivity, Associativity, and Linearity 11 December 03, 2004

  12. Tree Series Transducers Definition: A (bottom-up) tree series transducer (tst) is a system M = ( Q, Σ, ∆, A , F, µ ) • Q is a non-empty set of states , • Σ and ∆ are input and output ranked alphabets, • A = ( A, ⊕ , ⊙ ) is a complete semiring, � Q is a vector of final outputs , • F ∈ A � � T ∆ ( X 1 ) � � Q × Q k . • µ = ( µ k ) k ∈ N with µ k : Σ k − → A � � T ∆ ( X k ) � If Q is finite and µ k ( σ ) q, � q is polynomial, then M is called finite . Tree Series Transducers and Composition Results 12 December 03, 2004

  13. Semantics of Tree Series Transducers m ∈ { ε, o } , q ∈ Q , t ∈ T Σ , ϕ ∈ A � � T Σ � � � Q is defined as Definition: The mapping h m µ : T Σ − → A � � T ∆ � � m h m − ( h m µ ( t 1 ) q 1 , . . . , h m µ ( σ ( t 1 , . . . , t k )) q = µ k ( σ ) q, ( q 1 ,...,q k ) µ ( t k ) q k ) ← q 1 ,...,q k ∈ Q µ ( ϕ ) q = � and h m t ∈ T Σ ( ϕ, t ) ⊙ h m µ ( t ) q . • the m -tree-to-tree-series transformation � M � m : T Σ − → A � � T ∆ � � computed by M is ( � M � m , t ) = � m − ( h m µ ( t ) q ) and q ∈ Q F q ← • the m -tree-series-to-tree-series transformation | M | m : A � � T Σ � � − → A � � T ∆ � � computed by M is ( | M | m , ϕ ) = � t ∈ T Σ ( ϕ, t ) ⊙ ( � M � m , t ) . Tree Series Transducers and Composition Results 13 December 03, 2004

  14. Extension q ∈ Q k , q ∈ Q , ϕ ∈ A � ( Q, Σ, ∆, A , F, µ ) tree series transducer, m ∈ { ε, o } , � � T Σ ( X k ) � � Definition: We define h � q � Q µ,m : T Σ ( X k ) − → A � � T ∆ ( X k ) �   , if q = q i 1 x i h � q µ,m ( x i ) q = �  , otherwise 0 � m h � q − ( h � q µ,m ( t 1 ) p 1 , . . . , h � q µ,m ( σ ( t 1 , . . . , t k )) q = µ k ( σ ) q,p 1 ...p k µ,m ( t k ) p k ) ← p 1 ,...,p k ∈ Q � Q by We define h � q µ,m : A � � T Σ ( X k ) � � − → A � � T ∆ ( X k ) � � h � q ( ϕ, t ) ⊙ h � q µ,m ( ϕ ) q = µ,m ( t ) q t ∈ T Σ ( X I ) Tree Series Transducers and Composition Results 14 December 03, 2004

  15. Composition Construction M 1 = ( Q 1 , Σ, ∆, A , F 1 , µ 1 ) and M 2 = ( Q 2 , ∆, Γ, A , F 2 , µ 2 ) tree series transducer Definition: The m -product of M 1 and M 2 , denoted by M 1 · m M 2 , is the tree series transducer M = ( Q 1 × Q 2 , Σ, Γ, A , F, µ ) • F pq = � m − h q i ∈ Q 2 ( F 2 ) i µ 2 ,m (( F 1 ) p ) i ← • µ k ( σ ) pq, ( p 1 q 1 ,...,p k q k ) = h q 1 ...q k (( µ 1 ) k ( σ ) p,p 1 ...p k ) q . µ 2 ,m Tree Series Transducers and Composition Results 15 December 03, 2004

Recommend


More recommend