Parikh Image of Pushdown Automata Elena Guti errez and Pierre Ganty - - PowerPoint PPT Presentation
Parikh Image of Pushdown Automata Elena Guti errez and Pierre Ganty - - PowerPoint PPT Presentation
Parikh Image of Pushdown Automata Elena Guti errez and Pierre Ganty Introduction Context-free Languages (CFLs) G P L ( P ) = L ( G ) Pushdown Automata Context-free Grammars (PDAs) (CFGs) 1 Introduction Context-free Languages (CFLs)
Pushdown Automata Context-free Grammars
Introduction
(PDAs) (CFGs) P G
L(P) = L(G)
1
Context-free Languages (CFLs)
Pushdown Automata Context-free Grammars (PDAs) (CFGs)
2
P G Context-free Languages
Introduction
(CFLs)
PDA2CFG Pushdown Automata Context-free Grammars (PDAs) (CFGs)
2
P G Context-free Languages
Introduction
(CFLs)
PDAs and CFGs
q
X a b Z Pushdown Automata Context-free Grammar
S ⇒ aSa ⇒ abSba ⇒ . . . ⇒ abaaba
3
PDAs and CFGs
q
X a b Z Pushdown Automata Context-free Grammar
S ⇒ aSa ⇒ abSba ⇒ . . . ⇒ abaaba
PDA2CFG
PDA PDA2CFG CFG n states p s.s.
3
PDAs and CFGs
q
X a b Z Pushdown Automata Context-free Grammar
S ⇒ aSa ⇒ abSba ⇒ . . . ⇒ abaaba
PDA2CFG
PDA PDA2CFG V = {[q X q′] | q, q′ ∈ Q, X ∈ Γ} CFG n states p s.s.
3
PDAs and CFGs
q
X a b Z Pushdown Automata Context-free Grammar
S ⇒ aSa ⇒ abSba ⇒ . . . ⇒ abaaba
PDA2CFG
PDA PDA2CFG V = {[q X q′] | q, q′ ∈ Q, X ∈ Γ} CFG n states p s.s.
|V | = n2p + 1 3
4
PDA2CFG PDAs CFGs P G CFLs
Introduction
4 Goldstine et. al.(1982): PDA2CFG is optimal
PDA2CFG PDAs CFGs P G CFLs
Introduction
Introduction
5
Introduction
5
Introduction
6
PDA2CFG is also optimal∗ in the unary case
Family P(n,k) n states p = 2n + k + 4 stack symbols Σ = {a}
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent CFG has Ω(n2(p − 2n − 4)) variables.
Lower bound 7
Set of actions of P(n,k):
(q0, a, S) ֒ → (q0, Xk r0) (qi, a, Xj) ֒ → (qi, Xj−1 rm si Xj−1 rm) ∀ i, m ∈ {0, . . . , n − 1}, ∀ j ∈ {1, . . . , k}, (qj, a, si) ֒ → (qi, ε) ∀i, j ∈ {0, . . . , n − 1}, (qi, a, ri) ֒ → (qi, ε) ∀i ∈ {0, . . . , n − 1}, (qi, a, X0) ֒ → (qi, Xk⋆) ∀i ∈ {0, . . . , n − 1}, (qi, a, X0) ֒ → (qi+1, Xk$) ∀i ∈ {0, . . . , n − 2}, (qi, a, ⋆) ֒ → (qi−1, ε) ∀i ∈ {1, . . . , n − 1}, (q0, a, $) ֒ → (qn−1, ε) (qn−1, a, X0) ֒ → (qn−1, ε)
PDA2CFG is also optimal∗ in the unary case
8
Properties of P(n,k): P has only one accepting run L(P) = {aℓ} with ℓ ≥ 2n2k
PDA2CFG is also optimal∗ in the unary case
9
PDA2CFG is also optimal∗ in the unary case
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent CFG has Ω(n2(p − 2n − 4)) variables.
10
Proof: Find G s.t.: L(G) = L(P) = {aℓ} with ℓ ≥ 2n2k.
PDA2CFG is also optimal∗ in the unary case
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent CFG has Ω(n2(p − 2n − 4)) variables.
10
Proof: Find G s.t.: L(G) = L(P) = {aℓ} with ℓ ≥ 2n2k. [Charikar et. al., 2005]: The smallest CFG that generates exactly one word of length ℓ has Ω(log(ℓ)) variables.
PDA2CFG is also optimal∗ in the unary case
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent CFG has Ω(n2(p − 2n − 4)) variables.
10
Proof: Find G s.t.: L(G) = L(P) = {aℓ} with ℓ ≥ 2n2k. [Charikar et. al., 2005]: The smallest CFG that generates exactly one word of length ℓ has Ω(log(ℓ)) variables. Then G has Ω(log(2n2k)) = Ω(n2k) variables.
PDA2CFG is also optimal∗ in the unary case
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent CFG has Ω(n2(p − 2n − 4)) variables.
10
Proof: Find G s.t.: L(G) = L(P) = {aℓ} with ℓ ≥ 2n2k. [Charikar et. al., 2005]: The smallest CFG that generates exactly one word of length ℓ has Ω(log(ℓ)) variables. Then G has Ω(log(2n2k)) = Ω(n2k) variables. As k = p − 2n − 4, G has Ω(n2(p − 2n − 4)) variables.
PDA2CFG is also optimal∗ in the unary case
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent CFG has Ω(n2(p − 2n − 4)) variables.
10
PDA2CFG is also optimal∗ in the unary case
P(n, k) Equivalent CFG Lower bound Upper bound Ω(n2k) O(n2(k + n)) 11
PDA2CFG is also optimal∗ in the unary case
P(n, k) Equivalent CFG Lower bound Upper bound Ω(n2k) O(n2(k + n))
Asymptotically tight if n ≤ Ck with C > 0
11
PDA2CFG is also optimal∗ in the unary case
PDA2CFG is optimal |Σ| > 1
|Σ| = 1
12
PDA2CFG is also optimal∗ in the unary case
PDA2CFG is optimal |Σ| > 1
|Σ| = 1
12
13
PDA2CFG PDAs CFGs P G CFLs
PDA2CFG PDAs CFGs P G CFLs
14
{abb, ab} {bab, ba}
15
P G PDAs CFGs CFLs
Parikh equivalence
Parikh-equivalent words Parikh-equivalent languages
{abb, ab}
16
abb bab {bab, ba}
Parikh equivalence
Parikh-equivalent words Parikh-equivalent languages
{abb, ab}
16
abb bab {bab, ba}
Parikh equivalence
Parikh-equivalent words Parikh-equivalent languages 16
abb ≈ bab {abb, ab} {bab, ba}
Parikh equivalence
Parikh-equivalent words Parikh-equivalent languages 16
abb ≈ bab {abb, ab} {bab, ba}
Idea: Find F such that: For all L ∈ F : every CFG G with L(G) ≈ L needs Ω(n2 p) variables
PDA2CFG
PDAs CFGs P G CFLs
PDA2CFG for Parikh equivalence
17
Idea: Find F such that: For all L ∈ F : every CFG G with L(G) ≈ L needs Ω(n2 p) variables
PDA2CFG
PDAs CFGs P G CFLs
PDA2CFG for Parikh equivalence
17
{abb, ab} {abb, ab}
18
{abb, ab} {abb, ab} L = L′ ⇒ L ≈ L′
18
{abb, ab} {abb, ab} L = L′ ⇒ L ≈ L′
18
{abb, ab} {abb, ab} L = L′ ⇒ L ≈ L′ ⇐
18
If |Σ| = 1 :
aaa
19
If |Σ| = 1 :
aaa aaa
19
If |Σ| = 1 :
aaa aaa {aaa, aa} {aaa, aa}
19
If |Σ| = 1 :
aaa aaa {aaa, aa} {aaa, aa}
If |Σ| = 1 :
L = L′ ⇐ ⇒ L ≈ L′
19
|Σ| = 1 Idea: Find F For all L ∈ F : every CFG G with L(G) ≈ L needs Ω(n2 p) variables
with |Σ| = 1
such that:
PDA2CFG
PDAs CFGs P G CFLs
20
|Σ| = 1 Idea: Find F For all L ∈ F : every CFG G with L(G) ≈ L needs Ω(n2 p) variables
with |Σ| = 1
such that:
PDA2CFG
PDAs CFGs P G CFLs P(n, k) is unary
20
PDA2CFG is optimal∗ for Parikh equivalence
PDA2CFG is optimal |Σ| > 1
|Σ| = 1
Parikh equivalence 21
PDAs
P
(FSAs)
F
2-step procedure for Parikh-equivalent FSA
Thm: Every CFL is Parikh-equivalent to some regular language
CFLs 22
Finite State Automata
P F Regular Languages
2-step procedure for Parikh-equivalent FSA
23
PDAs FSAs Thm: Every CFL is Parikh-equivalent to some regular language
Upper bound PDA
Parikh-equivalent
FSA
2-step procedure
2-step procedure for Parikh-equivalent FSA
24
Upper bound PDA
Parikh-equivalent
FSA
PDA2CFG procedure Equivalent
CFG
[Esparza et. al., 2011]
Procedure 2-step procedure
n states p s.s. O(n2p) variables
2-step procedure for Parikh-equivalent FSA 2-step procedure for Parikh-equivalent FSA 2-step procedure for Parikh-equivalent FSA
24
Upper bound PDA
Parikh-equivalent
FSA
PDA2CFG procedure Equivalent
CFG
[Esparza et. al., 2011]
Procedure 2-step procedure n
variables O(4n) states
2-step procedure for Parikh-equivalent FSA
24
Upper bound PDA
Parikh-equivalent
FSA
PDA2CFG procedure Equivalent
CFG
[Esparza et. al., 2011]
Procedure 2-step procedure
O(4n2p) states n states p s.s.
Thm: Given a PDA with n states and p s.s., there is a Parikh-equivalent FSA with O(4n2p) states.
2-step procedure for Parikh-equivalent FSA 2-step procedure for Parikh-equivalent FSA
24
Lower bound Using the family P(n, k) L(P) = {aℓ} with ℓ ≥ 2n2k q0 q1 qℓ a a a
Thm: There is a family of unary PDAs with n states and p stack symbols for which every equivalent FSA needs at least 2n2(p−2n−4) + 1 states.
2-step procedure for Parikh-equivalent FSA
25
P(n, k) Parikh-equivalent FSA Lower bound Upper bound Ω(2n2k) O(4n2(k+2n+4))
Asymptotically tight if n ≤ Ck with C > 0
2-step procedure for Parikh-equivalent FSA
26
Conclusions
PDA2CFG is also optimal in the unary case PDA2CFG is optimal for Parikh-equivalence
PDA2CFG-based procedure for Parikh-equivalent FSA is close to optimal
27
Conclusions
PDA2CFG is also optimal in the unary case PDA2CFG is optimal for Parikh-equivalence
PDA2CFG-based procedure for Parikh-equivalent FSA is close to optimal