Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 461 – Sept. 16 Review Pumping lemma Applications of FA:

Similar presentations


Presentation on theme: "CS 461 – Sept. 16 Review Pumping lemma Applications of FA:"— Presentation transcript:

1 CS 461 – Sept. 16 Review Pumping lemma Applications of FA:
How do we show language non-regular? Applications of FA: Scanning (part of compilation) Searching for text, using regular expression

2 Proving non-regularity
It’s like a 2-player game… Adversary picks secret number p. We select any string we want, in terms of p (e.g. 0p1p) Adversary will break up s into xyz subject to constraints. The place to pump has length at least 1. The place to pump appears in the first p positions. Be ready to show that xyiz won’t be in language for some i.

3 Example languages Bit strings that are palindromes
Bit strings with equal # of 0s and 1s. More 0s than 1s. { 0n : n is a perfect square } { 0n : n is prime } { 03n + 2 : n  0 } { 0i 1j : i is even or i  j } Notice that regular sets can’t handle counting or nonlinear patterns.

4 Consider complement Show L = { 0i 1j : i is even or i  j } is not regular. Let’s use some set theory… L regular iff L’ regular What is L’ ? Hint: Need to consider (0 + 1)* - 0*1*. Language L’ has “and” instead of “or”, so easier to produce a word not in language. 

5 continued L = { 0i 1j : i is even or i  j }
Then L’ is all words with: The definition turned around. Let A = { i is odd and i < j }. Plus all words not of the form 0*1*. Let B = (0 + 1)* - 0*1* = 0*11*0(0 + 1)*. Then, L’ = A union B. Let s = 02p+1 12p+2 and i = 2 and see how it works in pumping lemma…


Download ppt "CS 461 – Sept. 16 Review Pumping lemma Applications of FA:"

Similar presentations


Ads by Google