29
page.1 The Support of Unranked Weighted Tree Automata Manfred Droste Doreen G¨ otze Universit¨ at Leipzig 27.09.2013

The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.1

The Support of Unranked Weighted Tree Automata

Manfred Droste Doreen Gotze

Universitat Leipzig

27.09.2013

Page 2: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.2

1980s: theory of tree automata and tree languages (Gecseg, Steinby)

used to analyze and specify systems

quantitative aspects, like maximum costs, became interesting

y weighted ranked tree automata over semirings

results summarized by Fulop, Vogler in a chapter of“Handbook of Weighted Automata” (eds. Droste, Kuich, Vogler)

for some application unranked trees are more convenient,e.g. (fully structured) XML-documents

→ Droste, Vogler: weighted unranked tree automata (2009)

Page 3: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.3

Non-Emptyness Problem

Is supp(M) 6= ∅ for a given weighted unranked tree automaton M?

Definition (Support)

M weighted unranked tree automaton.

supp(M) = {ξ ∈ UΣ | (rM, ξ) 6= 0}

Page 4: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.4

since the 80’s: support of probabilistic automata has been studiede.g. in books by Paz, Bukharaev

∃ weighted automata with non-recognizable support

effective construction of support automata for weighted automataover commutative, zero-sum free semirings (Kirsten)

Goals

define weighted unranked tree automata over strong bimonoids

effective construction of support automata forweighted unranked tree automataover commutative, zero-sum free strong bimonoids

Page 5: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.5 Strong Bimonoids

Strong Bimonoids

K = (K ,+, ·,0,1): semiring without distributivity

→ (K ,+, 0) and (K , ·,1) monoids s.th.

(K ,+,0) commutative & 0 is multiplicative zero

called commutative if (K , ·,1) commutative

called zero-sum free if k + l = 0⇒ k = l = 0

Example

(Z4,max, ·4, 0, 1) with Z4 = {0, 1, 2, 3} and x ·4 y = (x · y) mod 4

Example

from multi-valued logics:all bounded lattices (L,∨,∧,0,1),e.g.:

1

a b c

0

Page 6: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.6 Trees

Trees

finite tree overunranked alphabet Σ

a

a c

b

c

b

UΣ: set of all trees over Σ

Page 7: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.7 Weighted Unranked Tree Automata

Weighted Tree Automata over Strong Bimonoids

Definition (weighted unranked tree automata (wuta) over K ,Σ)

M = (Q,A, γ) such that

Q: non-empty, finite set of states

γ : Q → K : root weight function

A: family of weighted word automata Aq,a (q ∈ Q, a ∈ Σ) over K , Q

Definition (behavior of wuta)

tree series rM : UΣ → K with

(rM, ξ) =∑

(q,s,t) is validextended run on ξ

wt(q, s, t) · γ(q)

Page 8: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.8 Weighted Unranked Tree Automata

Valid Extended Runs (Droste,Vogler 2011)

Main Idea of Valid Extended Run (q, s, t) on tree ξ

imagine an assignment from each position w of ξ to a state qw s.th.

→ qε = q

Aqw ,ξ(w) is called on qw .1 . . . qw .rkξ(w)

if w no leaf: s chooses one run (pwi−1, qw .i , pwi )1≤i≤rkξ(w)

→ s(w .i) = (pwi−1, qw .i , pwi )

→ s(ε) undefined

if w leaf: t chooses state pw

→ t(w) = pw

Page 9: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.9 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 10: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.10 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 11: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.11 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 12: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.12 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 13: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.13 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 14: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.14 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 15: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.15 Weighted Unranked Tree Automata

Example for a wuta over (Z4,max, ·4, 0, 1) and Σ = {a, b}wuta Mex with Q = {q}, γ(q) = 2 and

Aq,a:p1 p2

3 11,q1

2, q

Aq,b:p

3 1

1, q

valid extended run (q, s, t) on tree ξex :

tree ξexa

a b

b b

s

(p1, q, p2) (p2, q, p2)

(p, q, p) (p, q, p)

t

p1

p p

wt(q, s, t)2

3 3

3 3

∏= 2if w no leaf: wt(q, s, t)w = wt(s(w .i)1≤i≤rankξ(w))

if w leaf: wt(q, s, t)w = λ(t(w)) · ν(t(w))

Page 16: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.16 Support Automata Construction

Support Automata Construction

K zero-sum free, commutative strong bimonoid,M wuta over K,Σ.

Goal

build unranked tree automaton Ms with

L(Ms) = supp(rM)

unranked tree automaton (uta) over Σ: Ms = (Q, δ,F ) s. th.

Q: non-empty, finite set of statesF ⊆ Q: set of final statesδ : Q × Σ→ {Aq,a over Q | a ∈ Σ, q ∈ Q} s.th. δ(q, a) = Aq,a

successful run on ξ: κ : pos(ξ)→ Q with

κ(w .1) . . . κ(w . rkξ(w)) ∈ L(δ(κ(w), ξ(w))) for all positions wκ(ε) ∈ F

L(Ms) = {ξ ∈ UΣ | ∃ successful run of Ms on ξ}

Page 17: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.17 Support Automata Construction

Construction of Ms :

Ms runs should simulates valid extended runs

(rM,w) ∈ 〈c1, . . . , cn〉 ⊆ K

→ states of Ms counts use of c1, . . . , cn in MKirsten (with Dickson’s lemma):∃y ∈ N: only have to count until y ⇒ finitely many states

→ called dg(C )

state final if generators counted do not generate 0

Page 18: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.18 Support Automata Construction

for all sub-automata Aq,a = (Qq,a, λq,a, µq,a, νq,a):

adopting Kirsten’s construction

Aq,a,s = (Qq,a,s ,Tq,a,s , Iq,a,s ,Fq,a,s)

Qq,a,s = {0, . . . , dg(C)}n × Qq,a

(x , p) ∈ Iq,a,s iff xi =

{1 if λq,a(p) = ci ,

0 if λq,a(p) 6= ci

((x , p), b, (y , p′)) ∈ Tq,a,s iff y = x ⊕ µq,a(p, b, p′)

(x , p) ∈ Fq,a,s iff [[x ⊕ νq,a(p)]] 6= 0

Page 19: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.19 Support Automata Construction

wtAq,a(p1q−→ p2

q−→ p2)

wtAq,a(p1) wtAq,b(p

q−→ pq−→ p)

wtAq,b(p1) wtAq,b

(p1)

Page 20: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.20 Support Automata Construction

(x1, p1)q−−−→ (x2, p2)

q−−−−−−−−−−→ (x3, p2)wtAq,a (p1

q−→p2q−→p2)

(y , p1)wtAq,a (p1)

(z1, p)q−−→ (z2, p)

q−−→ (z3, p)wtAq,b

(pq−→p

q−→p)

(r , p)wtAq,b

(p)(s, p)

wtAq,b(p)

Page 21: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.21 Support Automata Construction

(x1, p1)( ,q)−−−→ (x2, p2)

( ,q)−−−−−−−−−−→ (x3, p2)wtAq,a (p1

q−→p2q−→p2) ( ,q)

(y , p1)wtAq,a (p1) ( ,q)

(z1, p)( ,q)−−−→ (z2, p)

( ,q)−−−→ (z3, p)wtAq,b

(pq−→p

q−→p) ( ,q)

(r , p)wtAq,b

(p) ( ,q)(s, p)

wtAq,b(p) ( ,q)

Page 22: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.22 Support Automata Construction

(x1, p1)( ,q)−−−→ (x2, p2)

( ,q)−−−−−−−−−−→ (x3, p2)wtAq,a (p1

q−→p2q−→p2) ( ,q)

(y , p1)wtAq,a (p1) (y ′,q)

(z1, p)( ,q)−−−→ (z2, p)

( ,q)−−−→ (z3, p)wtAq,b

(pq−→p

q−→p) ( ,q)

(r , p)wtAq,b

(p) (r ′,q)(s, p)

wtAq,b(p) (s′,q)

Page 23: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.23 Support Automata Construction

(x1, p1)( ,q)−−−→ (x2, p2)

( ,q)−−−−−−−−−−→ (x3, p2)wtAq,a (p1

q−→p2q−→p2) ( ,q)

(y , p1)wtAq,a (p1) (y ′,q)

(z1, p)(r ′,q)−−−→ (z2, p)

(s′,q)−−−→ (z3, p)wtAq,b

(pq−→p

q−→p) ( ,q)

(r , p)wtAq,b

(p) (r ′,q)(s, p)

wtAq,b(p) (s′,q)

Page 24: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.24 Support Automata Construction

(x1, p1)( ,q)−−−→ (x2, p2)

( ,q)−−−−−−−−−−→ (x3, p2)wtAq,a (p1

q−→p2q−→p2) ( ,q)

(0, (y , p1))wtAq,a (p1) (y ′,q)

( , (z1, p))(r ′,q)−−−→ ( , (z2, p))

(s′,q)−−−→ ( , (z3, p))wtAq,b

(pq−→p

q−→p) ( ,q)

(0, (r , p))wtAq,b

(p) (r ′,q)(0, (s, p))

wtAq,b(p) (s′,q)

Page 25: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.25 Support Automata Construction

(x1, p1)( ,q)−−−→ (x2, p2)

( ,q)−−−−−−−−−−→ (x3, p2)wtAq,a (p1

q−→p2q−→p2) ( ,q)

(0, (y , p1))wtAq,a (p1) (y ′,q)

(0, (z1, p))(r ′,q)−−−→ (r ′, (z2, p))

(s′,q)−−−→ (r ′ ⊕ s ′, (z3, p))wtAq,b

(pq−→p

q−→p) (r ′ ⊕ s′ ⊕ z ′3,q)

(0, (r , p))wtAq,b

(p) (r ′,q)(0, (s, p))

wtAq,b(p) (s′,q)

Page 26: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.26 Support Automata Construction

(0, (x1, p1))(y ′,q)−−−→ (y ′, (x2, p2))

(rsz3′,q)−−−−−→ (y ′ ⊕ rsz3

′, (x3, p2))wtAq,a (p1

q−→p2q−→p2) (y ′ ⊕ rsz3

′ ⊕ x ′3,q)

(0, (y , p1))wtAq,a (p1) (y ′,q)

(0, (z1, p))(r ′,q)−−−→ (r ′, (z2, p))

(s′,q)−−−→ (r ′ ⊕ s ′, (z3, p))wtAq,b

(pq−→p

q−→p) (r ′ ⊕ s′ ⊕ z ′3,q)

(0, (r , p))wtAq,b

(p) (r ′,q)(0, (s, p))

wtAq,b(p) (s′,q)

Page 27: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.27 Support Automata Construction

Ms = (Qs ,Σ, δ,F ) s.th.

Qs = {0, . . . , dg(C)}n × Q

(x , q) ∈ F iff [[x ⊕ γ(q)]] 6= 0

δ((x , q), a) = Axq,a,s

→ derive Axq,a,s over Qs from Aq,a,s by:

extending state set to {0, . . . , dg(C)}n × ({0, . . . , dg(C)}n × Qq,a)

transition (y1, (x1, p1))(z,q)−−−→ (y2, (x2, p2)) iff:

((x1, p1), q, (x2, p2)) ∈ Tq,a,s ∧ y2 = y1 ⊕ z ,

those states ((y1, (x1, p1)) are final with

((x1, p1)) ∈ Fq,a,s ∧ x = y1 ⊕ (x1 ⊕ νq,a(p1))

Page 28: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.28 Main Theorem

Main Theorem

Theorem

Σ alphabet, K zero-sum free, commutative strong bimonoid.

1 ∀M ∈ wuta over Σ, K: supp(rM) is recognizable.

2 ∃ effective construction of support automaton ⇔ ZGP decidable in K

Definition ZGP (Kirsten, 2009)

Given si , s′j ∈ K, decides if 0 ∈ s1 · · · sm · 〈s ′1, . . . , s ′m′〉

use ZGP to:

decide if a state is final

calculate bound for counting in states

→ bimonoid operations do not need to be computable

Page 29: The Support of Unranked Weighted Tree Automataeiche.theoinf.tu-ilmenau.de/kuske/Theorietag2013/Folien/Fr-1-3-Goetze.… · y weighted ranked tree automata over semirings results summarized

page.29 Summary

Summary

Theorem

Σ alphabet, K zero-sum free, commutative strong bimonoid.

1 ∀M ∈ wuta over Σ, K: supp(rM) is recognizable.

2 ∃ effective construction of support automaton ⇔ ZGP decidable in K

→ extends analogous result of Kirsten for weighted automata toweighted unranked tree automata and to strong bimonoids

Future Work:

investigate connection of weighted unranked tree automata andnested weighted automata