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