--- a/progs/fun_llvm.scala Tue Oct 08 21:12:52 2019 +0100
+++ b/progs/fun_llvm.scala Wed Oct 09 21:37:17 2019 +0100
@@ -141,6 +141,11 @@
val is2 = compile_exp(e2)
i"%$x = $is1" ++ is2
}
+ case KLet(x: String, e1: KExp, e2: KExp) => {
+ val is1 = compile_exp(e1)
+ val is2 = compile_exp(e2)
+ i"%$x = $is1" ++ is2
+ }
case KIfeq(x1, x2, a1, a2) => {
val if_br = Fresh("if_br")
val else_br = Fresh("else_br")
--- a/progs/pow.scala Tue Oct 08 21:12:52 2019 +0100
+++ b/progs/pow.scala Wed Oct 09 21:37:17 2019 +0100
@@ -6,6 +6,12 @@
case n => concat(A, pow(A, n- 1))
}
+val A = Set("1", "2", "3", "")
+val B = Set("1", "2", "3", "4", "5", "6", "")
+concat(A, B).size // -> 28
+pow(B, 3).size
+
+
val A = Set("a", "b", "c", "d")
pow(A, 4).size // -> 256
Binary file slides/slides03.pdf has changed
--- a/slides/slides03.tex Tue Oct 08 21:12:52 2019 +0100
+++ b/slides/slides03.tex Wed Oct 09 21:37:17 2019 +0100
@@ -465,7 +465,7 @@
For the regular expression \bl{$(.^*)a\,(.^{\{n\}})bc$}\bigskip\bigskip
% \begin{center}
-\mbox{}\hspace{-11mm}
+\mbox{}\hspace{-11.5mm}
\begin{tikzpicture}[>=stealth',very thick, auto,
every state/.style={minimum size=5pt,inner sep=1pt,
draw=blue!50,very thick,fill=blue!20},scale=1, node distance=5mm,
@@ -1226,7 +1226,7 @@
\onslide<2->{
\begin{center}
\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
-\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\ONE + \mbox{Q}_0\,b + \mbox{Q}_1\,b + \mbox{Q}_2\,b$}\\
+\bl{$\mbox{Q}_0$} & \bl{$=$} & \bl{$\mbox{Q}_0\,b + \mbox{Q}_1\,b + \mbox{Q}_2\,b + \ONE$}\\
\bl{$\mbox{Q}_1$} & \bl{$=$} & \bl{$\mbox{Q}_0\,a$}\\
\bl{$\mbox{Q}_2$} & \bl{$=$} & \bl{$\mbox{Q}_1\,a + \mbox{Q}_2\,a$}\\