summaryrefslogtreecommitdiff
path: root/rulesget.tex
blob: bc38d5bf23df3e80b7272e4a1005bf8a4e2cfdb4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% vim: set spelllang=nl:
\subsection{\texttt{Get}}
\label{sec:rules:exec}

\begin{quote}
	g - Pops a variable name from the stack, and pushes the value of the
	variable.
\end{quote}

De regel voor dit statement spreekt voor zich. In het geval dat $\stk$ leeg is,
is $\pop\stk$ niet gedefinieerd en kunnen we de regel dus niet toepassen. Omdat
$\StmGet$ geen IO gebruikt kunnen we $\ip$, $\ip'$ en $\op$ direct doorgeven.

$$
\begin{prooftree}
	\trans
		{\pgm}{\ip}{(\push{\str~\var}{\stk'}, \str)}
		{\ip'}{\op}{\st}
	\justifies
	\trans
		{\StmGet:\pgm}{\ip}{(\stk,\str)}
		{\ip'}{\op}{\st}
	\using{\rgetns}
	\qquad
	\text{met $(\var,\stk') = \pop{\stk}$.}
\end{prooftree}
$$