# HG changeset patch # User cu # Date 1508415322 -3600 # Node ID a2ee4b11c9765a9afb53b47a9f5b2d905ab24cf0 # Parent 3acec8c93c4b20debbf4c18c52fdc4fcece2bfb5 updated diff -r 3acec8c93c4b -r a2ee4b11c976 hws/hw04.pdf Binary file hws/hw04.pdf has changed diff -r 3acec8c93c4b -r a2ee4b11c976 hws/hw04.tex --- a/hws/hw04.tex Thu Oct 19 11:04:43 2017 +0100 +++ b/hws/hw04.tex Thu Oct 19 13:15:22 2017 +0100 @@ -11,7 +11,7 @@ \begin{enumerate} \item If a regular expression $r$ does not contain any occurrence of $\ZERO$, -is it possible for $L(r)$ to be empty? +is it possible for $L(r)$ to be empty? Explain why, or give a proof. \item Define the tokens and regular expressions for a language consisting of numbers, left-parenthesis $($, right-parenthesis $)$, diff -r 3acec8c93c4b -r a2ee4b11c976 hws/hw09.pdf Binary file hws/hw09.pdf has changed diff -r 3acec8c93c4b -r a2ee4b11c976 hws/hw09.tex --- a/hws/hw09.tex Thu Oct 19 11:04:43 2017 +0100 +++ b/hws/hw09.tex Thu Oct 19 13:15:22 2017 +0100 @@ -33,11 +33,12 @@ Give the arithmetic expression that produced this code. Make sure you give all necessary parentheses. -\item Describe what the following two JVM instructions do! +\item Describe what the following three JVM instructions do! \begin{lstlisting}[language=JVMIS,numbers=none] iload 3 istore 1 +ifeq label \end{lstlisting} \item \POSTSCRIPT diff -r 3acec8c93c4b -r a2ee4b11c976 progs/pow.scala --- a/progs/pow.scala Thu Oct 19 11:04:43 2017 +0100 +++ b/progs/pow.scala Thu Oct 19 13:15:22 2017 +0100 @@ -23,3 +23,13 @@ pow(C, 3) pow(C, 3).size // -> 15 + + +val A = Set("a", "b", "c", "d") +pow(A, 4).size + +val A = Set("a", "b", "c") +pow(A, 5).size + +val A = Set("a", "b", "") +pow(A, 5).size