Example 2.16 I { a i b j c k | i = j or i = k } Idea: push a i into - - PowerPoint PPT Presentation

example 2 16 i
SMART_READER_LITE
LIVE PREVIEW

Example 2.16 I { a i b j c k | i = j or i = k } Idea: push a i into - - PowerPoint PPT Presentation

Example 2.16 I { a i b j c k | i = j or i = k } Idea: push a i into stack But should we check b or c ? Need nondeterminism Pushdown automata may be nondeterministic October 8, 2020 1 / 7 Example 2.16 II Recall was defined as Q


slide-1
SLIDE 1

Example 2.16 I

{aibjck | i = j or i = k} Idea: push ai into stack But should we check b or c ? Need nondeterminism Pushdown automata may be nondeterministic

October 8, 2020 1 / 7

slide-2
SLIDE 2

Example 2.16 II

Recall δ was defined as Q × Σǫ × Γǫ → P(Q × Γǫ) We see the power set P(Q × Γǫ) Fig 2.17 The upper part checks if i = j The lower part checks if i = k

October 8, 2020 2 / 7

slide-3
SLIDE 3

Example 2.16 III

q1 q2 q3 q4 q5 q6 q7 ǫ, ǫ → $ a, ǫ → a ǫ, ǫ → ǫ ǫ, ǫ → ǫ b, a → ǫ ǫ, $ → ǫ c, ǫ → ǫ b, ǫ → ǫ ǫ, ǫ → ǫ c, a → ǫ ǫ, $ → ǫ

nondeterminism: q → q or q → q

October 8, 2020 3 / 7

slide-4
SLIDE 4

Running a PDA I

Input a2bc2 The way is similar to how we run an NFA

October 8, 2020 4 / 7

slide-5
SLIDE 5

Running a PDA II

q1∅ q2{$}q3{$} q4∅ q5{$}q6{$} q7∅ q2{a, $} q2{a, a, $} q3{a, a, $} q3{a, $} q5{a, a, $} q5{a, a, $} q6{a, a, $} q6{a, $} q6{$} q7∅ q6{a, a, $} q3{a, $} q5{a, $} q6{a, $} a a b c c

October 8, 2020 5 / 7

slide-6
SLIDE 6

Example 2.18 I

{ww R | w ∈ {0, 1}∗} w R: reverse Approach: symbols pushed to stack nondeterministically guess middle is reached fig 2.19

October 8, 2020 6 / 7

slide-7
SLIDE 7

Example 2.18 II

q1 q2 q3 q4 ǫ, ǫ → $ 0, ǫ → 0 1, ǫ → 1 ǫ, ǫ → ǫ 0, 0 → ǫ 1, 1 → ǫ ǫ, $ → ǫ

October 8, 2020 7 / 7