Homework Handout 1
Regular Expressions and DFAs

CISC 470/670 - Programming Languages
Fall 2000

                    (Due at start of class on Thursday, September 7 (extended to 9/12))

NOTE: You should do this homeowork on your own, not with the help of others
in the class or outside the class.  You may ask for clarification of questions
from the TA or instructor.

PURPOSE: The purpose of this homework is to 
gain some experience reading and writing regular expressions and DFAs.

A. For each of the languages below, write a regular expression and draw
a deterministic finite state machine (DFA) or (FSA) that recognizes the
languages:

1. all strings over the alphabet (a,b) which end with the substring aba.

2. all strings over the alphabet (a,b) which contain at least one a and
two b's.

3. comments consisting of a string surrounded by /* and */ without
intervening */, unless it appears inside the quotes ' and ';
for simplicity, assume that the alphabet has just the 5 characters 

		a  b  '  /  *

So /*ab'*/ and /*ab'*/'a*/ are legal comments

but /*ab'*/aa  and /*ab*/a*/ are not.

B. Do Exercise 2.3 part (c) only in your textbook, page 99.
Last Change: September 3, 2000 / pollock@cis.udel.edu