fix nog meer boxen en referenties
authorMart Lubbers <mart@martlubbers.net>
Fri, 17 Jun 2016 18:16:28 +0000 (20:16 +0200)
committerMart Lubbers <mart@martlubbers.net>
Fri, 17 Jun 2016 18:16:28 +0000 (20:16 +0200)
deliverables/report/gen.tex
deliverables/report/report.tex
deliverables/report/sem.tex

index 17dacc0..fddc754 100644 (file)
@@ -44,7 +44,10 @@ stack frame of that function. When plus has returned, the two arguments are
 popped of the stack and the value in \tt{RR} (for functions which do not return
 \tt{Void}) is placed on the stack.
 
-\begin{SPLCode} \label{lst:stackFunCall}
+\begin{lstlisting}[
+       label={lst:stackFunCall},
+       caption={Stack layout during function calls},
+       language=SPLCode]
 plus(x, y}{ return x + y; }
 
 main(){ var a = plus(3, 4); }
@@ -61,7 +64,7 @@ main(){ var a = plus(3, 4); }
 117 | 003      ;x, loaded by ldl -3
 118 | 004      ;y, loaded by ldl -2
 */
-\end{SPLCode}
+\end{lstlisting}
 
 \subsection{Generation}
 The code generation phase transforms a well typed \AST{} to either an error,
index a82890a..de447ea 100644 (file)
@@ -1,4 +1,4 @@
-\documentclass{article}
+\documentclass[draft]{article}
 
 \usepackage{listings,clean,spl}  %Sourcecode
 \usepackage[hidelinks]{hyperref} %Clickable references
index cfb7cfb..9aa5af9 100644 (file)
@@ -36,10 +36,7 @@ downside is that in the current implementation lambdas can not access variables
 in the scope in which they are declared. This could be solved by adding all
 free variables in the lambda expression as parameters to the lifted function.
 
-\begin{lstlisting}[
-       label={lst:lambdaLift},
-       caption={SPLC types},
-       language=SPLCode]
+\begin{lstlisting}[label={lst:lambdaLift},caption={\SPLC{} types},language=SPLCode]
 main() {
        var x = \a b -> a + b;
 }
@@ -186,19 +183,21 @@ and accumulating the resulting types, substitutions, etc.
                }
 \end{equation}
 
-\begin{equation} \label{eq:inferAppN}
-       \infer[AppN]
-               {\Gamma \vdash \textit{id}(e^*).\textit{fs}^* \Rightarrow
-                       ((\Gamma^\star, \star, \tau^r,
-                               \textit{id}({e^*}').\textit{fs}^*)}
-               {\Gamma(id) = \lfloor \tau^e \rfloor
-               &\Gamma \vdash e^* \Rightarrow
-                       (\Gamma^{\star_1}, \star_1, \tau^*, {e^*}')
-               &(\texttt{fold } (\rightarrow) \texttt{ } \alpha \texttt{ } \tau^*)
-                       \unif \tau^e = \star_2
-               &\star = \star_2 \cdot \star_1
-               &\texttt{fold apfs } \tau \textit{ fs}^* = \tau^e
+\begin{equation}\label{eq:inferAppN}
+       \resizebox{\linewidth}{!}{%
+               \infer[AppN]
+                       {\Gamma \vdash \textit{id}(e^*).\textit{fs}^* \Rightarrow
+                               ((\Gamma^\star, \star, \tau^r,
+                                       \textit{id}({e^*}').\textit{fs}^*)}
+                       {\Gamma(id) = \lfloor \tau^e \rfloor
+                       &\Gamma \vdash e^* \Rightarrow
+                               (\Gamma^{\star_1}, \star_1, \tau^*, {e^*}')
+                       &(\texttt{fold } (\rightarrow) \texttt{ } \alpha \texttt{ } \tau^*)
+                               \unif \tau^e = \star_2
+                       &\star = \star_2 \cdot \star_1
+                       &\texttt{fold apfs } \tau \textit{ fs}^* = \tau^e
                }
+       }
 \end{equation}
 
 \paragraph{Return statements}
@@ -235,15 +234,17 @@ selectors.  \tt{unapfs} is a function which takes a type and a fieldselector
 and returns the type of the variable needed to assign to that fieldselector,
 i.e. \CI{unapfs a FieldHd = ListType a}
 \begin{equation}
-       \infer[Ass]
-               {\Gamma \vdash \textit{id.fs}^* \underline{=} e \Rightarrow
-                       (\Gamma^\star.k:\tau_r^\star, \star, \textrm{Void},
-                               \textit{id.fs}^* \underline{=} e')
-               }
-               {\Gamma(\textit{id}) = \lfloor \tau_e \rfloor
-               &\Gamma \vdash e \Rightarrow (\Gamma^{\star_1}, \star_1, \tau_g, e')
-               &\texttt{fold unapfs } \tau_g \textit{ reverse fs} = \tau^r
-               &\tau_e \unif \tau_g = \star_2
-               &\star = \star_2 \cdot \star_1
+       \resizebox{\linewidth}{!}{%
+               \infer[Ass]
+                       {\Gamma \vdash \textit{id.fs}^* \underline{=} e \Rightarrow
+                               (\Gamma^\star.k:\tau_r^\star, \star, \textrm{Void},
+                                       \textit{id.fs}^* \underline{=} e')
+                       }
+                       {\Gamma(\textit{id}) = \lfloor \tau_e \rfloor
+                       &\Gamma \vdash e \Rightarrow (\Gamma^{\star_1}, \star_1, \tau_g, e')
+                       &\texttt{fold unapfs } \tau_g \textit{ reverse fs} = \tau^r
+                       &\tau_e \unif \tau_g = \star_2
+                       &\star = \star_2 \cdot \star_1
                }
+       }
 \end{equation}