Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Scope - Automata and Complexity Theory - Lecture Slides, Slides of Theory of Automata

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: Scope, Regular Expression, Conversion, Equivalence, Closure Properties, Regular Languages, Pumping Lemma, Minimization Algorithm, Equivalence, Removal

Typology: Slides

2012/2013

Uploaded on 04/29/2013

shamir_69
shamir_69 🇮🇳

5

(4)

66 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Scope: regular languages
DFA, NFA and conversion from NFA to DFA.
Regular expression.
Equivalence of DFA, NFA and regular
expression.
Closure properties of regular languages.
Pumping lemma for regular languages.
DFA minimization algorithm, DFA equivalence.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Scope - Automata and Complexity Theory - Lecture Slides and more Slides Theory of Automata in PDF only on Docsity!

Scope: regular languages

• DFA, NFA and conversion from NFA to DFA.

• Regular expression.

• Equivalence of DFA, NFA and regular

expression.

• Closure properties of regular languages.

• Pumping lemma for regular languages.

• DFA minimization algorithm, DFA equivalence.

Scope: context free languages

• Context free grammars.

• Derivations, parse trees, and ambiguity.

• Removal of ε and unit productions, Chomsky

Normal Form.

• The CYK parsing algorithm.

• Pushdown automata.

• Pumping lemma for context-free languages

DFA Hacking

• Let L be a regular language, L’={u|uv is in L

and |u|=|v|}. That is, L’ is the first halves of

strings in L. Prove that L’ is also regular.

• Hints: Let M be the DFA for L, How do we

characterize a middle state?

Closure Properties

• For regular languages: union, intersection,

concatenation, Kleen closure, reverse,

complement, etc.

• For context free languages, exclude

intersection and complement.

• Usage: is L ∩ L regular? Is non palindromes

regular?

CNF

Consider the following simple grammar:

A → cA | a

B → ABC | b C → c

How to convert this grammar to CNF?

Conversion into CNF

Step 1: Convert every production into either:

A→ B 1 B 2 …Bn or

A→ a

e.g. A → bCDeF becomes:

A → BCDEF

B → b

E → e

Example

Convert the following CFG into Chomsky Normal

Form:

S → ε

S → ABBA

B → bCb

A → a

C → c

Solution

Step 1: B →bCb becomes B →DCD D →b

Step 2: S → ABBA becomes S →AE E →BF F →BA

B →DCD becomes B →DG G →CD

S → ε

S → ABBA

B → bCb

A → a

C → c

Result: S → ε S →AE E →BF F →BA B →DG G →CD A → a C → c D →b

Pumping Lemma for CFL

• Case 1: vwx is within the first block 0 ’s

  • v and x must contain 0’s
  • Let vx consist of k 0 ’s, where k > 0
  • Choose i=0, uviwxiy = 0 n - k 1 n^ 0 n 1 n
  • If 0 n - k 1 n^ 0 n 1 n^ in form of ww, the end of first w must

lie in the second block of 0’s

  • Then, the two w’s are in the different

pattern:0+^1 +^0 +^ and 0+^1 +^ .So, 0 n - k 1 n^ 0 n 1 n^ ∉ L

0 n 1 n 0 n 1 n

Pumping Lemma for CFL

  • Case 2: vwx spread over the first block of 0 ’s and

first block of 1 ’s

  • vx has at least one 0’s or one 1’s
  • Let vx consist of k 0 ’s and p 1 ’s, where k ≥ 0 ,p > or k>0,p ≥ 0
  • Choose i=0, uv iwxiy = 0 n-k 1 n-p^ 0 n 1 n
  • If 0 n-k 1 n-p^ 0 n 1 n^ in form of ww, the end of first w must lie after the first block of 1’s
  • Then, the number of 1’s is different in two w. So, 0 n- k 1 n-p (^) 0 n 1 n (^) ∉ L

0 n 1 n 0 n 1 n

Pumping Lemma – Example

  • Case 4: vwx spread over the first block of 1 ’s and

second block of 0 ’s

  • vx has at least one 1’s or one 0 ’s.
  • Let vx consist of k 1 ’s and p 0 ’s, where k ≥ 0 ,p > or k>0,p ≥ 0
  • Choose i=0, uv iwxiy = 0 n 1 n-k^ 0 n-p 1 n
  • For 0 n 1 n-k^ 0 n-p 1 n^ in form of ww, if the end of first w lie in the first block of 1’s, then the number of 0’s is different in two w.
  • if the end of first w lie in the second block of 0’s, then the number of 1’s is different in two w. So, 0 n 1 n-k^ 0 n- p 1 n (^) ∉ L

0 n 1 n 0 n 1 n

Pumping Lemma for CFL

  • Other cases: vwx is within the second half of z
    • the argument is symmetric to the cases where vwx is within the first half of z
  • We can conclude that L = { ww | w is in { 0 , 1 }*^ } is not

context free.

0 n 1 n 0 n 1 n^ 0 n 1 n 0 n 1 n^ 0 n 1 n 0 n 1 n