Assigned: Fri 02-11-11
Due: Fri 02-18-11
Problem | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | ... |
---|---|---|---|---|---|---|---|---|---|---|
Credit | RC | RC | RC | EC | RC | RC | NA | RC | RC | ... |
where "RC" is "regular credit", "EC" is "extra credit", and "NA" is "not applicable" (not attempted). Failure to do so will result in an arbitrary set of problems being graded for regular credit, no problems being graded for extra credit, and a five percent penalty assessment.
When a problem asks for a context-free grammar, you must describe what each variable in your context-free grammar does, in a manner similar to the solution given in the handout.
When you are asked to construct a PDA for a given language. You should give finite state diagrams for such PDAs, similar to those given in class and in Figures 2.15, 2.17, and 2.19 from the Sipser text.
To demonstrate that a given grammar is ambiguous, you must show multiple left-most (or right-most) derivations for a string in the given language. (See pp. 105-106 of the Sipser text.) To attach a "meaning" to any such derivation, you will likely need to consider the parse trees associated with these derivations.
Required: 5 of the following 6 problems
Points: 20 pts per problem
{ai bj | i <= j <= 2i}
Hint: Make judicious use of non-determinism.
Hint: The ambiguity present in the grammar shown in
Exercise 2.27 is due to the if-then
and
if-then-else
statements. The ambiguity you will discover is
referred to as the "dangling else" ambiguity.
Last Updated:
The URL for this document is: http://www.ccs.neu.edu/home/fell/CS3800/Homeworks/hw.05.html