Docsity

Regular Expressions - Programming Language Translation - Quiz, Exercises of Programming Languages

Toggle sidebar
bg1
โ€“ Fall 2010
1. Describe the languages denoted by the following regular expressions.
a) a | b*c
b) (ab)+c | ba*
c) (00|11)*(01|10)(00|11)*
2. Write regular expressions for the following languages.
a) All non-empty strings of 1's and 0's where the zeros may only appear in pairs. For
example 00, 100, 1100, 100111001 are legal. 010, 101, 1010, 10001
are not legal.
b) All strings of alphabetic letters that contain at most one vowel. The vowel may appear in
any position in the string.
3. Problems 3.16a and 3.17a from Aho, Sethi, Ullman โ€“ edition 1
a) Construct non-deterministic finite automata for (a|b)* using algorithm as given in
slides 3.68 to 3.81 and show the sequence of moves for the input string ababbab
b) Convert your NFA in part 3a to a DFA using the algorithm given in slides 3.82 to 3.92
and show the sequence of moves for the input string ababbab
4. Problems 3.16d and 3.17d from Aho, Sethi, Ullman โ€“ edition 1
a) Construct non-deterministic finite automata for (a|b)* abb(a|b)* using algorithm
as given in slides 3.68 to 3.81 and show the sequence of moves for the input string
ababbab
b) Convert your NFA in part 4d to a DFA using the algorithm given in slides 3.82 to 3.92
and show the sequence of moves for the input string ababbab

Partial preview of the text

Download Regular Expressions - Programming Language Translation - Quiz and more Exercises Programming Languages in PDF only on Docsity!

โ€“ Fall 2010

  1. Describe the languages denoted by the following regular expressions. a) a | bc* b) (ab)+c | ba* c) (00|11)(01|10)(00|11)**
  2. Write regular expressions for the following languages. a) All non-empty strings of 1's and 0's where the zeros may only appear in pairs. For example 00, 100, 1100, 100111001 are legal. 010, 101, 1010, 10001 are not legal. b) All strings of alphabetic letters that contain at most one vowel. The vowel may appear in any position in the string.
  3. Problems 3.16a and 3.17a from Aho, Sethi, Ullman โ€“ edition 1 a) Construct non-deterministic finite automata for (a|b)* using algorithm as given in slides 3.68 to 3.81 and show the sequence of moves for the input string ababbab b) Convert your NFA in part 3a to a DFA using the algorithm given in slides 3.82 to 3. and show the sequence of moves for the input string ababbab
  4. Problems 3.16d and 3.17d from Aho, Sethi, Ullman โ€“ edition 1 a) Construct non-deterministic finite automata for (a|b) abb(a|b)** using algorithm as given in slides 3.68 to 3.81 and show the sequence of moves for the input string ababbab b) Convert your NFA in part 4d to a DFA using the algorithm given in slides 3.82 to 3. and show the sequence of moves for the input string ababbab