\subsection{Server Algorithm}\r
$s \in SN$ is a sequence number\\\r
$sv \in SV$ is a slot's value\\\r
-$slot_s = \tuple{s, sv} \in Q \subseteq SN \times SV$ \\\r
+$slot_s = \tuple{s, sv} \in SL \subseteq SN \times SV$ \\\r
\r
\textbf{State} \\\r
-\textit{Q = set of live slots on server} \\\r
+\textit{SL = set of live slots on server} \\\r
\textit{max = maximum number of slots (input only for resize message)} \\\r
\textit{n = number of slots} \\\r
\r
\begin{algorithmic}[1]\r
-\Function{GetSlot}{$s'$}\r
-\State \Return{$\{\tuple{s, sv} \in Q \mid s \geq s'\}$}\r
+\Function{GetSlot}{$s_g$}\r
+\State \Return{$\{\tuple{s, sv} \in SL \mid s \geq s_g\}$}\r
\EndFunction\r
\end{algorithmic}\r
\r
\begin{algorithmic}[1]\r
\Function{PutSlot}{$s',sv',max'$}\r
-\If{$(max' \neq \emptyset) \land (max' > max)$}\Comment{Resize}\r
- \State $Q' \gets new\:queue\:of\:\langle s,sv \rangle\:with\r
- \:size\:max'$\r
- \State $Q \gets Q' \cup Q$\r
- \State $max \gets max'$\r
+\If{$(max' \neq \emptyset)$}\Comment{Resize}\r
+\State $max \gets max'$\r
\EndIf\r
\If{$(s' = s_n + d)$}\r
\If{$n = max$}\r
- \State $Q \gets Q - \{\langle s_n,sv_n \rangle\}$\r
+ \State $SL \gets SL - \{\langle s_n,sv_n \rangle\}$\r
\Else \Comment{$n < max$}\r
\State $n \gets n + 1$\r
\EndIf\r
- \State $Q \gets Q \cup \{\langle s',sv' \rangle\}$\r
+ \State $SL \gets SL \cup \{\langle s',sv' \rangle\}$\r
\State \Return{$true$}\r
\Else\r
- \State \Return{$(false,\{\langle i,sv_i \rangle \in Q \mid \r
+ \State \Return{$(false,\{\langle i,sv_i \rangle \in SL \mid \r
s' \leq i \leq s_n\})$}\r
\EndIf\r
\EndFunction\r