Binary file hws/hw07.pdf has changed
--- a/hws/hw07.tex Mon Nov 10 09:18:36 2014 +0000
+++ b/hws/hw07.tex Thu Nov 13 11:25:28 2014 +0000
@@ -1,6 +1,5 @@
\documentclass{article}
\usepackage{../style}
-\usepackage{../graphics}
\begin{document}
@@ -57,6 +56,35 @@
\noindent
into Chomsky normal form.
+\item Consider the following grammar $G$
+
+\begin{center}
+\begin{tabular}{l}
+$S \rightarrow \texttt{if0} \cdot E \cdot \texttt{then} \cdot S$\\
+$S \rightarrow \texttt{print} \cdot S$\\
+$S \rightarrow \texttt{begin} \cdot B\cdot \texttt{end}$\\
+$B \rightarrow S\cdot \texttt{;}$\\
+$B \rightarrow S\cdot \texttt{;} \cdot B$\\
+$E \rightarrow num$
+\end{tabular}
+\end{center}
+
+where $S$ is the start symbol and $S$, $E$ and $B$ are
+non-terminals.
+
+Check each rule below and decide whether, when added to $G$,
+the combined grammar is ambiguous. If yes, give a string that
+has more than one parse tree.
+
+\begin{center}
+\begin{tabular}{rl}
+(i) & $S \rightarrow \texttt{if0} \cdot E\cdot \texttt{then} \cdot S\cdot \texttt{else} \cdot S$\\
+(ii) & $B \rightarrow B \cdot B$\\
+(iii) & $E \rightarrow ( \cdot E \cdot )$\\
+(iv) & $E \rightarrow E \cdot + \cdot E$
+\end{tabular}
+\end{center}
+
%\item {\bf (Optional)} The task is to match strings where the letters are in alphabetical order---for example,
%\texttt{abcfjz} would pass, but \texttt{acb} would not. Whitespace should be ignored---for example