


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























1
2
Today Regular languages Finite languages are regular Regular operations on languages Union () Concatenation () Kleene star (*) For next time: Read 1.3 and handout on minimization HW1 collected
4
Unary prime numbers: { 11, 111, 11111, 1111111, 11111111111, … } = {1^2 , 1^3 , 1^5 , 1^7 , 1^11 , 1^13 , … } = { 1^ p^ | p is a prime number } Unary squares: {, 1, 1^4 , 1^9 , 1^16 , 1^25 , 1^36 , … } = { 1^ n^ | n is a perfect square } Palindromic bit strings: {, 0, 1, 00, 11, 000, 010, 101, 111, …} = {x {0,1}* | x = xR^ } o
Will explore whether or not these are regular in future.
5
All the previous examples had the following
NOTE: The strings which made up the
language were finite (as they always will be in this course); however, the collection of such strings was infinite.
Before looking at infinite languages, should
definitely look at finite languages.
7
A: Yes.
Q: What’s, wrong with this example?
8
A: Nothing, really. This an example of a
most concise way to encapsulate the language { banana }
But we will deal with nondeterminism in coming lectures. So:
Q: Is there a way of fixing this and making it deterministic?
11
Q: How about two strings? For example
{ banana, nab }?
12
A: Just add another route:
14
15
A2: Build a 1-state automaton whose
17
Q: Are all regular languages finite?
18
A: No! Many infinite languages are regular.
Common Mistake 1: The strings of regular languages are finite, therefore the regular languages must be finite.
Common Mistake 2: Regular languages are – by
therefore regular languages are finite.
language.
20
You may have come across the regular operations when doing advanced searches utilizing programs such as emacs, egrep, perl, python, etc. There are three basic operations we will work with:
And a fourth definable in terms of the previous:
21
Operation Symbol UNIX version Meaning
match one of the patterns
match patterns in sequence Kleene- star
Match pattern 0 or more times Kleene- plus
Match pattern 1 or more times