Renaming Get and Put into GetSlot and PutSlot; Cleaning up PutSlot
[iotcloud.git] / doc / iotcloud.tex
index 315b84ec938a938c7b37238e44a0f5da93d7d6f9..78fee74f444fd8ad26aaffa443a92eea2c71cbfd 100644 (file)
@@ -135,37 +135,31 @@ $slot_s = \tuple{s, sv} \in Q \subseteq SN \times SV$ \\
 \textit{n = number of slots} \\\r
 \r
 \begin{algorithmic}[1]\r
-\Function{Get}{$s'$}\r
+\Function{GetSlot}{$s'$}\r
 \State \Return{$\{\tuple{s, sv} \in Q \mid s \geq s'\}$}\r
 \EndFunction\r
 \end{algorithmic}\r
 \r
 \begin{algorithmic}[1]\r
-\Function{Put}{$s,newMax,newSlot$}\r
-\If{$(newMax \neq \emptyset) \land (newMax > max)$}\Comment{Resize}\r
-       \State $Q' \gets \{slot_1, slot_2, \dots, slot_{newMax}\} \forall slot_i = 0 \r
-       \Leftrightarrow Q' = \emptyset$\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 newMax$\r
+    \State $max \gets max'$\r
 \EndIf\r
-\If{$(s = sn_n + d)$}\r
+\If{$(s' = s_n + d)$}\r
        \If{$n = max$}\r
-               \State $Q \gets Q - \{slot_{sn_1}\}$\r
-               \State $SN \gets SN - \{sn_1\}$\r
-               \State $Q \gets Q \cup newSlot$\r
+               \State $Q \gets Q - \{\langle s_n,sv_n \rangle\}$\r
        \Else \Comment{$n < max$}\r
-               \State $Q \gets Q \cup newSlot$\r
                \State $n \gets n + 1$\r
        \EndIf\r
-    \State $SN \gets SN \cup \{s\: |\: s = new\: sn_n\}$\r
-       \State $status \gets true$\r
-    \State $MSlot \gets \emptyset$\r
+    \State $Q \gets Q \cup \{\langle s',sv' \rangle\}$\r
+       \State \Return{$true$}\r
 \Else\r
-       \State $status \gets false$\r
-    \State $MSlot \gets \{slot_{s}, \dots, slot_{sn_n}\} \forall $\r
-    $slot_i = \langle i,E( \langle k,v \rangle ) \rangle \in Q$\r
+       \State \Return{$(false,\{\langle i,sv_i \rangle \in Q \mid \r
+    s' \leq i \leq s_n\})$}\r
 \EndIf\r
-\State \Return{$\langle status,MSlot \rangle$}\Comment{Return missed updates and status}\r
 \EndFunction\r
 \end{algorithmic}\r
 \r