from monadic second-order definable string transformations to transducers
TRANSCRIPT
![Page 1: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/1.jpg)
From Monadic Second-Order Definable StringTransformations to Transducers
Rajeev Alur1 Antoine Durand-Gasselin2 Ashutosh Trivedi3
1University of Pennsylvania
2LIAFA, Universite Paris Diderot
3Indian Institute of Technology Bombay
June 21, 2013
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 1 / 31
![Page 2: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/2.jpg)
Regular Word Analysis
Qualitative properties over wordsϕ : Σ∞ → {0, 1}
MSO formulas Finite state automata
Logically Computational model
Regular Word Transformation
Transformations of wordsϕ : Σ∞ → Σ∞
Definition using MSO Streaming Transducers
Logically Computational model
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 2 / 31
![Page 3: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/3.jpg)
Regular Word Analysis
Qualitative properties over wordsϕ : Σ∞ → {0, 1}
MSO formulas Finite state automata
Logically Computational model
Equivalence [Buchi, 1960]
Regular Word Transformation
Transformations of wordsϕ : Σ∞ → Σ∞
Definition using MSO Streaming Transducers
Logically Computational model
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 2 / 31
![Page 4: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/4.jpg)
Regular Word Analysis
Qualitative properties over wordsϕ : Σ∞ → {0, 1}
MSO formulas Finite state automata
Logically Computational model
Equivalence [Buchi, 1960]
Regular Word Transformation
Transformations of wordsϕ : Σ∞ → Σ∞
Definition using MSO Streaming Transducers
Logically Computational model
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 2 / 31
![Page 5: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/5.jpg)
Regular Word Analysis
Qualitative properties over wordsϕ : Σ∞ → {0, 1}
MSO formulas Finite state automata
Logically Computational model
Equivalence [Buchi, 1960]
Regular Word Transformation
Transformations of wordsϕ : Σ∞ → Σ∞
Definition using MSO Streaming Transducers
Logically Computational model
Equi-expressiveness
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 2 / 31
![Page 6: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/6.jpg)
Monadic Second Order Logic (MSO)We deal about MSO over the linear order:
The structure is( N , > , P1, . . . ,Pk )
The domain: N or [1, n] The order relation Some unary predicates
Words are interpreted structures: e.g. ([1, 10], >,Pa,Pb,Pc)
w = a b b a b c a b c c
Pa = { 1, 4, 7}Pb = { 2, 3, 5, 8}Pc = { 6, 9, 10}
Formulas are defined inductively:I Atomic: x1 < x2, P(x1), X (x), ...I Boolean connectives: ϕ1 ∧ ϕ2, ¬ϕ3, ...I First-order quantification: ∃x .ϕI Second-order quantification: ∃X .ϕ
An MSO formula with no free variables defines a language
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 3 / 31
![Page 7: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/7.jpg)
Monadic Second Order Logic (MSO)We deal about MSO over the linear order:
The structure is( N , > , P1, . . . ,Pk )
The domain: N or [1, n] The order relation Some unary predicates
Words are interpreted structures: e.g. ([1, 10], >,Pa,Pb,Pc)
w = a b b a b c a b c c
Pa = { 1, 4, 7}Pb = { 2, 3, 5, 8}Pc = { 6, 9, 10}
Formulas are defined inductively:I Atomic: x1 < x2, P(x1), X (x), ...I Boolean connectives: ϕ1 ∧ ϕ2, ¬ϕ3, ...I First-order quantification: ∃x .ϕI Second-order quantification: ∃X .ϕ
An MSO formula with no free variables defines a language
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 3 / 31
![Page 8: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/8.jpg)
Monadic Second Order Logic (MSO)We deal about MSO over the linear order:
The structure is( N , > , P1, . . . ,Pk )
The domain: N or [1, n] The order relation Some unary predicates
Words are interpreted structures: e.g. ([1, 10], >,Pa,Pb,Pc)
w = a b b a b c a b c c
Pa = { 1, 4, 7}Pb = { 2, 3, 5, 8}Pc = { 6, 9, 10}
Formulas are defined inductively:I Atomic: x1 < x2, P(x1), X (x), ...I Boolean connectives: ϕ1 ∧ ϕ2, ¬ϕ3, ...I First-order quantification: ∃x .ϕI Second-order quantification: ∃X .ϕ
An MSO formula with no free variables defines a language
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 3 / 31
![Page 9: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/9.jpg)
Monadic Second Order Logic (MSO)We deal about MSO over the linear order:
The structure is( N , > , P1, . . . ,Pk )
The domain: N or [1, n] The order relation Some unary predicates
Words are interpreted structures: e.g. ([1, 10], >,Pa,Pb,Pc)
w = a b b a b c a b c c
Pa = { 1, 4, 7}Pb = { 2, 3, 5, 8}Pc = { 6, 9, 10}
Formulas are defined inductively:I Atomic: x1 < x2, P(x1), X (x), ...I Boolean connectives: ϕ1 ∧ ϕ2, ¬ϕ3, ...I First-order quantification: ∃x .ϕI Second-order quantification: ∃X .ϕ
An MSO formula with no free variables defines a language
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 3 / 31
![Page 10: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/10.jpg)
Appealing computational model: Finite State Automata
Theorem [Buchi, 1960]
A language is MSO definable iff it is accepted by a finite-state automaton.
Deterministic automata are a computational model to analyse words:process sequentially a word input by jumping from state to state
Can be efficiently manipulatedI Automata can be determinizedI LSPACE algorithm to check if a word is accepted by an automatonI Minimization (equivalence in time O(n log log n))I Product of automata (language union, intersection,...)
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 4 / 31
![Page 11: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/11.jpg)
Regular Word Analysis
Qualitative properties over wordsϕ : Σ∞ → {0, 1}
MSO formulas Finite state automata
Logically Computational model
Equivalence [Buchi, 1960]
Regular Word Transformation
Transformations of wordsϕ : Σ∞ → Σ∞
Definition using MSO Streaming Transducers
Logically Computational model
Equi-expressiveness
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 5 / 31
![Page 12: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/12.jpg)
Contents
1 Regular TransformationsLogical definitionStreaming Transducers
2 Contribution: Equivalence with a direct logic-based reductionSome logical considerationsProof Walkthrough
3 Decision proceduresFunctional equivalenceTypechecking Problem
4 Conclusion
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 6 / 31
![Page 13: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/13.jpg)
Contents
1 Regular TransformationsLogical definitionStreaming Transducers
2 Contribution: Equivalence with a direct logic-based reductionSome logical considerationsProof Walkthrough
3 Decision proceduresFunctional equivalenceTypechecking Problem
4 Conclusion
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 7 / 31
![Page 14: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/14.jpg)
MSO-definable Transformations
[Courcelle, 1994] Defining Graph Transformations using MSO
A labeled graph transformation using MSO is specified by:
input and output alphabets;
an MSO formula specifying the domain of the transformation;
output is specified using a finite number of copies of nodes of inputgraph;
the node labels are specified using MSO formulas; and
the existence of edges between nodes of various copies is specifiedusing MSO formulas
Example
Let Σ = {a, b,#}. Consider a transformation f1 : Σ∞ → Σ∞
u1#u2# . . . un−1#un#v 7→ u1u1# . . .#unun#v .
where u is reverse of u.
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 8 / 31
![Page 15: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/15.jpg)
MSO-definable Transformations
[Courcelle, 1994] Defining Graph Transformations using MSO
A labeled graph transformation using MSO is specified by:
input and output alphabets;
an MSO formula specifying the domain of the transformation;
output is specified using a finite number of copies of nodes of inputgraph;
the node labels are specified using MSO formulas; and
the existence of edges between nodes of various copies is specifiedusing MSO formulas
Example
Let Σ = {a, b,#}. Consider a transformation f1 : Σ∞ → Σ∞
u1#u2# . . . un−1#un#v 7→ u1u1# . . .#unun#v .
where u is reverse of u.Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 8 / 31
![Page 16: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/16.jpg)
MSO-definable Transformations
input: a b c b b # a a b # c c a a # b
copy 1: a b c b b a a b c c a a
copy 2: a b c b b # a a b # c c a a # b
Σ = Γ = {a, b, c ,#}, C = {1, 2}, and
Node Label Formulas (|Γ|.|C | formulas)
I Labelc1α (x) = Labelinpα (x) ∧ ¬Labelinp# (x) ∧ reach#(x)
I Labelc2α (x) = Labelinpα (x)
Edge Label Formulas (|C |2 formulas)
I Edgec1,c1(x , y) = Edgeinp(y , x) ∧ ¬Labelinp# (x) ∧ ¬Labelinp# (y).I Edgec2,c2(x , y) =
Edgeinp(x , y) ∧ (¬Labelinp# (x)∨(Labelinp# (x)∧¬reach#(x)))
I Edge1,2(x , y)=(x=y)∧(first(x)∨∃z(Labelinp# (z)∧Edgeinp(z , x)))
I Edge2,1(x , y)=Labelinp# (x) ∧ reach#(x) ∧ (∃z(Edgeinp(y , z) ∧Labelinp# (z))) ∧ (∀z((path(x , z) ∧ path(z , y))→ ¬Labelinp# (z)))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 9 / 31
![Page 17: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/17.jpg)
MSO-definable Transformations
input: a b c b b # a a b # c c a a # b
copy 1: a b c b b a a b c c a a
copy 2: a b c b b # a a b # c c a a # b
Σ = Γ = {a, b, c ,#}, C = {1, 2}, and
Node Label Formulas (|Γ|.|C | formulas)
I Labelc1α (x) = Labelinpα (x) ∧ ¬Labelinp# (x) ∧ reach#(x)
I Labelc2α (x) = Labelinpα (x)
Edge Label Formulas (|C |2 formulas)
I Edgec1,c1(x , y) = Edgeinp(y , x) ∧ ¬Labelinp# (x) ∧ ¬Labelinp# (y).I Edgec2,c2(x , y) =
Edgeinp(x , y) ∧ (¬Labelinp# (x)∨(Labelinp# (x)∧¬reach#(x)))
I Edge1,2(x , y)=(x=y)∧(first(x)∨∃z(Labelinp# (z)∧Edgeinp(z , x)))
I Edge2,1(x , y)=Labelinp# (x) ∧ reach#(x) ∧ (∃z(Edgeinp(y , z) ∧Labelinp# (z))) ∧ (∀z((path(x , z) ∧ path(z , y))→ ¬Labelinp# (z)))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 9 / 31
![Page 18: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/18.jpg)
MSO-definable Transformations
input: a b c b b # a a b # c c a a # b
copy 1: a b c b b a a b c c a a
copy 2: a b c b b # a a b # c c a a # b
Σ = Γ = {a, b, c ,#}, C = {1, 2}, and
Node Label Formulas (|Γ|.|C | formulas)
I Labelc1α (x) = Labelinpα (x) ∧ ¬Labelinp# (x) ∧ reach#(x)
I Labelc2α (x) = Labelinpα (x)
Edge Label Formulas (|C |2 formulas)
I Edgec1,c1(x , y) = Edgeinp(y , x) ∧ ¬Labelinp# (x) ∧ ¬Labelinp# (y).I Edgec2,c2(x , y) =
Edgeinp(x , y) ∧ (¬Labelinp# (x)∨(Labelinp# (x)∧¬reach#(x)))
I Edge1,2(x , y)=(x=y)∧(first(x)∨∃z(Labelinp# (z)∧Edgeinp(z , x)))
I Edge2,1(x , y)=Labelinp# (x) ∧ reach#(x) ∧ (∃z(Edgeinp(y , z) ∧Labelinp# (z))) ∧ (∀z((path(x , z) ∧ path(z , y))→ ¬Labelinp# (z)))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 9 / 31
![Page 19: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/19.jpg)
Streaming Transducers [Alur and Cerny, 2011]
A streaming transducer is an automaton:
( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
extended with a finite set of registers X
which will store values from domain D
with an update function ρ : Q × Σ→ X → T (X , f1, . . . , fk)
T (X , f1, . . . , fk) denotes terms obtained with functions f1, . . . , fk andregisters.
Its configurations will be a state together with a valuation of eachregister Q × [X → D]
An output function F :I Finite word input this is a function from Q to T (X , f1, . . . , fk).
The image of w is the value of the term F(δ(w))I in the case of infinite word input, this is a function from 2Q to X .
The image of w is the limit of the value of register F(δ(w))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 10 / 31
![Page 20: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/20.jpg)
Streaming Transducers [Alur and Cerny, 2011]
A streaming transducer is an automaton:
( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
extended with a finite set of registers X
which will store values from domain D
with an update function ρ : Q × Σ→ X → T (X , f1, . . . , fk)
T (X , f1, . . . , fk) denotes terms obtained with functions f1, . . . , fk andregisters.
Its configurations will be a state together with a valuation of eachregister Q × [X → D]
An output function F :I Finite word input this is a function from Q to T (X , f1, . . . , fk).
The image of w is the value of the term F(δ(w))I in the case of infinite word input, this is a function from 2Q to X .
The image of w is the limit of the value of register F(δ(w))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 10 / 31
![Page 21: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/21.jpg)
Streaming Transducers [Alur and Cerny, 2011]
A streaming transducer is an automaton:
( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
extended with a finite set of registers X
which will store values from domain D
with an update function ρ : Q × Σ→ X → T (X , f1, . . . , fk)
T (X , f1, . . . , fk) denotes terms obtained with functions f1, . . . , fk andregisters.
Its configurations will be a state together with a valuation of eachregister Q × [X → D]
An output function F :I Finite word input this is a function from Q to T (X , f1, . . . , fk).
The image of w is the value of the term F(δ(w))I in the case of infinite word input, this is a function from 2Q to X .
The image of w is the limit of the value of register F(δ(w))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 10 / 31
![Page 22: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/22.jpg)
Streaming Transducers [Alur and Cerny, 2011]
A streaming transducer is an automaton:
( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
extended with a finite set of registers X
which will store values from domain D
with an update function ρ : Q × Σ→ X → T (X , f1, . . . , fk)
T (X , f1, . . . , fk) denotes terms obtained with functions f1, . . . , fk andregisters.
Its configurations will be a state together with a valuation of eachregister Q × [X → D]
An output function F :I Finite word input this is a function from Q to T (X , f1, . . . , fk).
The image of w is the value of the term F(δ(w))I in the case of infinite word input, this is a function from 2Q to X .
The image of w is the limit of the value of register F(δ(w))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 10 / 31
![Page 23: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/23.jpg)
Streaming Transducers [Alur and Cerny, 2011]
A streaming transducer is an automaton:
( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
extended with a finite set of registers X
which will store values from domain D
with an update function ρ : Q × Σ→ X → T (X , f1, . . . , fk)
T (X , f1, . . . , fk) denotes terms obtained with functions f1, . . . , fk andregisters.
Its configurations will be a state together with a valuation of eachregister Q × [X → D]
An output function F :I Finite word input this is a function from Q to T (X , f1, . . . , fk).
The image of w is the value of the term F(δ(w))I in the case of infinite word input, this is a function from 2Q to X .
The image of w is the limit of the value of register F(δ(w))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 10 / 31
![Page 24: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/24.jpg)
Streaming Transducers [Alur and Cerny, 2011]
A streaming transducer is an automaton:
( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
extended with a finite set of registers X
which will store values from domain D
with an update function ρ : Q × Σ→ X → T (X , f1, . . . , fk)
T (X , f1, . . . , fk) denotes terms obtained with functions f1, . . . , fk andregisters.
Its configurations will be a state together with a valuation of eachregister Q × [X → D]
An output function F :I Finite word input this is a function from Q to T (X , f1, . . . , fk).
The image of w is the value of the term F(δ(w))I in the case of infinite word input, this is a function from 2Q to X .
The image of w is the limit of the value of register F(δ(w))
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 10 / 31
![Page 25: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/25.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 26: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/26.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 27: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/27.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 28: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/28.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 29: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/29.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 30: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/30.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 31: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/31.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 32: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/32.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 33: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/33.jpg)
An example
A = ( Σ,Q, δ, q0 , F , X , (D, f1, . . . , fk) , ρ )
Here D = Σ∗ , and we have binary function · (concatenation) and
constants ε, a, b, c,#
qstart
#
∣∣∣∣∣∣X := X · Z ·#Y := εZ := ε
α
∣∣∣∣∣∣X := XY := Y · αZ := α · Z · α
F(q) = X · Y
a b # a # a b
X ε ε baab# baab# baab#aa# baab#aa# baab#aa#
Y a ab ε a ε a ab
Z aa baab ε aa ε aa baab
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 11 / 31
![Page 34: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/34.jpg)
A restriction on the update function
qstart α|X = X · α · X F = X
This leads to an exponential output
We want to forbid this behaviour:I Copylessness: each register appear at most once on the r.h.s.I Restricted copy: copies allowed but recombining is not possibleI Bounded copy: in the end the content of any register is never copies
more than a bounded number of times
Streaming transducers have to satisfy this syntactic restriction
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 12 / 31
![Page 35: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/35.jpg)
A restriction on the update function
qstart α|X = X · α · X F = X
This leads to an exponential output
We want to forbid this behaviour:I Copylessness: each register appear at most once on the r.h.s.I Restricted copy: copies allowed but recombining is not possibleI Bounded copy: in the end the content of any register is never copies
more than a bounded number of times
Streaming transducers have to satisfy this syntactic restriction
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 12 / 31
![Page 36: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/36.jpg)
A restriction on the update function
qstart α|X = X · α · X F = X
This leads to an exponential output
We want to forbid this behaviour:I Copylessness: each register appear at most once on the r.h.s.I Restricted copy: copies allowed but recombining is not possibleI Bounded copy: in the end the content of any register is never copies
more than a bounded number of times
Streaming transducers have to satisfy this syntactic restriction
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 12 / 31
![Page 37: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/37.jpg)
Contents
1 Regular TransformationsLogical definitionStreaming Transducers
2 Contribution: Equivalence with a direct logic-based reductionSome logical considerationsProof Walkthrough
3 Decision proceduresFunctional equivalenceTypechecking Problem
4 Conclusion
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 13 / 31
![Page 38: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/38.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 14 / 31
![Page 39: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/39.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
Buchi
Rabin
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 14 / 31
![Page 40: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/40.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
Buchi
Rabin
[AC11]
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 14 / 31
![Page 41: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/41.jpg)
Existing proof, through a two way transducerCase of transformations from finite strings to finite strings [Alur and Cerny, 2011]
MSOTransformation
Two-Way transducerw/ look-ahead
Two-Way TransducerStreamingTransducer
[Engelfriet and Hoogeboom, 2001]
[Chytil and Jakl, 1977]
[Alur and Cerny, 2011]
[Alur and Cerny, 2011]
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 15 / 31
![Page 42: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/42.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
Buchi
Rabin
[AC11]
[AFT12]
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 16 / 31
![Page 43: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/43.jpg)
Existing proof, of a through way transducerCase of transformations from infinite strings to infinite strings[Alur et al., 2012]
MSOTransformation
Two-Way transducerw/ look-ahead
Functional NSSTw/ look-ahead
Functional NSSTStreaming Transducerw/ bounded copy
StreamingTransducer
[Engelfriet and Hoogeboom, 2001][Alur et al., 2012]
[Miyano and Hayashi, 1984]
[Alur et al., 2012][Alur et al., 2012]
[Alur and Cerny, 2011]
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 17 / 31
![Page 44: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/44.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
Buchi
Rabin
[AC11]
[AFT12]
[Ad’A12] [Ad’A12]
[Ad’A12]
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 18 / 31
![Page 45: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/45.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
Buchi
Rabin
[AC11]
[AFT12]
[Ad’A12] [Ad’A12]
[Ad’A12]
?
?
?
?
?
?
?
?
?
?
?
?
?
?
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 18 / 31
![Page 46: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/46.jpg)
A computational modelfor some restricted Courcelle transformations
to {0, 1} Σ∗ Σω T ∗ T ω graphsfrom
finite words
infinite words
finite trees
infinite trees
graphs
Buchi
Rabin
[AC11]
[AFT12]
[Ad’A12] [Ad’A12]
[Ad’A12]
[ADT13]
?
?
?
?
?
?
?
?
?
?
?
?
?
?
[Alur and Cerny, 2011] (POPL) Streaming transducers for algorithmic verification of single-pass list-processing programs
[Alur et al., 2012] (LICS) Regular Transformations of Infinite Strings
[Alur and D’Antoni, 2012] (ICALP) Streaming Tree Transducers
[Alur et al., 2013] (LICS) From Monadic Second-Order Definable String Transformations to Transducers
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 18 / 31
![Page 47: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/47.jpg)
A direct proof
MSOTransformation
Streaming Transducerw/ restricted copy
[Alur, DG and Trivedi 13]
[Alur and Cerny, 2011][Alur et al., 2012]
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 19 / 31
![Page 48: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/48.jpg)
Finiteness of MSO formula up to some quantifier depth
Remark
The number of MSO sentences of quantifier depth at most k is finite
We define an equivalence relation over wordsI Two words are k-equivalent iff no formula of q.d. k can distinguish themI This equivalence relation has finite indexI We denote k-types these equivalence classes
Remark: This equivalence relation is a monoıd congruence
The k-type of u · v is determined by the k-types of u and v
Remark
Formulas with quantifier depth k and 2 first-order free variables:
ϕ(x , y) w : x yw1 w2 w3
The validity of ϕ only depends on w [x ],w [y ] and the k-types of w1,w2,w3
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 20 / 31
![Page 49: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/49.jpg)
Finiteness of MSO formula up to some quantifier depth
Remark
The number of MSO sentences of quantifier depth at most k is finiteBy induction over formulas with r FV and quantifier depth at most k :
I true when k = 0I if true for some k , notice that an MSO formula with qd k + 1 and r FV
is a boolean combination of formulas of the form ∃X .ϕ where ϕ has qdk and r + 1 FV.
I Thus a finitely generated (by induction) boolean algebra
We define an equivalence relation over wordsI Two words are k-equivalent iff no formula of q.d. k can distinguish themI This equivalence relation has finite indexI We denote k-types these equivalence classes
Remark: This equivalence relation is a monoıd congruence
The k-type of u · v is determined by the k-types of u and v
Remark
Formulas with quantifier depth k and 2 first-order free variables:
ϕ(x , y) w : x yw1 w2 w3
The validity of ϕ only depends on w [x ],w [y ] and the k-types of w1,w2,w3
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 20 / 31
![Page 50: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/50.jpg)
Finiteness of MSO formula up to some quantifier depth
Remark
The number of MSO sentences of quantifier depth at most k is finite
We define an equivalence relation over wordsI Two words are k-equivalent iff no formula of q.d. k can distinguish themI This equivalence relation has finite indexI We denote k-types these equivalence classes
Remark: This equivalence relation is a monoıd congruence
The k-type of u · v is determined by the k-types of u and v
Remark
Formulas with quantifier depth k and 2 first-order free variables:
ϕ(x , y) w : x yw1 w2 w3
The validity of ϕ only depends on w [x ],w [y ] and the k-types of w1,w2,w3
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 20 / 31
![Page 51: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/51.jpg)
Finiteness of MSO formula up to some quantifier depth
Remark
The number of MSO sentences of quantifier depth at most k is finite
We define an equivalence relation over wordsI Two words are k-equivalent iff no formula of q.d. k can distinguish themI This equivalence relation has finite indexI We denote k-types these equivalence classes
Remark: This equivalence relation is a monoıd congruence
The k-type of u · v is determined by the k-types of u and v
Remark
Formulas with quantifier depth k and 2 first-order free variables:
ϕ(x , y) w : x yw1 w2 w3
The validity of ϕ only depends on w [x ],w [y ] and the k-types of w1,w2,w3
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 20 / 31
![Page 52: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/52.jpg)
Finiteness of MSO formula up to some quantifier depth
Remark
The number of MSO sentences of quantifier depth at most k is finite
We define an equivalence relation over wordsI Two words are k-equivalent iff no formula of q.d. k can distinguish themI This equivalence relation has finite indexI We denote k-types these equivalence classes
Remark: This equivalence relation is a monoıd congruence
The k-type of u · v is determined by the k-types of u and v
Remark
Formulas with quantifier depth k and 2 first-order free variables:
ϕ(x , y) w : x yw1 w2 w3
The validity of ϕ only depends on w [x ],w [y ] and the k-types of w1,w2,w3
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 20 / 31
![Page 53: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/53.jpg)
Finiteness of MSO formula up to some quantifier depth
Remark
The number of MSO sentences of quantifier depth at most k is finite
We define an equivalence relation over wordsI Two words are k-equivalent iff no formula of q.d. k can distinguish themI This equivalence relation has finite indexI We denote k-types these equivalence classes
Remark: This equivalence relation is a monoıd congruence
The k-type of u · v is determined by the k-types of u and v
Remark
Formulas with quantifier depth k and 2 first-order free variables:
ϕ(x , y) w : x yw1 w2 w3
The validity of ϕ only depends on w [x ],w [y ] and the k-types of w1,w2,w3
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 20 / 31
![Page 54: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/54.jpg)
Crossings
w : x
• • •
• ••
• •
•
• • •
A crossing at position x is an edge which connects two nodes which are noton the same side w.r.t. x .
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 21 / 31
![Page 55: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/55.jpg)
Boundedly many crossings
1 yb ya x y ′a y ′b
w : α α • • • · · ·
c1 ◦ · · · ◦ · · · ◦ · · · ◦ · · · ◦ · · · ◦ · · ·
c2 ◦ · · · ◦ · · · ◦ · · · ◦ · · · ◦ · · · ◦ · · ·
......
◦◦
...
c ◦ · · · ◦ · · · ◦ · · · ◦ · · · ◦ · · · ◦ · · ·
· · ·· · ·· · ·
u vu′ v ′
w w ′inp
ut
outp
ut
Theorem
At any given position there are at most 2C |k-types| crossingsOtherwise in the image, two distinct nodes have an outgoing edge to the same node
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 22 / 31
![Page 56: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/56.jpg)
Boundedly many crossings means boundedly many registers
w : x
• • •
••
• •
••
• • •
One register for each triple k-type, letter, k-type would be enough
We will also need to handle all possible behaviours
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 23 / 31
![Page 57: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/57.jpg)
Boundedly many crossings means boundedly many registers
w : x
• • •
••
• •
••
• • •
? ? ? ? ? ? ? ? ? ?
One register for each triple k-type, letter, k-type would be enough
We will also need to handle all possible behaviours
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 23 / 31
![Page 58: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/58.jpg)
Handling all possible behaviours with Regular Look-Ahead
Regular look-ahead: guards on transitions (and updates)MSO queries over the suffix.
w : y x ? ? ? ? ? ? ? ? ? ?
Is there in the image some subword that starts at a position y (labeledby α), before x such that the k-type of w [0:y) is τ1 and the k-type ofw(y :x) is τ2 ?
This is an MSO query with quantifier depth K = k + |C |+ 3 !
Thus all the possible cases are handled by “guessing” the K -type ofw(x :|w |]The set of registers will be k-types ×Σ× k-types ×K -types
The set of states will be the set of K -types (the state will state whichis the K -type of the prefix read so far).
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 24 / 31
![Page 59: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/59.jpg)
Handling all possible behaviours with Regular Look-Ahead
Regular look-ahead: guards on transitions (and updates)MSO queries over the suffix.
w : y x ? ? ? ? ? ? ? ? ? ?
Is there in the image some subword that starts at a position y (labeledby α), before x such that the k-type of w [0:y) is τ1 and the k-type ofw(y :x) is τ2 ?
This is an MSO query with quantifier depth K = k + |C |+ 3 !
Thus all the possible cases are handled by “guessing” the K -type ofw(x :|w |]The set of registers will be k-types ×Σ× k-types ×K -types
The set of states will be the set of K -types (the state will state whichis the K -type of the prefix read so far).
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 24 / 31
![Page 60: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/60.jpg)
Handling all possible behaviours with Regular Look-Ahead
Regular look-ahead: guards on transitions (and updates)MSO queries over the suffix.
w : y x ? ? ? ? ? ? ? ? ? ?
Is there in the image some subword that starts at a position y (labeledby α), before x such that the k-type of w [0:y) is τ1 and the k-type ofw(y :x) is τ2 ?
This is an MSO query with quantifier depth K = k + |C |+ 3 !
Thus all the possible cases are handled by “guessing” the K -type ofw(x :|w |]The set of registers will be k-types ×Σ× k-types ×K -types
The set of states will be the set of K -types (the state will state whichis the K -type of the prefix read so far).
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 24 / 31
![Page 61: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/61.jpg)
Handling all possible behaviours with Regular Look-Ahead
Regular look-ahead: guards on transitions (and updates)MSO queries over the suffix.
w : y x ? ? ? ? ? ? ? ? ? ?
Is there in the image some subword that starts at a position y (labeledby α), before x such that the k-type of w [0:y) is τ1 and the k-type ofw(y :x) is τ2 ?
This is an MSO query with quantifier depth K = k + |C |+ 3 !
Thus all the possible cases are handled by “guessing” the K -type ofw(x :|w |]
The set of registers will be k-types ×Σ× k-types ×K -types
The set of states will be the set of K -types (the state will state whichis the K -type of the prefix read so far).
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 24 / 31
![Page 62: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/62.jpg)
Handling all possible behaviours with Regular Look-Ahead
Regular look-ahead: guards on transitions (and updates)MSO queries over the suffix.
w : y x ? ? ? ? ? ? ? ? ? ?
Is there in the image some subword that starts at a position y (labeledby α), before x such that the k-type of w [0:y) is τ1 and the k-type ofw(y :x) is τ2 ?
This is an MSO query with quantifier depth K = k + |C |+ 3 !
Thus all the possible cases are handled by “guessing” the K -type ofw(x :|w |]The set of registers will be k-types ×Σ× k-types ×K -types
The set of states will be the set of K -types (the state will state whichis the K -type of the prefix read so far).
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 24 / 31
![Page 63: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/63.jpg)
Finite word case
At the end of the input, we output the non-empty registercorresponding to the regular-look ahead ε.
The reduction does not go through a two-way model.
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 25 / 31
![Page 64: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/64.jpg)
Finite word case
At the end of the input, we output the non-empty registercorresponding to the regular-look ahead ε.
The reduction does not go through a two-way model.
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 25 / 31
![Page 65: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/65.jpg)
Infinite word input case
The main difficulty lies in that we have to guess correctly and infinitelyoften the regular look-ahead.
The image is defined as the limit of the content of some register,depending on the set of infinitely occuring states (Muller condition)
With the Muller output condition, we can have some MSO propertyover the whole word.
We need to effectively find a factorization τ(τ ′)ω of the input. Thiscan be found in Shelah’s alternative proof of Buchi Theorem, using afinite additive coloring (Ramsey’s Theorem)
Thus we can output infinitely often some increasing prefixes of theimage
We converge toward the output
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 26 / 31
![Page 66: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/66.jpg)
Infinite word input case
The main difficulty lies in that we have to guess correctly and infinitelyoften the regular look-ahead.
The image is defined as the limit of the content of some register,depending on the set of infinitely occuring states (Muller condition)
With the Muller output condition, we can have some MSO propertyover the whole word.
We need to effectively find a factorization τ(τ ′)ω of the input. Thiscan be found in Shelah’s alternative proof of Buchi Theorem, using afinite additive coloring (Ramsey’s Theorem)
Thus we can output infinitely often some increasing prefixes of theimage
We converge toward the output
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 26 / 31
![Page 67: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/67.jpg)
Infinite word input case
The main difficulty lies in that we have to guess correctly and infinitelyoften the regular look-ahead.
The image is defined as the limit of the content of some register,depending on the set of infinitely occuring states (Muller condition)
With the Muller output condition, we can have some MSO propertyover the whole word.
We need to effectively find a factorization τ(τ ′)ω of the input. Thiscan be found in Shelah’s alternative proof of Buchi Theorem, using afinite additive coloring (Ramsey’s Theorem)
Thus we can output infinitely often some increasing prefixes of theimage
We converge toward the output
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 26 / 31
![Page 68: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/68.jpg)
Infinite word input case
The main difficulty lies in that we have to guess correctly and infinitelyoften the regular look-ahead.
The image is defined as the limit of the content of some register,depending on the set of infinitely occuring states (Muller condition)
With the Muller output condition, we can have some MSO propertyover the whole word.
We need to effectively find a factorization τ(τ ′)ω of the input. Thiscan be found in Shelah’s alternative proof of Buchi Theorem, using afinite additive coloring (Ramsey’s Theorem)
Thus we can output infinitely often some increasing prefixes of theimage
We converge toward the output
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 26 / 31
![Page 69: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/69.jpg)
Infinite word input case
The main difficulty lies in that we have to guess correctly and infinitelyoften the regular look-ahead.
The image is defined as the limit of the content of some register,depending on the set of infinitely occuring states (Muller condition)
With the Muller output condition, we can have some MSO propertyover the whole word.
We need to effectively find a factorization τ(τ ′)ω of the input. Thiscan be found in Shelah’s alternative proof of Buchi Theorem, using afinite additive coloring (Ramsey’s Theorem)
Thus we can output infinitely often some increasing prefixes of theimage
We converge toward the output
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 26 / 31
![Page 70: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/70.jpg)
Infinite word input case
The main difficulty lies in that we have to guess correctly and infinitelyoften the regular look-ahead.
The image is defined as the limit of the content of some register,depending on the set of infinitely occuring states (Muller condition)
With the Muller output condition, we can have some MSO propertyover the whole word.
We need to effectively find a factorization τ(τ ′)ω of the input. Thiscan be found in Shelah’s alternative proof of Buchi Theorem, using afinite additive coloring (Ramsey’s Theorem)
Thus we can output infinitely often some increasing prefixes of theimage
We converge toward the output
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 26 / 31
![Page 71: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/71.jpg)
Contents
1 Regular TransformationsLogical definitionStreaming Transducers
2 Contribution: Equivalence with a direct logic-based reductionSome logical considerationsProof Walkthrough
3 Decision proceduresFunctional equivalenceTypechecking Problem
4 Conclusion
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 27 / 31
![Page 72: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/72.jpg)
Functional equivalence is decidableDo two transformations have the same image on any input ?
A hard problem: different logical ways to define the same transformation
w : a0 a1 a2 . . . an−1 ano1 : a1 a2 . . . an−1 ano2 : a1 a2 a3 . . . an
Reduction to reachability in a counter system (no test, no decrement):I Idea: finding a conflicting position (say a in first image, b in the second)I Two counters tracking the number of letters before the conflicting
postion in each imageI Set of states: (states of the transducer ×4registers of the transducer)2
F 0: the value of this register does not appear in the outputF 1: its value appears before the conflicting positionF 2: its value contains the conflicting positionF 3: its value is after the conflicting position
I Erase the letters in the transitions, increment corresponding to theregisters updates
I Find a reachable configuration where the two counters are equal
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 28 / 31
![Page 73: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/73.jpg)
Functional equivalence is decidableDo two transformations have the same image on any input ?
A hard problem: different logical ways to define the same transformation
w : a0 a1 a2 . . . an−1 ano1 : a1 a2 . . . an−1 ano2 : a1 a2 a3 . . . an
Reduction to reachability in a counter system (no test, no decrement):I Idea: finding a conflicting position (say a in first image, b in the second)I Two counters tracking the number of letters before the conflicting
postion in each imageI Set of states: (states of the transducer ×4registers of the transducer)2
F 0: the value of this register does not appear in the outputF 1: its value appears before the conflicting positionF 2: its value contains the conflicting positionF 3: its value is after the conflicting position
I Erase the letters in the transitions, increment corresponding to theregisters updates
I Find a reachable configuration where the two counters are equal
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 28 / 31
![Page 74: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/74.jpg)
Functional equivalence is decidableDo two transformations have the same image on any input ?
A hard problem: different logical ways to define the same transformation
w : a0 a1 a2 . . . an−1 ano1 : a1 a2 . . . an−1 ano2 : a1 a2 a3 . . . an
Reduction to reachability in a counter system (no test, no decrement):I Idea: finding a conflicting position (say a in first image, b in the second)I Two counters tracking the number of letters before the conflicting
postion in each imageI Set of states: (states of the transducer ×4registers of the transducer)2
F 0: the value of this register does not appear in the outputF 1: its value appears before the conflicting positionF 2: its value contains the conflicting positionF 3: its value is after the conflicting position
I Erase the letters in the transitions, increment corresponding to theregisters updates
I Find a reachable configuration where the two counters are equal
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 28 / 31
![Page 75: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/75.jpg)
The typechecking problem
Definition
Given formulas ϕ,ψ do we have ∀w .w � ϕ =⇒ T (w) � ψ
We can perform this check by some automatic construction
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 29 / 31
![Page 76: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/76.jpg)
Contents
1 Regular TransformationsLogical definitionStreaming Transducers
2 Contribution: Equivalence with a direct logic-based reductionSome logical considerationsProof Walkthrough
3 Decision proceduresFunctional equivalenceTypechecking Problem
4 Conclusion
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 30 / 31
![Page 77: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/77.jpg)
Conclusion
Contributions
Direct proof of equivalence between Courcelle transformations andStreaming Transducers
Previously unexplored setting of ω-words to trees
Syntactically ensuring convergence of the output
Equivalence and type-checking problems are decidable
Perspectives
More expressive transformations (relaxing the restriction on copies)
Less expressive transformations (First-order fragment)
Extension to regular cost functions
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 31 / 31
![Page 78: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/78.jpg)
Conclusion
Contributions
Direct proof of equivalence between Courcelle transformations andStreaming Transducers
Previously unexplored setting of ω-words to trees
Syntactically ensuring convergence of the output
Equivalence and type-checking problems are decidable
Perspectives
More expressive transformations (relaxing the restriction on copies)
Less expressive transformations (First-order fragment)
Extension to regular cost functions
Thank you for your attention !
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 31 / 31
![Page 79: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/79.jpg)
Alur, R. and Cerny, P. (2011).
Streaming transducers for algorithmic verification of single-pass list-processingprograms.
In POPL, pages 599–610.
Alur, R. and D’Antoni, L. (2012).
Streaming tree transducers.
In ICALP (2), volume 7392 of Lecture Notes in Computer Science, pages42–53. Springer.
Alur, R., Durand-Gasselin, A., and Trivedi, A. (2013).
From monadic second-order definable string transformations to transducers.
In LICS. IEEE.
Alur, R., Filiot, E., and Trivedi, A. (2012).
Regular transformations of infinite strings.
In LICS, pages 65–74.
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 32 / 31
![Page 80: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/80.jpg)
Buchi, J. R. (1960).
Weak second-order Arithmetic and Finite Automata.
Zeitschrift fur Mathematische Logik und Grundlagen der Mathematik, 6:66–92.
Chytil, M. and Jakl, V. (1977).
Serial composition of 2-way finite-state transducers and simple programs onstrings.
In ICALP, volume 52 of Lecture Notes in Computer Science, pages 135–147.Springer.
Courcelle, B. (1994).
Monadic second-order definable graph transductions: a survey.
Theoretical Computer Science, 126(1):53–75.
Engelfriet, J. and Hoogeboom, H. J. (2001).
MSO definable string transductions and two-way finite-state transducers.
ACM Trans. Comput. Logic, 2:216–254.
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 33 / 31
![Page 81: From Monadic Second-Order Definable String Transformations to Transducers](https://reader036.vdocuments.site/reader036/viewer/2022090906/613ca381f046235e845ce941/html5/thumbnails/81.jpg)
Miyano, S. and Hayashi, T. (1984).
Alternating finite automata on omega-words.
Theor. Comput. Sci., 32:321–330.
Alur, Durand-Gasselin, Trivedi Streaming String Transducers June 21, 2013 34 / 31