0% found this document useful (0 votes)
4 views9 pages

Automata Ch2

The document provides an overview of regular expressions and regular languages, defining key concepts such as strings, patterns, and finite state automata. It outlines the properties of regular expressions, including union, concatenation, and iteration, and introduces regular grammar with examples. Additionally, it includes an assignment for designing regular expressions and a reading assignment on pumping lemma and non-regular languages.

Uploaded by

amanhabtamu32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views9 pages

Automata Ch2

The document provides an overview of regular expressions and regular languages, defining key concepts such as strings, patterns, and finite state automata. It outlines the properties of regular expressions, including union, concatenation, and iteration, and introduces regular grammar with examples. Additionally, it includes an assignment for designing regular expressions and a reading assignment on pumping lemma and non-regular languages.

Uploaded by

amanhabtamu32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

ARSI UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE

INTRODUCTION TO AUTOMATA AND COMPLEXITY THEORY


COURSE CODE: (CoSc 3101 )

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

 Regular Expression Search


 Pattern: specifying the set of strings we want to search for
 Corpus: the texts we want to search through

 Regular expression Can be viewed as a way to specify:


 Search patterns over text string
 Design of a particular kind of machine, called a Finite State Automaton (FSA)

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

Describe the following sets as regular expressions


 {0,1,2}
 {є , ab}
 {abb, a, b, bba}
 {є,0,00,000,….}
 {1,11,111,1111,…..}

4
DESIGNING REGULAR EXPRESSION
ASSIGNMENT 1

FIND THE REGULAR EXPRESSION FOR THE FOLLOWING

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 grammar G can be formally described using 4 tuples as G = {V,T,S,P} where


 V = set of variables or non terminal symbols
 T = set of terminal symbol
 S = start symbol
 P = production rule for terminals and non terminals
 A production rule have the form ā → ß, where ā and ß are strings on V U T and at least one
symbol of ā belong to V.
 Example G = ({S,A,B},{a,b},S,{S→AB, A →a, B →b})
 V={S,A,B}
 T={a,b}
 S=S
 P= S → AB, A →a, B →b
7
CON…
 Regular Grammer can be divided into two types
 Right linear grammar
 A grammar is said to be right linear if all production are of the form

 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

You might also like