Copyful Streaming String Transducers Emmanuel Filiot Pierre-Alain - - PowerPoint PPT Presentation
Copyful Streaming String Transducers Emmanuel Filiot Pierre-Alain - - PowerPoint PPT Presentation
Copyful Streaming String Transducers Emmanuel Filiot Pierre-Alain Reynier ULB, Computer Science LIF, Aix-Marseille University Department & CNRS RP2017, Royal Holloway Automata based formal methods Automata-based approaches: model
Automata based formal methods
Automata-based approaches: model checking controller synthesis performance evaluation model optimization
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 2 / 14
Automata based formal methods
Automata-based approaches: model checking controller synthesis performance evaluation model optimization Lift this study to transducers: language and speech processing model-checking infinite state-space systems reactive systems verification of web sanitizers
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 2 / 14
Overview
1
Introduction
2
Streaming String Transducers
3
HDT0L systems to the rescue
4
From copyful to copyless SST
5
Conclusion
Overview
1
Introduction
2
Streaming String Transducers
3
HDT0L systems to the rescue
4
From copyful to copyless SST
5
Conclusion
Streaming String Transducers [Alur, Cerny, 2010]
SST= Deterministic Finite-state Automata extended with registers
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 3 / 14
Streaming String Transducers [Alur, Cerny, 2010]
SST= Deterministic Finite-state Automata extended with registers Registers: output words Register updates: X := u · Y · v X := YZ X, Y , Z: registers u, v: words in Σ∗ XY σ, updσ : X := X.σ Y := σY w → w . mirror(w)
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 3 / 14
Streaming String Transducers [Alur, Cerny, 2010]
SST= Deterministic Finite-state Automata extended with registers Registers: output words Register updates: X := u · Y · v X := YZ X, Y , Z: registers u, v: words in Σ∗ a XY b YX a, upda b, updb b, updb a, upda w → w . mirror(w) if last(w) = a mirror(w) . w if last(w) = b
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 3 / 14
Streaming String Transducers [Alur, Cerny, 2010]
SST= Deterministic Finite-state Automata extended with registers Registers: output words Register updates: X := u · Y · v X := YZ X, Y , Z: registers u, v: words in Σ∗ a XY b YX a, upda b, updb b, updb a, upda w → w . mirror(w) if last(w) = a mirror(w) . w if last(w) = b Copyless restriction: a register cannot be copied OK X := XY Y := aZb Z := bb KO X := Y a Y := X Z := bY KO X := Y aY Y := XZ Z := bb
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 3 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε Y: ε
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a Y: ε b
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab Y: ε b a
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc Backward interpretation: word over registers
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc Backward interpretation: word over registers XY ρf (q)
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc Backward interpretation: word over registers XbXc XY ρ3(ρf (q))
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc Backward interpretation: word over registers XYbXYc XbXc XY ρ2(ρ3(ρf (q)))
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc Backward interpretation: word over registers aXbbaXbc XYbXYc XbXc XY ρ1(ρ2(ρ3(ρf (q))))
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Semantics of SST: two views
q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Forward interpretation: register valuations X: ε a ab abbab Y: ε b a c ➜ the final output is abbabc Backward interpretation: word over registers abbabc aXbbaXbc XYbXYc XbXc XY ρini(ρ1(ρ2(ρ3(ρf (q))))) ➜ composition of homomorphisms
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 4 / 14
Why are SST worth being studied?
“Regular” word-to-word functions: copyless SST (and also 1-bounded SST, k-bounded SST) deterministic two-way transducers MSO-definable word transducers ➜ most simple and intuitive model
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 5 / 14
Why are SST worth being studied?
“Regular” word-to-word functions: copyless SST (and also 1-bounded SST, k-bounded SST) deterministic two-way transducers MSO-definable word transducers ➜ most simple and intuitive model Positive results: equivalence of copyless SST is in PSPACE functionality of non-deterministic SST is in PSPACE type checking is in PSPACE (Given A, B and T, does T(A) ⊆ B?) closed under composition
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 5 / 14
What about copyful SST?
Non-linear updates ➜ not anymore linear-size increase ➜ strictly increases the expressive power X a, X := a a, X := XX
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 6 / 14
What about copyful SST?
Non-linear updates ➜ not anymore linear-size increase ➜ strictly increases the expressive power X a, X := a a, X := XX A second example: u#v → v[a ← u] (quadratic blow-up)
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 6 / 14
What about copyful SST?
Non-linear updates ➜ not anymore linear-size increase ➜ strictly increases the expressive power X a, X := a a, X := XX A second example: u#v → v[a ← u] (quadratic blow-up) σ = #, X := X.σ Y := ε
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 6 / 14
What about copyful SST?
Non-linear updates ➜ not anymore linear-size increase ➜ strictly increases the expressive power X a, X := a a, X := XX A second example: u#v → v[a ← u] (quadratic blow-up) σ = #, X := X.σ Y := ε Y #
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 6 / 14
What about copyful SST?
Non-linear updates ➜ not anymore linear-size increase ➜ strictly increases the expressive power X a, X := a a, X := XX A second example: u#v → v[a ← u] (quadratic blow-up) σ = #, X := X.σ Y := ε Y # σ = a, X := X Y := Y σ
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 6 / 14
What about copyful SST?
Non-linear updates ➜ not anymore linear-size increase ➜ strictly increases the expressive power X a, X := a a, X := XX A second example: u#v → v[a ← u] (quadratic blow-up) σ = #, X := X.σ Y := ε Y # σ = a, X := X Y := Y σ a, X := X Y := YX
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 6 / 14
Our results for copyful SST
We obtain decidability results for copyful SST: equivalence functionality copyless-definability: given an SST, does there exist an equivalent copyless one? Note: decidability of SST equivalence is also a consequence of: decidability of the equivalence of top-down tree-to-string transducers [STOC’15] recent result on polynomial automata [LICS’17]
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 7 / 14
Overview
1
Introduction
2
Streaming String Transducers
3
HDT0L systems to the rescue
4
From copyful to copyless SST
5
Conclusion
HDT0L systems
An HDT0L system is defined by: three alphabets Σ (input), A (working) and Γ (output) an initial word v ∈ A∗ for each σ ∈ Σ, a homomorphism hσ : A∗ → A∗ a final morphism h : A∗ → Γ∗ Behaviour: v ∈ A∗
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 8 / 14
HDT0L systems
An HDT0L system is defined by: three alphabets Σ (input), A (working) and Γ (output) an initial word v ∈ A∗ for each σ ∈ Σ, a homomorphism hσ : A∗ → A∗ a final morphism h : A∗ → Γ∗ Behaviour: σ1 . . . σk ∈ Σ∗ hσ1 . . . hσk(v) ∈ A∗
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 8 / 14
HDT0L systems
An HDT0L system is defined by: three alphabets Σ (input), A (working) and Γ (output) an initial word v ∈ A∗ for each σ ∈ Σ, a homomorphism hσ : A∗ → A∗ a final morphism h : A∗ → Γ∗ Behaviour: H : σ1 . . . σk ∈ Σ∗ → hhσ1 . . . hσk(v) ∈ Γ∗
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 8 / 14
HDT0L systems
An HDT0L system is defined by: three alphabets Σ (input), A (working) and Γ (output) an initial word v ∈ A∗ for each σ ∈ Σ, a homomorphism hσ : A∗ → A∗ a final morphism h : A∗ → Γ∗ Behaviour: H : σ1 . . . σk ∈ Σ∗ → hhσ1 . . . hσk(v) ∈ Γ∗
Theorem (Culik II & Karhumaki’86, Ruhonen’86, Honkala’00)
Given two HDT0L systems H1 and H2, one can decide whether H1(w) = H2(w) for every w ∈ Σ∗.
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 8 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2 Computation of H0(baa) $1$2
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2 Computation of H0(baa) $1$2 $1aa$2
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2 Computation of H0(baa) $1$2 $1aa$2 $1aaaa$2
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2 Computation of H0(baa) $1$2 $1aa$2 $1aaaa$2 $1baaaab$2
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2 Computation of H0(baa): $1$2 $1aa$2 $1aaaa$2 $1baaaab$2 baaaab
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L systems: an example
Σ = Γ = {a, b} A = Σ ∪ {$1, $2} v = $1$2 ha : leaves Σ unchanged, $1 → $1a, $2 → a$2 hb : similar to ha h: leaves Σ unchanged, erases $1, $2 Computation of H0(baa): $1$2 $1aa$2 $1aaaa$2 $1baaaab$2 baaaab Transformation w → w . mirror(w)
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 9 / 14
HDT0L and SST
Theorem
HDT0L systems ≡ total copyful SST. Constructions are effective in both directions, in linear-time.
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 10 / 14
HDT0L and SST
HDT0L total SST: q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Backward interpretation: word over registers abbabc aXbbaXbc XYbXYc XbXc XY ρini(ρ1(ρ2(ρ3(ρf (q)))))
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 10 / 14
HDT0L and SST
HDT0L total SST: q XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Backward interpretation: word over registers abbabc aXbbaXbc XYbXYc XbXc XY ρini(ρ1(ρ2(ρ3(ρf (q))))) ➜ HDT0L are single-state SST! q1 v h σ, hσ
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 10 / 14
HDT0L and SST (2)
total SST HDT0L: q0 q1 q2 q3 XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Backward interpretation: word over registers abbabc aXbbaXbc XYbXYc XbXc XY ρini(ρ1(ρ2(ρ3(ρf (q3)))))
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 11 / 14
HDT0L and SST (2)
total SST HDT0L: q0 q1 q2 q3 XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Backward interpretation: word over registers abbabc aXbbaXbc XYbXYc Xq2bq2Xq2cq2 Xq3Yq3 ρini(ρ1(ρ2(ρ3(ρf (q3))))) Problem1: states ➜ annotate registers and elements of Σ with Q
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 11 / 14
HDT0L and SST (2)
total SST HDT0L: q0 q1 q2 q3 XY
ρ1 X := aX Y := b ρ2 X := XY Y := a ρ3 X := XbX Y := c
Backward interpretation: word over registers abbabc aXbbaXbc XYbXYc Xq2bq2Xq2cq2 Xq3Yq3 ρini(ρ1(ρ2(ρ3(ρf (q3))))) Problem1: states ➜ annotate registers and elements of Σ with Q Problem2: SST are not co-deterministic (q1
a,ρ1
− − → q and q2
a,ρ2
− − → q) ➜ apply both updates! ∀w, ∀q, there is exactly one accepting run on w from q Final homomorphism h erases useless computations
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 11 / 14
Consequences
Theorem
Equivalence of copyful SST is decidable, with same complexity as equivalence of HDT0L systems.
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 12 / 14
Consequences
Theorem
Equivalence of copyful SST is decidable, with same complexity as equivalence of HDT0L systems. For non-deterministic SST, we can study the functionality problem: Is it the case that for any two runs on the same input word, the output words are equal? Using a squaring construction, we reduce it to equivalence:
Theorem
Functionality of non-deterministic copyful SST is decidable.
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 12 / 14
Overview
1
Introduction
2
Streaming String Transducers
3
HDT0L systems to the rescue
4
From copyful to copyless SST
5
Conclusion
From copyful to copyless SST
Exisiting result: Bounded copy SST ≡ copyless SST
A pair (p, X) is problematic iff
1 unbounded register content 2 unbounded copy Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 13 / 14
From copyful to copyless SST
Exisiting result: Bounded copy SST ≡ copyless SST
A pair (p, X) is problematic iff
1 unbounded register content 2 unbounded copy
Condition 1.: fixpoint computation on sizes Condition 2.: reduction to a boundedness problem on products of matrices [Mandel & Simon’77] ➜ Decidability in polynomial time!
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 13 / 14
From copyful to copyless SST
Exisiting result: Bounded copy SST ≡ copyless SST
A pair (p, X) is problematic iff
1 unbounded register content 2 unbounded copy
Condition 1.: fixpoint computation on sizes Condition 2.: reduction to a boundedness problem on products of matrices [Mandel & Simon’77] ➜ Decidability in polynomial time!
Theorem
Given a copyful SST, one can decide in PTime whether there exists an equivalent copyless SST.
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 13 / 14
Overview
1
Introduction
2
Streaming String Transducers
3
HDT0L systems to the rescue
4
From copyful to copyless SST
5
Conclusion
Summary and Perspectives
strong link between copyful SST and HDT0L systems: copyful SST and HDT0L systems are the same! positive results for copyful SST (equivalence, functionality) decision of copyless among copyful SST
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 14 / 14
Summary and Perspectives
strong link between copyful SST and HDT0L systems: copyful SST and HDT0L systems are the same! positive results for copyful SST (equivalence, functionality) decision of copyless among copyful SST copyful SST deserve to be studied, they own good properties too! possible to transfer results between copyful SST and HDT0L systems
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 14 / 14
Summary and Perspectives
strong link between copyful SST and HDT0L systems: copyful SST and HDT0L systems are the same! positive results for copyful SST (equivalence, functionality) decision of copyless among copyful SST copyful SST deserve to be studied, they own good properties too! possible to transfer results between copyful SST and HDT0L systems
Thanks!
Pierre-Alain Reynier (LIF, AMU & CNRS) Copyful Streaming String Transducers RP 2017 14 / 14