Parikh Image of Pushdown Automata Elena Guti errez and Pierre Ganty - - PowerPoint PPT Presentation

parikh image of pushdown automata
SMART_READER_LITE
LIVE PREVIEW

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)


slide-1
SLIDE 1

Parikh Image of Pushdown Automata

Elena Guti´ errez and Pierre Ganty

slide-2
SLIDE 2

Pushdown Automata Context-free Grammars

Introduction

(PDAs) (CFGs) P G

L(P) = L(G)

1

Context-free Languages (CFLs)

slide-3
SLIDE 3

Pushdown Automata Context-free Grammars (PDAs) (CFGs)

2

P G Context-free Languages

Introduction

(CFLs)

slide-4
SLIDE 4

PDA2CFG Pushdown Automata Context-free Grammars (PDAs) (CFGs)

2

P G Context-free Languages

Introduction

(CFLs)

slide-5
SLIDE 5

PDAs and CFGs

q

X a b Z Pushdown Automata Context-free Grammar

S ⇒ aSa ⇒ abSba ⇒ . . . ⇒ abaaba

3

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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

slide-9
SLIDE 9

4

PDA2CFG PDAs CFGs P G CFLs

Introduction

slide-10
SLIDE 10

4 Goldstine et. al.(1982): PDA2CFG is optimal

PDA2CFG PDAs CFGs P G CFLs

Introduction

slide-11
SLIDE 11

Introduction

5

slide-12
SLIDE 12

Introduction

5

slide-13
SLIDE 13

Introduction

6

slide-14
SLIDE 14

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

slide-15
SLIDE 15

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

slide-16
SLIDE 16

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

slide-17
SLIDE 17

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

slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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

slide-21
SLIDE 21

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

slide-22
SLIDE 22

PDA2CFG is also optimal∗ in the unary case

P(n, k) Equivalent CFG Lower bound Upper bound Ω(n2k) O(n2(k + n)) 11

slide-23
SLIDE 23

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

slide-24
SLIDE 24

PDA2CFG is also optimal∗ in the unary case

PDA2CFG is optimal |Σ| > 1

|Σ| = 1

12

slide-25
SLIDE 25

PDA2CFG is also optimal∗ in the unary case

PDA2CFG is optimal |Σ| > 1

|Σ| = 1

12

slide-26
SLIDE 26

13

PDA2CFG PDAs CFGs P G CFLs

slide-27
SLIDE 27

PDA2CFG PDAs CFGs P G CFLs

14

slide-28
SLIDE 28

{abb, ab} {bab, ba}

15

P G PDAs CFGs CFLs

slide-29
SLIDE 29

Parikh equivalence

Parikh-equivalent words Parikh-equivalent languages

{abb, ab}

16

abb bab {bab, ba}

slide-30
SLIDE 30

Parikh equivalence

Parikh-equivalent words Parikh-equivalent languages

{abb, ab}

16

abb bab {bab, ba}

slide-31
SLIDE 31

Parikh equivalence

Parikh-equivalent words Parikh-equivalent languages 16

abb ≈ bab {abb, ab} {bab, ba}

slide-32
SLIDE 32

Parikh equivalence

Parikh-equivalent words Parikh-equivalent languages 16

abb ≈ bab {abb, ab} {bab, ba}

slide-33
SLIDE 33

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

slide-34
SLIDE 34

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

slide-35
SLIDE 35

{abb, ab} {abb, ab}

18

slide-36
SLIDE 36

{abb, ab} {abb, ab} L = L′ ⇒ L ≈ L′

18

slide-37
SLIDE 37

{abb, ab} {abb, ab} L = L′ ⇒ L ≈ L′

18

slide-38
SLIDE 38

{abb, ab} {abb, ab} L = L′ ⇒ L ≈ L′ ⇐

18

slide-39
SLIDE 39

If |Σ| = 1 :

aaa

19

slide-40
SLIDE 40

If |Σ| = 1 :

aaa aaa

19

slide-41
SLIDE 41

If |Σ| = 1 :

aaa aaa {aaa, aa} {aaa, aa}

19

slide-42
SLIDE 42

If |Σ| = 1 :

aaa aaa {aaa, aa} {aaa, aa}

If |Σ| = 1 :

L = L′ ⇐ ⇒ L ≈ L′

19

slide-43
SLIDE 43

|Σ| = 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

slide-44
SLIDE 44

|Σ| = 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

slide-45
SLIDE 45

PDA2CFG is optimal∗ for Parikh equivalence

PDA2CFG is optimal |Σ| > 1

|Σ| = 1

Parikh equivalence 21

slide-46
SLIDE 46

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

slide-47
SLIDE 47

P F Regular Languages

2-step procedure for Parikh-equivalent FSA

23

PDAs FSAs Thm: Every CFL is Parikh-equivalent to some regular language

slide-48
SLIDE 48

Upper bound PDA

Parikh-equivalent

FSA

2-step procedure

2-step procedure for Parikh-equivalent FSA

24

slide-49
SLIDE 49

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

slide-50
SLIDE 50

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

slide-51
SLIDE 51

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

slide-52
SLIDE 52

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

slide-53
SLIDE 53

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

slide-54
SLIDE 54

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

slide-55
SLIDE 55

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

Thank you!