Equivalence of Deterministic Tree-to-String Transducers Is - - PowerPoint PPT Presentation

equivalence of deterministic tree to string transducers
SMART_READER_LITE
LIVE PREVIEW

Equivalence of Deterministic Tree-to-String Transducers Is - - PowerPoint PPT Presentation

Equivalence of Deterministic Tree-to-String Transducers Is Decidable Helmut Seidl, Sebastian Maneth, Gregor Kemper TU M unchen, U. of Edinburgh Dagstuhl, April 4, 2017 Equivalence of Deterministic Tree-to-String Transducers and More Is


slide-1
SLIDE 1

Equivalence of Deterministic Tree-to-String Transducers Is Decidable

Helmut Seidl, Sebastian Maneth, Gregor Kemper TU M¨ unchen, U. of Edinburgh Dagstuhl, April 4, 2017

slide-2
SLIDE 2

Equivalence of Deterministic Tree-to-String Transducers and More Is Decidable

Helmut Seidl, Sebastian Maneth, Gregor Kemper TU M¨ unchen, U. of Edinburgh Dagstuhl, April 4, 2017

slide-3
SLIDE 3

Overview Part 1: The General Setting Part 2: Tree-to-Matrix Transducers Part 3: Polynomial Invariants

slide-4
SLIDE 4

Overview Part 1: The General Setting Part 2: Tree-to-Matrix Transducers Part 3: Polynomial Invariants

slide-5
SLIDE 5

Tree-to-String Translation

Input

content content frame button Do not press! defs defs end height 20 width 50

slide-6
SLIDE 6

Tree-to-String Translation

Output

<frame height=20 width=50> <button>Do not press!</button> ... </frame>

slide-7
SLIDE 7

Tree-to-String Translation

Output

<frame height=20 width=50> <button>Do not press!</button> ... </frame>

Realized by:

q(frame(x1, x2)) → <frame q1(x1)q(x2)</frame> q1(end) → > q1(defs(x1, x2)) → q(x1)q1(x2) q(height(x1)) → height = q(x1) . . .

slide-8
SLIDE 8

Tree-to-String Translation

Output

<frame height=20 width=50> <button>Do not press!</button> ... </frame>

Or realized by:

q′(frame(x1, x2)) → <frame q′

1(x1)> q′(x2)</frame>

q′

1(end)

→ ǫ q′

1(defs(x1, x2))

→ q′(x1)q′

1(x2)

q′(height(x1)) → height = q′(x1) . . .

slide-9
SLIDE 9

Tree-to-String Translation

These two translations are equivalent.

slide-10
SLIDE 10

Tree-to-String Translation

These two translations are equivalent. Unstructured output can be generated in surprisingly different ways ... q(f(x1, x2, x3)) → q(x3) a q1(x2) b q(x2) q1(f(x1, x2, x3)) → q1(x3)q1(x2)q1(x2) ba q1(e) → ba q(e) → ab

slide-11
SLIDE 11

Tree-to-String Translation

These two translations are equivalent. Unstructured output can be generated in surprisingly different ways ... q(f(x1, x2, x3)) → q(x3) a q1(x2) b q(x2) q1(f(x1, x2, x3)) → q1(x3)q1(x2)q1(x2) ba q1(e) → ba q(e) → ab versus q′(f(x1, x2, x3)) → ab q′(x2)q′(x2)q′(x3) q′(e) → ab

slide-12
SLIDE 12

Related Work

problem statement Engelfriet, 1980

slide-13
SLIDE 13

Related Work (cont.)

with monadic input Culik II, Karhum¨ aki, 1986 Ruohonen, 1986 Honkala, 2000

slide-14
SLIDE 14

Related Work (cont.)

with monadic input Culik II, Karhum¨ aki, 1986 Ruohonen, 1986 Honkala, 2000 MSO-definable Engelfriet, Maneth, 2006 sequential Staworko et al., 2009 linear Boiret, Palenta, 2016 polynomial program invariants Letichevsky, Lvov, 1993 M¨ uller-Olm, S., 2004

slide-15
SLIDE 15

Related Work (cont.)

with monadic input Culik II, Karhum¨ aki, 1986 Ruohonen, 1986 Honkala, 2000 MSO-definable Engelfriet, Maneth, 2006 sequential Staworko et al., 2009 linear Boiret, Palenta, 2016 polynomial program invariants Letichevsky, Lvov, 1993 M¨ uller-Olm, S., 2004

slide-16
SLIDE 16

General Idea

Obvious: In-equivalence can be verified by counter example

slide-17
SLIDE 17

General Idea

Obvious: In-equivalence can be verified by counter example Required: Complete proof system for equivalence

slide-18
SLIDE 18

General Idea

Obvious: In-equivalence can be verified by counter example Required: Complete proof system for equivalence Issues:

  • Practical method for proof search
  • Extension to outputs in the free group
slide-19
SLIDE 19

Overview Part 1: The General Setting Part 2: Tree-to-Matrix Transducers Part 3: Polynomial Invariants

slide-20
SLIDE 20

Simplification

  • A single transducer with states Q = {1, . . . , n}.
  • The transducer is total.
slide-21
SLIDE 21

Simplification

  • A single transducer with states Q = {1, . . . , n}.
  • The transducer is total.
  • There is a topdown-deterministic automaton B with

states p ∈ P dom(p) is the set of trees accepted at state p

slide-22
SLIDE 22

Simplification

  • A single transducer with states Q = {1, . . . , n}.
  • The transducer is total.
  • There is a topdown-deterministic automaton B with

states p ∈ P // generalization of algebraic data type dom(p) is the set of trees accepted at state p // trees of type p

slide-23
SLIDE 23

Topdown Automaton

content content frame button Do not press! defs defs end height 20 width 50 p0

slide-24
SLIDE 24

Topdown Automaton

content content frame button Do not press! defs defs end height 20 width 50 p0 p2 p1

slide-25
SLIDE 25

Simplified Question

For states q, q′ of the transducer, p0 ∈ P, does it hold that [ [q] ](t) = [ [q′] ](t) (t ∈ dom(p0))

slide-26
SLIDE 26

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2)

slide-27
SLIDE 27

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2)

slide-28
SLIDE 28

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2) Arbitary Output letters a, b ˆ = matrices

3 1 1

  • ,

3 2 1

slide-29
SLIDE 29

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2) Arbitary Output letters a, b ˆ = matrices

3 1 1

  • ,

3 2 1

  • string aab

ˆ =

3 1 1

  • ·

3 1 1

  • ·

3 2 1

slide-30
SLIDE 30

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2) Arbitary Output letters a, b ˆ = matrices

3 1 1

  • ,

3 2 1

  • string aab

ˆ =

3 1 1

  • ·

3 1 1

  • ·

3 2 1

  • =

27 22 1

slide-31
SLIDE 31

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2) Arbitary Output letters a, b ˆ = matrices

1 1 1

  • ,

1 1 1

  • string aab

ˆ =

1 1 1

  • ·

1 1 1

  • ·

1 1 1

slide-32
SLIDE 32

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2) Arbitary Output letters a, b ˆ = matrices

1 1 1

  • ,

1 1 1

  • string aab

ˆ =

1 1 1

  • ·

1 1 1

  • ·

1 1 1

  • =

1 1 2 3

slide-33
SLIDE 33

From Arbitrary Output to Matrices

Unary Output q(f(x1, x2)) → aa q1(x1) a q1(x1) q2(x2) Succinct representation: Tree-to-int transducer q(f(x1, x2)) → 3 + 2 · q1(x1) + q2(x2) Arbitary Output letters a, b ˆ = matrices

1 2 1

  • ,

1 2 1

  • string aab

ˆ =

1 2 1

  • ·

1 2 1

  • ·

1 2 1

  • =

1 2 4 9

slide-34
SLIDE 34

Fact

Let Ma = 1 2 1

  • Mb =

1 2 1

slide-35
SLIDE 35

Fact

Let Ma = 1 2 1

  • Mb =

1 2 1

  • The matrix monoid generated by Ma, Mb is free.
slide-36
SLIDE 36

Fact

Let Ma = 1 2 1

  • Mb =

1 2 1

  • The matrix monoid generated by Ma, Mb is free.

The matrix group generated by Ma, Mb is free

slide-37
SLIDE 37

Fact

Let Ma = 1 2 1

  • Mb =

1 2 1

  • The matrix monoid generated by Ma, Mb is free.

The matrix group generated by Ma, Mb is free 1 2 1

  • ·
  • 1

−2 1

  • =

1 1

slide-38
SLIDE 38

Fact

Let Ma = 1 2 1

  • Mb =

1 2 1

  • The matrix monoid generated by Ma, Mb is free.

The matrix group generated by Ma, Mb is free 1 2 1

  • ·
  • 1

−2 1

  • =

1 1

  • =

Sanov group

slide-39
SLIDE 39

Transformation

Wanted Transformation of tree-to-string into tree-to-matrix ...

slide-40
SLIDE 40

Transformation

Wanted Transformation of tree-to-string into tree-to-matrix ... q(f(x1, x2)) → a q1(x1) b q2(x2)

slide-41
SLIDE 41

Transformation

Wanted Transformation of tree-to-string into tree-to-matrix ... q(f(x1, x2)) → a q1(x1) b q2(x2) is simulated by: q(f(x1, x2)) → Ma · q1(x1) · Mb · q2(x2)

slide-42
SLIDE 42

Overview Part 1: The General Setting Part 2: Tree-to-Matrix Transducers Part 3: Polynomial Invariants

slide-43
SLIDE 43

Tree-to-Matrix Transducers

q1(f(x1, x2)) → b q2(x1)q2(x2) q2(f(x1, x2)) → q2(x1)q2(x1) q3(f(x1, x2)) → q4(x2)q4(x1) b q4(f(x1, x2)) → q4(x1)q4(x1) q1(c) → b q2(c) → ab q3(c) → b q4(c) → ba translates to

slide-44
SLIDE 44

Tree-to-Matrix Transducers

q1(f(x1, x2)) →

  • 1

2 1

  • · q2(x1) · q2(x2)

q2(f(x1, x2)) → q2(x1) · q2(x1) q3(f(x1, x2)) → q4(x2) · q4(x1) ·

  • 1

2 1

  • q4(f(x1, x2))

→ q4(x1) · q4(x1) q1(c) →

  • 1

2 1

  • q2(c)

  • 1

2 2 5

  • q3(c)

  • 1

2 1

  • q4(c)

  • 5

2 2 1

slide-45
SLIDE 45

Semantics

The semantics of a tree t is a vector of matrices [ [t] ] : (Ql×l)n

slide-46
SLIDE 46

Semantics

The semantics of a tree t is a vector of matrices [ [t] ] : (Ql×l)n = = ⇒ can be represented by a matrix ([ [t] ]qij) ∈ Qn×l×l.

slide-47
SLIDE 47

Semantics

The semantics of a tree t is a vector of matrices [ [t] ] : (Ql×l)n = = ⇒ can be represented by a matrix ([ [t] ]qij) ∈ Qn×l×l. The Semantics of Constructors [ [f] ] : (Qn×l×l × . . . × Qn×l×l) → Qn×l×l

slide-48
SLIDE 48

Semantics

The semantics of a tree t is a vector of matrices [ [t] ] : (Ql×l)n = = ⇒ can be represented by a matrix ([ [t] ]qij) ∈ Qn×l×l. The Semantics of Constructors [ [f] ] : (Qn×l×l × . . . × Qn×l×l) → Qn×l×l is of the form ([ [f] ](x1, . . . , xk))qij = polynomial in the xκq′i′j′

slide-49
SLIDE 49

In the Example

[ [f] ]1(x1, x2) =

  • 1

2 1

  • · x12 · x22

[ [f] ]3(x1, x2) = x24 · x14 ·

  • 1

2 1

slide-50
SLIDE 50

In the Example

[ [f] ]1(x1, x2) =

  • 1

2 1

  • · x12 · x22

[ [f] ]2(x1, x2) = x12 · x12 [ [f] ]3(x1, x2) = x24 · x14 ·

  • 1

2 1

  • [

[f] ]4(x1, x2) = x14 · x14

slide-51
SLIDE 51

Inductive Invariant

An assignment p → Ip(z) is inductive if Ip(z) ⇐ = (z . = [ [f] ](x1, . . . , xk)) ∧ Ip1(x1) ∧ . . . ∧ Ipk(xk) whenever p → f(p1, . . . , pk) holds.

slide-52
SLIDE 52

Inductive Invariant

An assignment p → Ip(z) is inductive if Ip(z) ⇐ = (z . = [ [f] ](x1, . . . , xk)) ∧ Ip1(x1) ∧ . . . ∧ Ipk(xk) whenever p → f(p1, . . . , pk) holds.

Proposition

If p → Ip is inductive, then Ip([ [t] ]) = true (t ∈ dom(p))

slide-53
SLIDE 53

Questions

  • Can everything which holds be proven by an

inductive invariant?

slide-54
SLIDE 54

Questions

  • Can everything which holds be proven by an

inductive invariant?

  • Is there a suitably expressive logic for the relevant

assertions?

slide-55
SLIDE 55

Questions

  • Can everything which holds be proven by an

inductive invariant?

  • Is there a suitably expressive logic for the relevant

assertions?

  • Is it decidable?
slide-56
SLIDE 56

Polynomials

polynomial equality: zq1 · zq′1 · zq′0 − 2 · zq0 + 3 . = 0

slide-57
SLIDE 57

Polynomials

polynomial equality: zq1 · zq′1 · zq′0 − 2 · zq0 + 3 . = 0 r . = 0 poynomial invariant at p iff r([ [t] ]) = 0 (t ∈ dom(p))

slide-58
SLIDE 58

Polynomials

polynomial equality: zq1 · zq′1 · zq′0 − 2 · zq0 + 3 . = 0 r . = 0 poynomial invariant at p iff r([ [t] ]) = 0 (t ∈ dom(p)) can be described by polynomial ideals ...

slide-59
SLIDE 59

Polynomial Ideals: A Primer

R ring. I ⊆ R ideal, if

  • a + b ∈ I whenever a, b ∈ I;
  • r · a ∈ I whenever a ∈ I and r ∈ R.
slide-60
SLIDE 60

Polynomial Ideals: A Primer

R ring. I ⊆ R ideal, if

  • a + b ∈ I whenever a, b ∈ I;
  • r · a ∈ I whenever a ∈ I and r ∈ R.

I is finitely generated, if I = a1, . . . , asR = {s

i=1ri · ai | ri ∈ R}

slide-61
SLIDE 61

Polynomial Ideals: A Primer

R ring. I ⊆ R ideal, if

  • a + b ∈ I whenever a, b ∈ I;
  • r · a ∈ I whenever a ∈ I and r ∈ R.

I is finitely generated, if I = a1, . . . , asR = {s

i=1ri · ai | ri ∈ R}

R = Q[z] polynomial ring

slide-62
SLIDE 62

Polynomial Ideals — Basis Theorem

David Hilbert (1890) Every ideal of Q[z] is finitely generated.

slide-63
SLIDE 63

Consequence

  • Polynomial Invariants can be represented by

polynomial ideals.

  • Finite conjunctions suffice!
slide-64
SLIDE 64

Consequence

  • Polynomial Invariants can be represented by

polynomial ideals.

  • Finite conjunctions suffice!
  • There are effective algorithms for

◮ membership ◮ inclusion ◮ equality

slide-65
SLIDE 65

Completeness Theorem

Collect all polynomal invariants: ¯ Ip = {r ∈ Q[z] | r([ [t] ]) = 0 (t ∈ dom(p))} (p ∈ P)

slide-66
SLIDE 66

Completeness Theorem

Collect all polynomal invariants: ¯ Ip = {r ∈ Q[z] | r([ [t] ]) = 0 (t ∈ dom(p))} (p ∈ P) Then p → ¯ Ip is inductive.

slide-67
SLIDE 67

Completeness Theorem

Collect all polynomal invariants: ¯ Ip = {r ∈ Q[z] | r([ [t] ]) = 0 (t ∈ dom(p))} (p ∈ P) Then p → ¯ Ip is inductive.

Corollary

Let Hij(z) = zqij − zq′ij. Then q, q′ are equivalent (at p0) iff Hij ∈ Ip0 (1 ≤ i, j ≤ l) for some inductive polynomial invariant p → Ip.

slide-68
SLIDE 68

Key Lemma

¯ I(V) = {r | ∀ v ∈ V. r(v) = 0}

vanishing ideal

slide-69
SLIDE 69

Key Lemma

¯ I(V) = {r | ∀ v ∈ V. r(v) = 0}

vanishing ideal

V1 ⊆ Qm, V2 ⊆ Qn

slide-70
SLIDE 70

Key Lemma

¯ I(V) = {r | ∀ v ∈ V. r(v) = 0}

vanishing ideal

V1 ⊆ Qm, V2 ⊆ Qn Then ¯ I(V1 × V2) = ¯ I(V1 × Qn) ⊕ ¯ I(Qm × V2)

slide-71
SLIDE 71

Discussion

  • The best inductive invariant p → ¯

Ip is a greatest fixpoint. Greatest fixpoint iteration over polynomial ideals may not terminate.

slide-72
SLIDE 72

Discussion

  • The best inductive invariant p → ¯

Ip is a greatest fixpoint. Greatest fixpoint iteration over polynomial ideals may not terminate.

  • All inductive invariants, though, can be recursively

enumerated!

slide-73
SLIDE 73

Discussion

  • The best inductive invariant p → ¯

Ip is a greatest fixpoint. Greatest fixpoint iteration over polynomial ideals may not terminate.

  • All inductive invariants, though, can be recursively

enumerated!

  • All potential counter examples can be enumerated ...
slide-74
SLIDE 74

Discussion (cont.)

The ith iterate of GFP iteration ¯ I

(i) p = {r | ∀ t ∈ dom(p), depth(t) < i.

r([ [t] ]) = 0}

slide-75
SLIDE 75

Discussion (cont.)

The ith iterate of GFP iteration ¯ I

(i) p = {r | ∀ t ∈ dom(p), depth(t) < i.

r([ [t] ]) = 0} If inequivalence holds, then H ∈ ¯ I

(i) p0 for some i.

slide-76
SLIDE 76

Discussion (cont.)

The ith iterate of GFP iteration ¯ I

(i) p = {r | ∀ t ∈ dom(p), depth(t) < i.

r([ [t] ]) = 0} If inequivalence holds, then H ∈ ¯ I

(i) p0 for some i.

= = ⇒ search for counter example

slide-77
SLIDE 77

Discussion (cont.)

Let p → Id,p denote the inductive invariant of vector spaces of polynomials of degree at most d = = ⇒ Abstraction

slide-78
SLIDE 78

Discussion (cont.)

Let p → Id,p denote the inductive invariant of vector spaces of polynomials of degree at most d = = ⇒ Abstraction For every d, greatest fixpoint computation terminates

slide-79
SLIDE 79

Discussion (cont.)

Let p → Id,p denote the inductive invariant of vector spaces of polynomials of degree at most d = = ⇒ Abstraction For every d, greatest fixpoint computation terminates = = ⇒ p → Id,p is computable.

slide-80
SLIDE 80

Abstraction Refinement

Sequence of abstractions satisfies:

  • I0,p ⊆ I1,p ⊆ . . . ⊆ ¯

Ip

slide-81
SLIDE 81

Abstraction Refinement

Sequence of abstractions satisfies:

  • I0,p ⊆ I1,p ⊆ . . . ⊆ ¯

Ip

  • Id,p = ¯

Ip for some d.

slide-82
SLIDE 82

Abstraction Refinement

Sequence of abstractions satisfies:

  • I0,p ⊆ I1,p ⊆ . . . ⊆ ¯

Ip

  • Id,p = ¯

Ip for some d. = = ⇒ search for inductive invariant

slide-83
SLIDE 83

Wrap-up

Theorem

  • Equivalence of deterministic tree-to-matrix

transducers is decidable.

slide-84
SLIDE 84

Wrap-up

Theorem

  • Equivalence of deterministic tree-to-matrix

transducers is decidable.

  • Equvalence of general deterministic tree-to-string

transducers is decidable.

slide-85
SLIDE 85

Wrap-up

Theorem

  • Equivalence of deterministic tree-to-matrix

transducers is decidable.

  • Equvalence of general deterministic tree-to-string

transducers is decidable.

  • Equvalence of general deterministic tree-to-free

transducers is decidable.

slide-86
SLIDE 86

Summary

Matrices allow to encode general output alphabets

slide-87
SLIDE 87

Summary

Matrices allow to encode general output alphabets

slide-88
SLIDE 88

Summary

Matrices allow to encode general output alphabets — w/o inverses. Equivalence for tree-to-matrix transducers can be handled by means of techniques from precise program analysis, i.e., program proving, and abstraction refinement.

slide-89
SLIDE 89

Thank you!