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

Compiler Construction: Assignment 1

This document contains regular expressions for various string patterns. It defines regular expressions for strings that start with a, strings that start and end with a, strings that start and end with a but do not allow the null string, and strings that do not contain double letters. It also provides regular expressions for strings containing double letters at every place with no single letters allowed. Finite state automata are presented for some of the regular expressions.

Uploaded by

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

Compiler Construction: Assignment 1

This document contains regular expressions for various string patterns. It defines regular expressions for strings that start with a, strings that start and end with a, strings that start and end with a but do not allow the null string, and strings that do not contain double letters. It also provides regular expressions for strings containing double letters at every place with no single letters allowed. Finite state automata are presented for some of the regular expressions.

Uploaded by

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

qwertyuiopasdfghjklzxcvbnmqw

ertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyui
Compiler Construction
opasdfghjklzxcvbnmqwertyuiopa
Assignment 1

sdfghjklzxcvbnmqwertyuiopasdf
Rida Nadeem

ghjklzxcvbnmqwertyuiopasdfghj
Iqra Ahmed
Bilal Ahmed
Zeeshan Aslam

klzxcvbnmqwertyuiopasdfghjklzx
cvbnmqwertyuiopasdfghjklzxcvb
nmqwertyuiopasdfghjklzxcvbnm
qwertyuiopasdfghjklzxcvbnmqw
ertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopa
sdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghj
klzxcvbnmqwertyuiopasdfghjklzx
Write an regular expression for all the string that start with a.

Regular expression:

a(a+b)*

Write an regular expression for all the string that does not contain null
but start with a.

Regular expression:

a(a+b)^+

Write an regular expression for all the string that start and end with a.

Regular Expression:

a(a+b)* a

D.F.A

a,b
Write an regular expression for all the string that start and end with a but
does not accept null.

Regular Expression:

a (a+b)^+ a

D.F.A:

*(aa+bb)+
* ab *

* a * c * + *c * a *
* a * a *

1+ 01 + 11 + 100 + 101 + 110 + 111


+ a + b + aa + ab + ba + bb

a ( a + b + c )*
a +b + c + a ( * a + b * b + c * c )

0 * ( 1 + 2 ) + * ( 0 + 2 ) + 2 * ( 0 + 2 )
1 + ( 1 + 2 ) * 1

1 * 0
Write an RE for all strings that do not contain double
letter anywhere.
(+b)(ab)+(a+)

Write an RE for all the strings that contain at every


place double letters. Single letter is not allowed.
(aa+ + bb+)+

You might also like