CFL - Pushdown Automata Flashcards

1
Q

When is a word accepted by a PDA?

A

When it has been read, stack is empty, and automaton is in a final state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the main theorem?

A

Class of languages accepted by pushdown automata
is exactly the class of Context-free languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a PDA?

A

A sextuple
M = (K, Σ, Γ, ∆, s, F), where:
K is a finite set of states
Σ as an alphabet of input symbols
Γ as an alphabet of stack symbols
s ∈ K is the initial state
F ⊆ K is the set of final states
∆ is a transition relation, a finite set, and may not be a function as a PDA is nondeterministic
∆ ⊆
(K × Σ∗ × Γ∗) × (K × Γ∗)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a configuration?

A

Any tuple:
(q, w, γ) ∈ K × Σ∗ × Γ∗
q ∈ K represents a current state of M, and w ∈ Σ∗ is
unread part of the input,
and γ is a content of the stack
read top-down

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a transition relation?

A

acts between two configurations
and hence |- M is a certain binary relation
defined on K × Σ∗ × Γ∗
|-M ⊆ (K × Σ∗ × Γ∗)^2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Given a PDA, a binary relation is a transition relation iff:

A

For any p, q ∈ K,
u, x ∈ Σ∗,
α, β, γ
(p, ux, βα) |-M
(q, x, γα)
iff
((p, u, β), (q, γ)) ∈ ∆

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define the language L(M)

A

L(M) = {w ∈ Σ∗ :
(s, w, e) |-M∗ (p, e, e) for certain p ∈ F}

M accepts w ∈ Σ∗
iff. w ∈ L(M)

M accepts w ∈ Σ∗
iff computation
in M such that it starts with w and with empty stack ((s, w, e))
and it ends in a final state after reading w and emptying all
of the stack
((p, e, e) for certain p ∈ F )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

PDA-FA Theorem

A

The class FA of finite automata is a proper subset of the
class PDA of pushdown automata, i.e.
FA ⊂ PDA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Proof of PDA-FA Theorem

A

Show that every FA automaton is a PDA automaton that operates on an empty stack (Slide 20, Lecture 10)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Show the transition for “Push a”

A

((p, u, e), (q, a))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Show the transition for “Pop a”

A

((p, u, a), (q, e))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Show the transition for “Compare and pop a”

A

((p, a, a), (q, e))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Show the transition for “Compare a with b and pop b”

A

((p, a, b), (q, e))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does
((p, u, B)), (q, r)) ∈ Δ mean?

A

M in state p:
1) reads u
2) replaces B with r at the top of the stack
3) goes to the state q

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Lemma 1 of PDA main theorem

A

Each CFL is accepted by some PD automaton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Lemma 2 of PDA main theorem

A

If a language is accepted by a PDA, it is a CFL

17
Q

What 2 views does the PDA Main Theorem prove the equivalency of?

A

2 views of CFL 1. A language L is CF if it is generated by a CFG (defn.)
2. A language L is CF if it is accepted by a PDA.

18
Q

Closure Theorems of CFL

A

Closure Theorem 1
The context-free languages are closed under union,
concatenation, and Kleene star

Closure Theorem 2
The intersection of a context-free language with a regular
language is a context-free language

Closure Theorem 3
The context-free languages are not closed under
intersection and complementation

19
Q

Not Context-free Languages theorem 4:

A

By the pumping lemma, the following are not CF:
L1 = {a^ib^ja^ib^j:
i, j ≥ 0}
L2 = {a^p : p is prime}
L3 = {a^(n^2) : n ≥ 0}
L4 = {www : w∈{a,b}*}

20
Q

Parikh Theorem

A

Used because: some very simple non-context-free
languages which cannot be shown not to be context-free by
a direct application of the Pumping Lemma

If Ψ(L) is not semilinear, then L is not context-free

21
Q

Theorem 6 using Parikh Theorem

A

Every CFL over a 1 symbol alphabet
is regular

22
Q

L = {w ∈ {a, b}∗
: w has the same number of a’s and b’s }

A

Proved CFL by constructing a PDA
and applying the Main Theorem

23
Q

L = {w ∈ {a, b, c}∗
: w has the same number of a’s, b’s and c’s }

L = {a^pb^n
: p ∈ Prime, n > p}

A

Proved NOT CFL by PL