\documentclass{article}
\usepackage{charter}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{automata}
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
\begin{document}
\section*{Homework 8}
\begin{enumerate}
\item Suppose the following grammar for the WHILE-language:
\begin{center}
\begin{tabular}{lcl}
$Stmt$ & $\rightarrow$ & $\text{skip}$\\
& $|$ & $Id := AExp$\\
& $|$ & $\text{if}\; B\!Exp \;\text{then}\; Block \;\text{else}\; Block$\\
& $|$ & $\text{while}\; B\!Exp \;\text{do}\; Block$\medskip\\
$Stmts$ & $\rightarrow$ & $Stmt \;\text{;}\; Stmts$\\
& $|$ & $Stmt$\medskip\\
$Block$ & $\rightarrow$ & $\{ Stmts \}$\\
& $|$ & $Stmt$\medskip\\
$AExp$ & $\rightarrow$ & $AExp + AExp$\\
& $|$ & $AExp * AExp$\\
& $|$ & $( AExp )$\\
& $|$ & $Num$\\
& $|$ & $Id$\medskip\\
$BExp$ & $\rightarrow$ & $AExp = AExp$\\
& $|$ & $AExp \not= AExp$\\
& $|$ & $\text{false}$\\
& $|$ & $\text{true}$\\
\end{tabular}
\end{center}
Transform this grammar into Chomsky normalform.
\item Write a program in the WHILE-language that calculates the factorial function.
\end{enumerate}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: