\newcommand{\tuple}[1]{\ensuremath \langle #1 \rangle}\r
\usepackage{color}\r
\usepackage{amsthm}\r
+\usepackage{amsmath}\r
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx\r
\newtheorem{theorem}{Theorem}\r
\newtheorem{defn}{Definition}\r
(b) a request to the server\r
\r
\subsection{Server Algorithm}\r
-\textbf{Key-Value $\langle K,V \rangle$ Pair} \\\r
-$k \in K$ \\\r
-$v \in V$ \\\r
-$\langle k,v \rangle \in P \subseteq K \times V$ \\\r
-$s \in SN \subseteq P*$ \\\r
-$slot_s = \langle s,E( \langle k,v \rangle ) \rangle$ \\\r
-$SN = \{sn_1, sn_2, \dots, sn_n\}$ \\\r
-$Q = \{slot_{sn_1}, slot_{sn_2}, \dots, slot_{sn_n}\}$ \\\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
\r
-\textbf{States} \\\r
-\textit{Q = queue of slots on server} \\\r
-\textit{SN = set of existing sequence numbers $\leftrightarrow$\r
-$SN = \{sn_1, sn_2, \dots, sn_n\}$} \\\r
+\textbf{State} \\\r
+\textit{Q = 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
-\textit{d = distance between two subsequent $sn_i$, e.g. 1 for 1, 2, 3, \r
-$\dots$} \\\r
\r
\begin{algorithmic}[1]\r
-\Function{Get}{$s,Data$}\r
-\If{$s \in SN$}\r
- \State $Data \gets \{slot_{s}, \dots, slot_{sn_n}\} \forall $\r
- $slot_i = \langle i,E( \langle k,v \rangle ) \rangle \in Q$\r
-\Else\r
- \State $Data \gets \emptyset$\r
-\EndIf\r
-\State \Return{$Data$}\r
+\Function{Get}{$s'$}\r
+\State \Return{$\{\tuple{s, sv} \in Q \mid s \geq s'\}$}\r
\EndFunction\r
\end{algorithmic}\r
\r