Automata Ch2
Automata Ch2
1
REGULAR EXPRESSION AND REGULAR LANGUAGES
Regular Expression: Formula in algebraic notation for specifying a
set of strings
String: Any sequence of alphanumeric characters
Letters, numbers, spaces, tabs, punctuation marks
2
CON...
Regular expression are used for representing certain set of string in
algebraic fashion.
1) Any terminal symbol i.e. symbols that is from ∑ including empty and
null are regular expressions
2) The union of two regular expression is also regular expressions
3) The concatenation of two regular expression is also regular expression
4) The iteration or closure of a regular expression is also regular
expression.
5) The regular expression over ∑ are precisely those obtained recursively
by the application of the above rules ones or several times.
3
EXAMPLE OF REGULAR EXPRESSION
4
DESIGNING REGULAR EXPRESSION
ASSIGNMENT 1
q1 q2 q
3
.
5
REGULAR LANGUAGES
A language is said to be regular language if and only if some finite
state machine recognizes it.
So what language is not regular?
The language which are not recognized by any FSM
Which require memory
Memory of FSM is very limited
It cannot store or count strings
Example
ababb,ababb
aⁿbⁿ
6
REGULAR GRAMMAR
A →xB
A →x
Where A,B E V and x E T
Left linear grammar
A grammar is said to be left linear if all production are of the form
A →Bx
A →x
Where A,B E V and x E T
Example S →abs right linear
S →sbb left linear
8
READING ASSIGNMENT
Read about
Pumping lemm0.25 and non-regular language grammars
Connection between regular expression and regular languages