You are welcome to work in small groups on written homework assignments. However, if you do so, I suggest first trying to solve all the problems individually, then meeting as a group to come up with a final solution together (rather than having each member solve a subset of them individually); it is good to test your understanding of the material by trying to solve every homework problem on your own first. If you work in a group, please submit a single solution with all of your names on it, so that it is clear with whom you collaborated and so that I do not have to grade several identical solutions.
HW5: Due Thursday, April 7th at the beginning of class
~newhall/public/cs75/smach/
Code fragments:
---------------
(1) write (9 + 2 * 4);
(2) int x; // these are global variables
int y;
x = 8;
y = 9;
x = y + x;
write x;
write y;
lineno code
------ ------
1: int x;
2: int array[10];
3: int foo(int y) {
4: int b;
5: b = x;
6: y = b;
7: {
8: int y;
9: y = x;
10: write y;
11: }
12: write y;
13: return b;
14: }
15: int main() {
16: x = 5;
17: array[2] = foo(x);
18: write array[2];
19: }
HW4: Due Tuesday, Feb 29 at the beginning of class
S ---> aSbS | bSaS | epsilon
S ---> (L) | a
L ---> L, S | S
Using the re-written form of this grammar:
HW3: Due Tuesday, Feb. 8 at the beginning of class
Convert the following regular expression to an NFA, and then
convert the NFA to a DFA by applying the algorithms we discussed in
class:
ab*a
I want to see an NFA as constructed by your applying the algorithm
we talked about in class, and I want to see all steps in
your applying the NFA to DFA algorithm. Don't just eyeball this
and turn in an NFA and DFA for ab*a, which I'm sure you can all do.
Instead, I want you to show me that you can apply the algorithms to
this simple example.