Docsity

10 re & rl, Exams of Theory of Automata

Partial preview of the text

Download 10 re & rl and more Exams Theory of Automata in PDF only on Docsity!

Regular Expressions

Standard Representations of Regular Languages Regular Languages

DFAs NFAs Regular Expressions

Regular expressions^ Regular Expressions describe regular languages Example: describes the language

( abc )*  a , bc *   , a , bc , aa , abc , bca ,...

Recursive Definition, , 

^1 1 

r r rr  rr Are regular expressions

Primitive regular expressions: Given regular expressions r 1 and r 2

Languages of Regular Expressions : language of regular expression Example

L   r r

L  ( abc )*   , a , bc , aa , abc , bca ,...

Definition For primitive regular expressions:       L   a   a

L

L

Regular expression:^ Example ab   a * L  ab  a   LL  (^)   (^) a a  bb  L  (^)  L a  * a    La   a    bL     ba   (^)  L   a   aa ,, baa ,  aaa , a ,,..., aa , baaa , ba ,..., baa  ,...

Example Regular expression r   ab  * abb

L   r   a , bb , aa , abb , ba , bbb ,...

Example Regular expression r  (^0 ^1 )^00 (^0 ^1 ) L ( r ) = { all strings with at least two consecutive 0 }

Example

Regular expression r  (^1 ^01 )*(^0 ^ )

L ( r ) = { all strings without two consecutive 0 }

L = { all strings without^ Example two consecutive 0 }

r 1  ( 1  01 )*( 0  )

r 2  ( 1 * 011 )( 0  )  1 *( 0  )

L ( r 1 )  L ( r 2 )  L are equivalent regular expr. r^1 and r^2

Regular Expressions and

Regular Languages

Languages Generated by Regular Expressions ^ Regular^ Languages Languages Generated by Regular Expressions ^ Regular^ Languages

Proof:

Theorem - Part 1

  1. For any regular expression the language (^) L ( r ) is regular r

Languages Generated by Regular Expressions ^ Regular^ Languages