SlideShare a Scribd company logo
1
PUSH DOWN AUTOMATA
2
Pushdown Automata (PDA)
• Informally:
– A PDA is an NFA-ε with a stack.
– Transitions are modified to accommodate stack operations.
• Questions:
– What is a stack?
– How does a stack help?
• A DFA can “remember” only a finite amount of information, whereas a PDA can
“remember” an infinite amount of (certain types of) information, in one memory-stack
3
• Example:
{0n1n | 0=<n}
is not regular, but
{0n1n | 0≤n≤k, for some fixed k} is regular, for any
fixed k.
• For k=3:
L = {ε, 01, 0011, 000111}
0/1
q
0
q
7
0 q
1
1
1
q
2
1
q
5
0 q
3
1
1
q
4
0
1
0
0
0/1
q
6
0
4
• In a DFA, each state remembers a finite amount of information.
• To get {0n1n | 0≤n} with a DFA would require an infinite number of states
using the preceding technique.
• An infinite stack solves the problem for {0n1n | 0≤n} as follows:
– Read all 0’s and place them on a stack
– Read all 1’s and match with the corresponding 0’s on the stack
• Only need two states to do this in a PDA
• Similarly for {0n1m0n+m | n,m≥0}
Push down Automata
5
6
Formal Definition of a PDA
• A pushdown automaton (PDA) is a seven-tuple:
M = (Q, Σ, Г, δ, q0, z0, F)
Q A finite set of states
Σ A finite input alphabet
Г A finite stack alphabet
q0 The initial/starting state, q0 is in Q
z0 A starting stack symbol, is in Г // need not always remain at the bottom of stack
F A set of final/accepting states, which is a subset of Q
δ A transition function, where
δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г*
7
• Consider the various parts of δ:
Q x (Σ U {ε}) x Г –> finite subsets of Q x Г*
– Q on the LHS means that at each step in a computation, a PDA must consider its’
current state.
– Г on the LHS means that at each step in a computation, a PDA must consider the
symbol on top of its’ stack.
– Σ U {ε} on the LHS means that at each step in a computation, a PDA may or may
not consider the current input symbol, i.e., it may have epsilon transitions.
– “Finite subsets” on the RHS means that at each step in a computation, a PDA may
have several options.
– Q on the RHS means that each option specifies a new state.
– Г* on the RHS means that each option specifies zero or more stack symbols that
will replace the top stack symbol, but in a specific sequence.
8
• PDA transitions:
δ(q, a, z) = {(p1,γ1), (p2,γ2),…, (pm,γm)}
– Current state is q
– Current input symbol is a
– Symbol currently on top of the stack z
– Move to state pi from q
– Replace z with γi on the stack (leftmost symbol on top)
– Move the input head to the next input symbol
:
q
p
1
p
2
p
m
a/z/ γ1
a/z/ γ2
a/z/ γm
9
• Two types of PDA transitions:
δ(q, ε, z) = {(p1,γ1), (p2,γ2),…, (pm,γm)}
– Current state is q
– Current input symbol is not considered
– Symbol currently on top of the stack z
– Move to state pi from q
– Replace z with γi on the stack (leftmost symbol on top)
– No input symbol is read
:
q
p
1
p
2
p
m
ε/z/ γ1
ε/z/ γ2
ε/z/ γm
PDA - OPERATIONS
10
POP
PUSH
Skip /
Do nothing
Construct a PDA
• Language: 0n1n, n>=0
• Transition function
δ(q0, 0, z) = {(q0, 0z)}
δ(q0, 0,00) = {(q0, 00)}
δ(q0, 1, 0) = {(q1, λ)}
δ(q1, 1, 0) = (q1, λ)}
δ(q1, λ, Z) = {(q2, λ)}
11
Instantaneous description (ID): 0011
(q0, 0 011 λ, z ) push
|- (q0, 0 11 λ, 0z) push
|- (q0, 1 1 λ, 00z) pop
|- (q1, 1 λ, 0z ) pop
|- (q1, λ, z) no -operation
|- (q2, λ, z): accept (q2 final state)
Instantaneous description (ID): 011
(q0, 0 11, z) push
|- (q0, 1 1, 0z) pop
|- (q1, 1, z ) no rule – halt at q1
reject
PDA Construction
Problem 2 : L = = {0n c 1n | n ≥ 1}
12
PDA Construction
Problem 3 : L= { a m b n c n | m, n ≥ 0} -
empy stack PDA
13
PDA Construction
14
Problem 4 : L = { wcwR | w = (0+1)* }
PDA Construction
15
Problem 5: A = { w ∈ {0, 1} ∗ | w contains at least three 1s }
L={an b3n | n>=1 }
16
Exercise
• Construct PDA for acceptance by empty stack.
1. L={a2n bn | n>=0 }
1. L = {0n1n2m3m | n>=1, m>=1}
2. L={0n1m0n | m, n>=1}.
3. L= { a i b j c k | i, j, k ≥ 0 and i + j = k }
• Construct PDA for acceptance by Final state
1. L = { a n b n c m | m, n ≥ 1 }
1. L = {0n1m2m3n | n>=1, m>=1}
2. L={an b2n | n>=0 }
– L={an b3n | n>=1 }
1. L={a3n bn | n>=0 }
17
18
• Definition: Let M = (Q, Σ, Г, δ, q0, z0, F) be a PDA. The language
accepted by empty stack, denoted LE(M), is the set
LE(M) = {w | (q0, w, z0) |—* (p, ε, ε) for some
p in Q}
• Definition: Let M = (Q, Σ, Г, δ, q0, z0, F) be a PDA. The language
accepted by final state, denoted LF(M), is the set
LE(M)= {w | (q0, w, z0) |—* (p, ε, γ) for some p in F and γ in
Г*}
• Definition: Let M = (Q, Σ, Г, δ, q0, z0, F) be a PDA. The language
accepted by empty stack and final state, denoted L(M), is the set
LE(M)= {w | (q0, w, z0) |—* (p, ε, ε) for some p in F}
Language Acceptance
Equivalence of CFG and PDA
19
CFG to PDA
20
Problem 1: CFG - PDA
Convert the grammar S-> aAA, A->aS/bS/a to a PDA that accepts the same language
by empty stack
Solution :
Let G be a CFG and G=(V,T,P,S) where V={S,A} T={a,b}
p: S->aAA, A->aS/bS/a.
To find the equivalent PDA
Q={q0}
∑=T={a,b}
Г=VUT={S,A,a,b}
F=Ø
Transition function for PDA:
– For each variable S,A
δ(q0,Є,S)={(q0,aAA)}
δ(q0,Є,A)={(q0,aS),(q0,bS),(q0,a)}
For each terminal a,b
δ(q0,a,a)={q0,Є}
δ(0,b,b)={q0,Є}
21
Problem 2: CFG - PDA
• Convert the grammar S-> 0S1/A, A->1A0/S/є to a PDA that accepts the same language by
empty stack.
Solution :
Let G be a CFG and G=(V,T,P,S) where V={S,A} T={a,b}
p: S->aAA, A->aS/bS/a.
To find the equivalent PDA
Q={q0}
∑=T={0,1}
Г=VUT={S,A,0,1}
F=Ø
Transition function for PDA:
– For each variable S,A
δ(q0,Є,S)={(q0,0S1), (q0,A)}
δ(q0,Є,A)={(q0,1A0),(q0,S),(q0, Є)}
For each terminal 0,1
δ(q0,0,0)={q0,Є}
δ(q0,1,1)={q0,Є}
22
Problem 3: CFG – PDA
Construct PDA for the given CFG, and test whether 0104 is acceptable by this PDA.
S → 0BB B → 0S | 1S | 0
23
Solution:
The PDA can be given as:
1.A = {(q), (0, 1), (S, B, 0, 1), δ, q, S, ?}
The production rule δ can be:
R1: δ(q, ε, S) = {(q, 0BB)}
R2: δ(q, ε, B) = {(q, 0S) | (q, 1S) | (q, 0)}
R3: δ(q, 0, 0) = {(q, ε)}
R4: δ(q, 1, 1) = {(q, ε)}
Testing 0104 i.e. 010000 against PDA:
δ(q, 010000, S) ⊢ δ(q, 010000, 0BB)
⊢ δ(q, 10000, BB) R1
⊢ δ(q, 10000,1SB) R3
⊢ δ(q, 0000, SB) R2
⊢ δ(q, 0000, 0BBB) R1
⊢ δ(q, 000, BBB) R3
⊢ δ(q, 000, 0BB) R2
⊢ δ(q, 00, BB) R3
⊢ δ(q, 00, 0B) R2
⊢ δ(q, 0, B) R3
⊢ δ(q, 0, 0) R2
⊢ δ(q, ε) R3
ACCEPT
Thus 0104 is accepted by the PDA.
24
CFG to PDA conversion
Formally, the given PDA is
M = (Q, Σ, Г, δ, q0, z0, F). Define CFG G=(V,
T, P, S), where
V=[p x q] for all p & q Є Q and x Є Σ,
T= Σ,
P=Set of Production rules constructed from δ
And S=Starting Symbol
Rules to construct P using δ
R1 – Production Rules for S
S 🡪 [q0 z0 p] for all p Є Q
R2 – Production Rules corresponding to the
transition move for pop operation
(q, a, z) = (p, ϵ)
[q z p] 🡪a
Cont…
R3 - Production Rules corresponding to the
transition move for push and read operation
(q, a, z) = (q’, z1z2…….zn)
[q z p] 🡪 a [q’ z1 q1] [q1 z2 q2] ………[qn zn p]
Convert the following PDA in to a CFG
27
Example 1
28
Rule 1 Rule 2
Rule 3
Cont…
29
Cont…
30
Example 2 PDA TO CFG
31
Consider the given PDA and convert it to pda
δ(p,0,z)=(p,A)
δ(0,0,a)=(p,AA)
δ (p,1,A)=(q, λ)
δ (q,1,A)=(q, λ)
Solution:
EQUIVELANCE OF CFG AND
PDA
32
Final State to Empty Stack PDA
33
(p0, w,X0) |- (q0, w, Z0X0) |-* (q, ε , αX0) |- ( p, ε ,ε )
Example : Design a PDA to check for well-formed parentheses
Empty Stack to Final State PDA
34
(p0, w,X0) |- (q0, w, Z0X0) |-* (q, ε , X0) |- ( pf, ε ,ε )
Example : Design a PDA to check for well-formed parentheses
Deterministic Pushdown automata
DPDA- definition
35
Example - DPDA
36
Is Npda more powerful
than DPDA?
• Power of NPDA is more than DPDA. It is
not possible to convert every NPDA to
corresponding DPDA. ... The languages
accepted by DPDA are called DCFL
(Deterministic Context Free Languages)
which are subset of NCFL (Non
Deterministic CFL) accepted by NPDA
37
Difference between DPDA and
NDPA
38
Closure Properties of Context
Free Grammar
Context-free languages are closed under −
•Union- If L1 and L2 are CFL’s then L1ꓴL2 is
also CFL.
•Concatenation- If L1 and L2 are CFL’s then
L1L2 is also CFL.
•Kleene Star- If L1 is CFL then L*1 is also
CFL.
Closure under Union
• Begin with two grammars: G1 = (V1, Σ , P1, S1) and G2
= (V2, Σ , P2, S2), generating CFL’s L1 and L2
respectively.
• The new CFG Gx is made as:
– Σ remains the same
– Sx is the new start variable
– Vx = V1 ∪ V2 ∪ {Sx}
– Px = P1 ∪ P2 ∪ {Sx → S1|S2}
• Explanation: All we have done is augment the variable
set with a new start state and then allowed the new start
state to map to either of the two grammars. So, we’ll
generate strings from either L1 or L2, i.e. L1 ꓴ L2
Example
• Let L1 = { anbn , n > 0}. Corresponding
grammar G1 will have P: S1 → aAb|ab
• Let L2 = { cmdm , m ≥ 0}. Corresponding
grammar G2 will have P: S2 → cBb| ε
• Union of L1 and L2, L = L1 ∪ L2 = { anbn } ∪
{ cmdm }
• The corresponding grammar G will have the
additional production S → S1 | S2
Closure under Concatenation
• Begin with two grammars: G1 = (V1, Σ , P1, S1) and G2 =
(V2, Σ , P2, S2), generating CFL’s L1 and L2 respectively.
• The new CFG Gy is made as:
– Σ remains the same
– Sy is the new start variable
– Vy = V1 ꓴ V2 ꓴ {Sy}
– Py = P1 ꓴ P2 ꓴ {Sx → S1S2}
• Explanation: Again, all we have done is to augment the
variable set with a new start state, and then allowed the
new start state to map to the concatenation of the two
original start symbols. So, we will generate strings that
begin with strings from L1 and end with strings from L2,
i.e. L1L2 .
Example
• Let L1 = { anbn , n > 0}. Corresponding
grammar G1 will have P: S1 → aAb|ab
• Let L2 = { cmdm , m ≥ 0}. Corresponding
grammar G2 will have P: S2 → cBb| ε
• Concatenation of the languages L1 and L2, L =
L1L2 = { anbncmdm }
• The corresponding grammar G will have the
additional production S → S1 S2
Clouser under Kleene Star
• Begin with two grammars: G1 = (V1, Σ , P1, S1) and
G2 = (V2, Σ , P2, S2), generating CFL’s L1 and L2
respectively.
• The new CFG Gz is made as:
– Σ remains the same
– Sz is the new start variable
– Vz = V1 ꓴ {Sz}
– Pz = P1 ꓴ {Sz → S1Sz | ε}
• Explanation: Again we have augmented the variable
set with a new start state, and then allowed the new
start state to map to either S1Sz or ε. This means we
can generate strings with zero or more strings made
from expanding the variable S1, i.e. L*1 .
Example
• Let L = { anbn , n ≥ 0}. Corresponding
grammar G will have P: S → aAb| ε
• Kleene Star L1 = { anbn }*
• The corresponding grammar G1 will have
additional productions S1 → SS1 | ε
Context-free languages are not closed under −
•Intersection − If L1 and L2 are context free
languages, then L1 ∩ L2 is not necessarily
context free.
•Intersection with Regular Language − If L1 is a
regular language and L2 is a context free
language, then L1 ∩ L2 is a context free
language.
•Complement − If L1 is a context free language,
then L1’ may not be context free.
Ad

More Related Content

What's hot (20)

POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
Rajendran
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Rajendran
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
Deepjyoti Kalita
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
Rajendran
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
Mohammad Ilyas Malik
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
Tech_MX
 
Post Machine
Post MachinePost Machine
Post Machine
Saira Fazal Qader
 
Automata theory
Automata theoryAutomata theory
Automata theory
Pardeep Vats
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
Chomsky Normal Form
Chomsky Normal FormChomsky Normal Form
Chomsky Normal Form
Jasmine Peniel
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
InteX Research Lab
 
Code generation
Code generationCode generation
Code generation
Aparna Nayak
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets
Sampath Kumar S
 
NFA to DFA
NFA to DFANFA to DFA
NFA to DFA
Animesh Chaturvedi
 
Bottom up parser
Bottom up parserBottom up parser
Bottom up parser
Akshaya Arunan
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
Abhishek Singh
 
Types of grammer - TOC
Types of grammer - TOCTypes of grammer - TOC
Types of grammer - TOC
AbhayDhupar
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformation
Ankit Garg
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
Rajendran
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Rajendran
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
Rajendran
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
Tech_MX
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets
Sampath Kumar S
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
Abhishek Singh
 
Types of grammer - TOC
Types of grammer - TOCTypes of grammer - TOC
Types of grammer - TOC
AbhayDhupar
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformation
Ankit Garg
 

Similar to Automata theory - Push Down Automata (PDA) (20)

Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.pptFiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
AdharshKumarSingh
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
Finite automata
Finite automataFinite automata
Finite automata
Rajesh Yaramadi
 
Turing Machine push down automata-examples
Turing Machine push down automata-examplesTuring Machine push down automata-examples
Turing Machine push down automata-examples
ssuserc64fd9
 
PDA (1) (1).pptx
PDA (1) (1).pptxPDA (1) (1).pptx
PDA (1) (1).pptx
nandan543979
 
Unit 2 Pumping lemma Unit 2 Pumping lemma
Unit 2 Pumping lemma Unit 2 Pumping lemmaUnit 2 Pumping lemma Unit 2 Pumping lemma
Unit 2 Pumping lemma Unit 2 Pumping lemma
AnshTripathi38
 
16 PDA push down autometa push down.pptx
16 PDA push down autometa push down.pptx16 PDA push down autometa push down.pptx
16 PDA push down autometa push down.pptx
nandan543979
 
AUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptx
AUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptxAUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptx
AUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptx
ArjayBalberan1
 
Pda
PdaPda
Pda
Self-employed
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
shruti533256
 
Dfa
DfaDfa
Dfa
azamcse29
 
PushdownAutomata and Turing machines ppt
PushdownAutomata and Turing machines pptPushdownAutomata and Turing machines ppt
PushdownAutomata and Turing machines ppt
latha2009
 
2. context free langauages
2. context free langauages2. context free langauages
2. context free langauages
danhumble
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
parmeet834
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
eugenesri
 
Push down automata
Push down automataPush down automata
Push down automata
Ratnakar Mikkili
 
PushdownAutomata.ppt
PushdownAutomata.pptPushdownAutomata.ppt
PushdownAutomata.ppt
RSRS39
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.pptFiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
AdharshKumarSingh
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
Turing Machine push down automata-examples
Turing Machine push down automata-examplesTuring Machine push down automata-examples
Turing Machine push down automata-examples
ssuserc64fd9
 
Unit 2 Pumping lemma Unit 2 Pumping lemma
Unit 2 Pumping lemma Unit 2 Pumping lemmaUnit 2 Pumping lemma Unit 2 Pumping lemma
Unit 2 Pumping lemma Unit 2 Pumping lemma
AnshTripathi38
 
16 PDA push down autometa push down.pptx
16 PDA push down autometa push down.pptx16 PDA push down autometa push down.pptx
16 PDA push down autometa push down.pptx
nandan543979
 
AUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptx
AUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptxAUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptx
AUTOMATA AUTOMATA AUTOMATAAutomata7Chapter6.pptx
ArjayBalberan1
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
shruti533256
 
PushdownAutomata and Turing machines ppt
PushdownAutomata and Turing machines pptPushdownAutomata and Turing machines ppt
PushdownAutomata and Turing machines ppt
latha2009
 
2. context free langauages
2. context free langauages2. context free langauages
2. context free langauages
danhumble
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
parmeet834
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
eugenesri
 
PushdownAutomata.ppt
PushdownAutomata.pptPushdownAutomata.ppt
PushdownAutomata.ppt
RSRS39
 
Ad

More from Akila Krishnamoorthy (11)

Automata theory - RE to DFA Conversion
Automata theory - RE to DFA ConversionAutomata theory - RE to DFA Conversion
Automata theory - RE to DFA Conversion
Akila Krishnamoorthy
 
Automata theory -RE to NFA-ε
Automata theory -RE to  NFA-εAutomata theory -RE to  NFA-ε
Automata theory -RE to NFA-ε
Akila Krishnamoorthy
 
Automata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA ConversionAutomata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA Conversion
Akila Krishnamoorthy
 
Automata theory - NFA to DFA Conversion
Automata theory - NFA to DFA ConversionAutomata theory - NFA to DFA Conversion
Automata theory - NFA to DFA Conversion
Akila Krishnamoorthy
 
Automata theory -- NFA and DFA construction
Automata theory -- NFA and DFA  constructionAutomata theory -- NFA and DFA  construction
Automata theory -- NFA and DFA construction
Akila Krishnamoorthy
 
Intro to automata theory
Intro to automata theoryIntro to automata theory
Intro to automata theory
Akila Krishnamoorthy
 
Automata theory -Conversion of ε nfa to nfa
Automata theory -Conversion of ε nfa to nfaAutomata theory -Conversion of ε nfa to nfa
Automata theory -Conversion of ε nfa to nfa
Akila Krishnamoorthy
 
Slr parser
Slr parserSlr parser
Slr parser
Akila Krishnamoorthy
 
CLR AND LALR PARSER
CLR AND LALR PARSERCLR AND LALR PARSER
CLR AND LALR PARSER
Akila Krishnamoorthy
 
Linear data structure concepts
Linear data structure conceptsLinear data structure concepts
Linear data structure concepts
Akila Krishnamoorthy
 
Keypoints c strings
Keypoints   c stringsKeypoints   c strings
Keypoints c strings
Akila Krishnamoorthy
 
Ad

Recently uploaded (20)

Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
Deepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber ThreatsDeepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber Threats
RaviKumar256934
 
David Boutry - Specializes In AWS, Microservices And Python
David Boutry - Specializes In AWS, Microservices And PythonDavid Boutry - Specializes In AWS, Microservices And Python
David Boutry - Specializes In AWS, Microservices And Python
David Boutry
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Construction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.pptConstruction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.ppt
ssuser2ffcbc
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Optimizing Reinforced Concrete Cantilever Retaining Walls Using Gases Brownia...
Optimizing Reinforced Concrete Cantilever Retaining Walls Using Gases Brownia...Optimizing Reinforced Concrete Cantilever Retaining Walls Using Gases Brownia...
Optimizing Reinforced Concrete Cantilever Retaining Walls Using Gases Brownia...
Journal of Soft Computing in Civil Engineering
 
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
Guru Nanak Technical Institutions
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
SanjeetMishra29
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
Deepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber ThreatsDeepfake Phishing: A New Frontier in Cyber Threats
Deepfake Phishing: A New Frontier in Cyber Threats
RaviKumar256934
 
David Boutry - Specializes In AWS, Microservices And Python
David Boutry - Specializes In AWS, Microservices And PythonDavid Boutry - Specializes In AWS, Microservices And Python
David Boutry - Specializes In AWS, Microservices And Python
David Boutry
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Construction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.pptConstruction-Chemicals-For-Waterproofing.ppt
Construction-Chemicals-For-Waterproofing.ppt
ssuser2ffcbc
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdfLittle Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
Little Known Ways To 3 Best sites to Buy Linkedin Accounts.pdf
gori42199
 
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
🚀 TDX Bengaluru 2025 Unwrapped: Key Highlights, Innovations & Trailblazer Tak...
SanjeetMishra29
 

Automata theory - Push Down Automata (PDA)

  • 2. 2 Pushdown Automata (PDA) • Informally: – A PDA is an NFA-ε with a stack. – Transitions are modified to accommodate stack operations. • Questions: – What is a stack? – How does a stack help? • A DFA can “remember” only a finite amount of information, whereas a PDA can “remember” an infinite amount of (certain types of) information, in one memory-stack
  • 3. 3 • Example: {0n1n | 0=<n} is not regular, but {0n1n | 0≤n≤k, for some fixed k} is regular, for any fixed k. • For k=3: L = {ε, 01, 0011, 000111} 0/1 q 0 q 7 0 q 1 1 1 q 2 1 q 5 0 q 3 1 1 q 4 0 1 0 0 0/1 q 6 0
  • 4. 4 • In a DFA, each state remembers a finite amount of information. • To get {0n1n | 0≤n} with a DFA would require an infinite number of states using the preceding technique. • An infinite stack solves the problem for {0n1n | 0≤n} as follows: – Read all 0’s and place them on a stack – Read all 1’s and match with the corresponding 0’s on the stack • Only need two states to do this in a PDA • Similarly for {0n1m0n+m | n,m≥0}
  • 6. 6 Formal Definition of a PDA • A pushdown automaton (PDA) is a seven-tuple: M = (Q, Σ, Г, δ, q0, z0, F) Q A finite set of states Σ A finite input alphabet Г A finite stack alphabet q0 The initial/starting state, q0 is in Q z0 A starting stack symbol, is in Г // need not always remain at the bottom of stack F A set of final/accepting states, which is a subset of Q δ A transition function, where δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г*
  • 7. 7 • Consider the various parts of δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г* – Q on the LHS means that at each step in a computation, a PDA must consider its’ current state. – Г on the LHS means that at each step in a computation, a PDA must consider the symbol on top of its’ stack. – Σ U {ε} on the LHS means that at each step in a computation, a PDA may or may not consider the current input symbol, i.e., it may have epsilon transitions. – “Finite subsets” on the RHS means that at each step in a computation, a PDA may have several options. – Q on the RHS means that each option specifies a new state. – Г* on the RHS means that each option specifies zero or more stack symbols that will replace the top stack symbol, but in a specific sequence.
  • 8. 8 • PDA transitions: δ(q, a, z) = {(p1,γ1), (p2,γ2),…, (pm,γm)} – Current state is q – Current input symbol is a – Symbol currently on top of the stack z – Move to state pi from q – Replace z with γi on the stack (leftmost symbol on top) – Move the input head to the next input symbol : q p 1 p 2 p m a/z/ γ1 a/z/ γ2 a/z/ γm
  • 9. 9 • Two types of PDA transitions: δ(q, ε, z) = {(p1,γ1), (p2,γ2),…, (pm,γm)} – Current state is q – Current input symbol is not considered – Symbol currently on top of the stack z – Move to state pi from q – Replace z with γi on the stack (leftmost symbol on top) – No input symbol is read : q p 1 p 2 p m ε/z/ γ1 ε/z/ γ2 ε/z/ γm
  • 11. Construct a PDA • Language: 0n1n, n>=0 • Transition function δ(q0, 0, z) = {(q0, 0z)} δ(q0, 0,00) = {(q0, 00)} δ(q0, 1, 0) = {(q1, λ)} δ(q1, 1, 0) = (q1, λ)} δ(q1, λ, Z) = {(q2, λ)} 11 Instantaneous description (ID): 0011 (q0, 0 011 λ, z ) push |- (q0, 0 11 λ, 0z) push |- (q0, 1 1 λ, 00z) pop |- (q1, 1 λ, 0z ) pop |- (q1, λ, z) no -operation |- (q2, λ, z): accept (q2 final state) Instantaneous description (ID): 011 (q0, 0 11, z) push |- (q0, 1 1, 0z) pop |- (q1, 1, z ) no rule – halt at q1 reject
  • 12. PDA Construction Problem 2 : L = = {0n c 1n | n ≥ 1} 12
  • 13. PDA Construction Problem 3 : L= { a m b n c n | m, n ≥ 0} - empy stack PDA 13
  • 14. PDA Construction 14 Problem 4 : L = { wcwR | w = (0+1)* }
  • 15. PDA Construction 15 Problem 5: A = { w ∈ {0, 1} ∗ | w contains at least three 1s }
  • 16. L={an b3n | n>=1 } 16
  • 17. Exercise • Construct PDA for acceptance by empty stack. 1. L={a2n bn | n>=0 } 1. L = {0n1n2m3m | n>=1, m>=1} 2. L={0n1m0n | m, n>=1}. 3. L= { a i b j c k | i, j, k ≥ 0 and i + j = k } • Construct PDA for acceptance by Final state 1. L = { a n b n c m | m, n ≥ 1 } 1. L = {0n1m2m3n | n>=1, m>=1} 2. L={an b2n | n>=0 } – L={an b3n | n>=1 } 1. L={a3n bn | n>=0 } 17
  • 18. 18 • Definition: Let M = (Q, Σ, Г, δ, q0, z0, F) be a PDA. The language accepted by empty stack, denoted LE(M), is the set LE(M) = {w | (q0, w, z0) |—* (p, ε, ε) for some p in Q} • Definition: Let M = (Q, Σ, Г, δ, q0, z0, F) be a PDA. The language accepted by final state, denoted LF(M), is the set LE(M)= {w | (q0, w, z0) |—* (p, ε, γ) for some p in F and γ in Г*} • Definition: Let M = (Q, Σ, Г, δ, q0, z0, F) be a PDA. The language accepted by empty stack and final state, denoted L(M), is the set LE(M)= {w | (q0, w, z0) |—* (p, ε, ε) for some p in F} Language Acceptance
  • 19. Equivalence of CFG and PDA 19
  • 21. Problem 1: CFG - PDA Convert the grammar S-> aAA, A->aS/bS/a to a PDA that accepts the same language by empty stack Solution : Let G be a CFG and G=(V,T,P,S) where V={S,A} T={a,b} p: S->aAA, A->aS/bS/a. To find the equivalent PDA Q={q0} ∑=T={a,b} Г=VUT={S,A,a,b} F=Ø Transition function for PDA: – For each variable S,A δ(q0,Є,S)={(q0,aAA)} δ(q0,Є,A)={(q0,aS),(q0,bS),(q0,a)} For each terminal a,b δ(q0,a,a)={q0,Є} δ(0,b,b)={q0,Є} 21
  • 22. Problem 2: CFG - PDA • Convert the grammar S-> 0S1/A, A->1A0/S/є to a PDA that accepts the same language by empty stack. Solution : Let G be a CFG and G=(V,T,P,S) where V={S,A} T={a,b} p: S->aAA, A->aS/bS/a. To find the equivalent PDA Q={q0} ∑=T={0,1} Г=VUT={S,A,0,1} F=Ø Transition function for PDA: – For each variable S,A δ(q0,Є,S)={(q0,0S1), (q0,A)} δ(q0,Є,A)={(q0,1A0),(q0,S),(q0, Є)} For each terminal 0,1 δ(q0,0,0)={q0,Є} δ(q0,1,1)={q0,Є} 22
  • 23. Problem 3: CFG – PDA Construct PDA for the given CFG, and test whether 0104 is acceptable by this PDA. S → 0BB B → 0S | 1S | 0 23 Solution: The PDA can be given as: 1.A = {(q), (0, 1), (S, B, 0, 1), δ, q, S, ?} The production rule δ can be: R1: δ(q, ε, S) = {(q, 0BB)} R2: δ(q, ε, B) = {(q, 0S) | (q, 1S) | (q, 0)} R3: δ(q, 0, 0) = {(q, ε)} R4: δ(q, 1, 1) = {(q, ε)} Testing 0104 i.e. 010000 against PDA: δ(q, 010000, S) ⊢ δ(q, 010000, 0BB) ⊢ δ(q, 10000, BB) R1 ⊢ δ(q, 10000,1SB) R3 ⊢ δ(q, 0000, SB) R2 ⊢ δ(q, 0000, 0BBB) R1 ⊢ δ(q, 000, BBB) R3 ⊢ δ(q, 000, 0BB) R2 ⊢ δ(q, 00, BB) R3 ⊢ δ(q, 00, 0B) R2 ⊢ δ(q, 0, B) R3 ⊢ δ(q, 0, 0) R2 ⊢ δ(q, ε) R3 ACCEPT Thus 0104 is accepted by the PDA.
  • 24. 24 CFG to PDA conversion Formally, the given PDA is M = (Q, Σ, Г, δ, q0, z0, F). Define CFG G=(V, T, P, S), where V=[p x q] for all p & q Є Q and x Є Σ, T= Σ, P=Set of Production rules constructed from δ And S=Starting Symbol
  • 25. Rules to construct P using δ R1 – Production Rules for S S 🡪 [q0 z0 p] for all p Є Q R2 – Production Rules corresponding to the transition move for pop operation (q, a, z) = (p, ϵ) [q z p] 🡪a
  • 26. Cont… R3 - Production Rules corresponding to the transition move for push and read operation (q, a, z) = (q’, z1z2…….zn) [q z p] 🡪 a [q’ z1 q1] [q1 z2 q2] ………[qn zn p]
  • 27. Convert the following PDA in to a CFG 27 Example 1
  • 28. 28 Rule 1 Rule 2 Rule 3
  • 31. Example 2 PDA TO CFG 31 Consider the given PDA and convert it to pda δ(p,0,z)=(p,A) δ(0,0,a)=(p,AA) δ (p,1,A)=(q, λ) δ (q,1,A)=(q, λ) Solution:
  • 32. EQUIVELANCE OF CFG AND PDA 32
  • 33. Final State to Empty Stack PDA 33 (p0, w,X0) |- (q0, w, Z0X0) |-* (q, ε , αX0) |- ( p, ε ,ε ) Example : Design a PDA to check for well-formed parentheses
  • 34. Empty Stack to Final State PDA 34 (p0, w,X0) |- (q0, w, Z0X0) |-* (q, ε , X0) |- ( pf, ε ,ε ) Example : Design a PDA to check for well-formed parentheses
  • 37. Is Npda more powerful than DPDA? • Power of NPDA is more than DPDA. It is not possible to convert every NPDA to corresponding DPDA. ... The languages accepted by DPDA are called DCFL (Deterministic Context Free Languages) which are subset of NCFL (Non Deterministic CFL) accepted by NPDA 37
  • 38. Difference between DPDA and NDPA 38
  • 39. Closure Properties of Context Free Grammar Context-free languages are closed under − •Union- If L1 and L2 are CFL’s then L1ꓴL2 is also CFL. •Concatenation- If L1 and L2 are CFL’s then L1L2 is also CFL. •Kleene Star- If L1 is CFL then L*1 is also CFL.
  • 40. Closure under Union • Begin with two grammars: G1 = (V1, Σ , P1, S1) and G2 = (V2, Σ , P2, S2), generating CFL’s L1 and L2 respectively. • The new CFG Gx is made as: – Σ remains the same – Sx is the new start variable – Vx = V1 ∪ V2 ∪ {Sx} – Px = P1 ∪ P2 ∪ {Sx → S1|S2} • Explanation: All we have done is augment the variable set with a new start state and then allowed the new start state to map to either of the two grammars. So, we’ll generate strings from either L1 or L2, i.e. L1 ꓴ L2
  • 41. Example • Let L1 = { anbn , n > 0}. Corresponding grammar G1 will have P: S1 → aAb|ab • Let L2 = { cmdm , m ≥ 0}. Corresponding grammar G2 will have P: S2 → cBb| ε • Union of L1 and L2, L = L1 ∪ L2 = { anbn } ∪ { cmdm } • The corresponding grammar G will have the additional production S → S1 | S2
  • 42. Closure under Concatenation • Begin with two grammars: G1 = (V1, Σ , P1, S1) and G2 = (V2, Σ , P2, S2), generating CFL’s L1 and L2 respectively. • The new CFG Gy is made as: – Σ remains the same – Sy is the new start variable – Vy = V1 ꓴ V2 ꓴ {Sy} – Py = P1 ꓴ P2 ꓴ {Sx → S1S2} • Explanation: Again, all we have done is to augment the variable set with a new start state, and then allowed the new start state to map to the concatenation of the two original start symbols. So, we will generate strings that begin with strings from L1 and end with strings from L2, i.e. L1L2 .
  • 43. Example • Let L1 = { anbn , n > 0}. Corresponding grammar G1 will have P: S1 → aAb|ab • Let L2 = { cmdm , m ≥ 0}. Corresponding grammar G2 will have P: S2 → cBb| ε • Concatenation of the languages L1 and L2, L = L1L2 = { anbncmdm } • The corresponding grammar G will have the additional production S → S1 S2
  • 44. Clouser under Kleene Star • Begin with two grammars: G1 = (V1, Σ , P1, S1) and G2 = (V2, Σ , P2, S2), generating CFL’s L1 and L2 respectively. • The new CFG Gz is made as: – Σ remains the same – Sz is the new start variable – Vz = V1 ꓴ {Sz} – Pz = P1 ꓴ {Sz → S1Sz | ε} • Explanation: Again we have augmented the variable set with a new start state, and then allowed the new start state to map to either S1Sz or ε. This means we can generate strings with zero or more strings made from expanding the variable S1, i.e. L*1 .
  • 45. Example • Let L = { anbn , n ≥ 0}. Corresponding grammar G will have P: S → aAb| ε • Kleene Star L1 = { anbn }* • The corresponding grammar G1 will have additional productions S1 → SS1 | ε
  • 46. Context-free languages are not closed under − •Intersection − If L1 and L2 are context free languages, then L1 ∩ L2 is not necessarily context free. •Intersection with Regular Language − If L1 is a regular language and L2 is a context free language, then L1 ∩ L2 is a context free language. •Complement − If L1 is a context free language, then L1’ may not be context free.
  翻译: