aanpassing semantiek & analyse
[sec1415.git] / an_faculteit.tex
index 695fb4d..7db77ea 100644 (file)
@@ -95,3 +95,35 @@ Wat in piet er uit zit als in \ref{fig:img3}
        \fbox{\includegraphics[natheight=320px, natwidth=256px, height=320px,
        width=256px]{img3.png}}
 \end{figure}
+
+\begin{landscape}
+De afleidingsrij voor 1! ziet er als volgt uit:\\
+$
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3;dup;roll;push \: 1;push \: 2;push \: 1;push \: 1, [\:], [\:], [\:]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3;dup;roll;push \: 1;push \: 2;push \: 1, [\:], [\:], [1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3;dup;roll;push \: 1;push \: 2, [\:], [\:], [1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3;dup;roll;push \: 1, [\:], [\:], [2,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3;dup;roll, [\:], [\:], [1,2,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3;dup, [\:], [\:], [1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1;push \: 3, [\:], [\:], [1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll;push \: 1, [\:], [\:], [3,1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1;roll, [\:], [\:], [1,3,1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;push \: 1, [\:], [\:], [1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not;subtract;, [\:], [\:], [1,1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1;not, [\:], [\:], [1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1;push \: 1, [\:], [\:], [1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract;push\:1, [\:], [\:], [1,1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater;subtract, [\:], [\:], [1,1,1,1,1]\rangle \Rightarrow\\
+\langle pointer; not;greater, [\:], [\:], [0,1,1,1]\rangle \Rightarrow\\
+\langle pointer; not, [\:], [\:], [1,1,1]\rangle \Rightarrow\\
+\langle pointer [\:], [\:], [0,1,1]\rangle \Rightarrow\\
+\langle [\:], [\:], [1,1]\rangle\\
+\
+$
+Eerst worden x en y op de stack gepusht zodat de stack [y,x] = [1,1]. 
+Deze stack is gelijk aan de stack in de termineerende configuratie: 1 = 1! dus y = x!.
+Als bewijs dat de wiskundige operaties op de stack goed zijn uitgevoerd staat in 
+de appendix onder het kopje voorbeelden een stukje code.  In het programma 
+eenfaculteit worden alle wiskundige operaties die bij de commando's horen 
+achter elkaar uitgevoerd op de stack, waarbij het resultaat [1,1] is.
+\end{landscape}
\ No newline at end of file