summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.tex2
-rw-r--r--ruleshead.tex2
-rw-r--r--rulestail.tex28
3 files changed, 30 insertions, 2 deletions
diff --git a/rules.tex b/rules.tex
index d17c1d6..664b042 100644
--- a/rules.tex
+++ b/rules.tex
@@ -15,7 +15,7 @@ Smurfprogramma's makkelijker zal maken.
\input{ruleslambda}
%\input{rulespush}
\input{ruleshead}
-%\input{rulestail}
+\input{rulestail}
%\input{rulesquotify}
%\input{rulescat}
\input{rulesget}
diff --git a/ruleshead.tex b/ruleshead.tex
index ce321db..53b4bf2 100644
--- a/ruleshead.tex
+++ b/ruleshead.tex
@@ -16,7 +16,7 @@ Dit geeft de volgende regel:
$$
\begin{prooftree}
\trans
- {\pgm}{\ip}{(\push{s}{\stk'}, \str)}
+ {\pgm}{\ip}{(\push{c}{\stk'}, \str)}
{\ip'}{\op}{\st}
\justifies
\trans
diff --git a/rulestail.tex b/rulestail.tex
new file mode 100644
index 0000000..156d6b6
--- /dev/null
+++ b/rulestail.tex
@@ -0,0 +1,28 @@
+% vim: set spelllang=nl:
+\subsection{\texttt{Tail}}
+\label{sec:rules:tail}
+
+\begin{quote}
+ t - Pops a string from the stack, and pushes its tail, ie all but the first character. This causes an error if used on the empty string.
+\end{quote}
+
+In plaats van het geven van een error kiezen we ervoor te voorkomen dat we een
+afleidingsboom kunnen maken wanneer $\StmTail$ wordt uitgevoerd op het moment
+dat het element bovenop de stack de lege string is.
+
+Dit geeft de volgende regel:
+
+$$
+\begin{prooftree}
+ \trans
+ {\pgm}{\ip}{(\push{s}{\stk'}, \str)}
+ {\ip'}{\op}{\st}
+ \justifies
+ \trans
+ {\StmTail:\pgm}{\ip}{(\stk,\str)}
+ {\ip'}{\op}{\st}
+ \using{\rtailns}
+ \qquad
+ \text{met $(c~s,\stk') = \pop{\stk}$.}
+\end{prooftree}
+$$ \ No newline at end of file