






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Some concept of Automata and Complexity Theory are Administrivia, Closure Properties, Context-Free Grammars, Decision Properties, Deterministic Finite Automata, Intractable Problems, More Undecidable Problems. Main points of this lecture are: Automata Theory, Formal Languages, Context-Free Languages, Push-Down Automata, Grammars, Grammar Transformations, Remove, Production, Remove Unit-Production, Covert to Chomsky-Normal-Form
Typology: Slides
1 / 30
This page cannot be seen from the preview
Don't miss anything!























Σ={a, b}
Try to write some strings generated by it: SXaXbaaXbbaaaXbbaaaabb SYaYbaYbbaaYbbbaabbbb
more a ’s than b ’s more b ’s than a ’s
Ls = Lx U Ly
Lx = { a ib j^ ; i>j } Lx = { a ib j^ ; i<j }
S ε
S ε If i ≤ j ≤ 2 i , then randomly choose “ red- rule ” or “ blue-rule ” in the generation.
“ red-rule ” “ blue-rule ”
S ε
Similar idea: “randomly choose two extreme cases”
ε,ε/# q (^0)
0,ε/X ε,ε/ε q^1
q (^2)
ε,#/ε
1,X/ε
1,X/X 1,X/ε
q (^3)
Main idea: (1) use X to record an a or c ; use Y to record an b or d. (2) Compare # X and # Y : by cancellation.
How to realize the comparison by cancellation? Action1: Push an X, when a or c was read; Action2: Pop an X (if any, otherwise push a Y), when b or d was read. Action3: Pop an Y (if any, otherwise push an X), when a or c was read.
Action1: Push an X, when a or c was read; Action2: Pop an X (if any, otherwise push a Y), when b or d was read. Action3: Pop an Y (if any, otherwise push an X), when a or c was read.
ε,ε/# (^) q (^1) q (^5)
a,ε/X ε,ε/ε
b,#/Y#
q 2 ε,ε/ε
c,X/XX
q 3 ε,ε/ε^ q 4 ε,#/ε
b,X/ε
b,Y/YY
c,#/X#
c,Y/ε
d,X/ε
d,#/Y# d,Y/YY
Nullable variables: A, B, C Add Delete For A : S BaC For B : S AaC | aC A C
B → ε
For C : S ABa | Ba | Aa | a A B
C → ε
For T TF (^) S TF For T F a (^) S a
For T F (S) (^) S (S) T F For F a (^) S a For F (S) (^) S (S)
delete it and replace
Convert CFG to Chomsky-Normal-Form
(CNF)