From 9211fb445e19f8563930b20f7e34d17d1cdc3eb8 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Mon, 11 Jul 2016 14:41:25 -0700 Subject: [PATCH] Renaming Get and Put into GetSlot and PutSlot; Cleaning up PutSlot --- doc/iotcloud.tex | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/doc/iotcloud.tex b/doc/iotcloud.tex index 315b84e..78fee74 100644 --- a/doc/iotcloud.tex +++ b/doc/iotcloud.tex @@ -135,37 +135,31 @@ $slot_s = \tuple{s, sv} \in Q \subseteq SN \times SV$ \\ \textit{n = number of slots} \\ \begin{algorithmic}[1] -\Function{Get}{$s'$} +\Function{GetSlot}{$s'$} \State \Return{$\{\tuple{s, sv} \in Q \mid s \geq s'\}$} \EndFunction \end{algorithmic} \begin{algorithmic}[1] -\Function{Put}{$s,newMax,newSlot$} -\If{$(newMax \neq \emptyset) \land (newMax > max)$}\Comment{Resize} - \State $Q' \gets \{slot_1, slot_2, \dots, slot_{newMax}\} \forall slot_i = 0 - \Leftrightarrow Q' = \emptyset$ +\Function{PutSlot}{$s',sv',max'$} +\If{$(max' \neq \emptyset) \land (max' > max)$}\Comment{Resize} + \State $Q' \gets new\:queue\:of\:\langle s,sv \rangle\:with + \:size\:max'$ \State $Q \gets Q' \cup Q$ - \State $max \gets newMax$ + \State $max \gets max'$ \EndIf -\If{$(s = sn_n + d)$} +\If{$(s' = s_n + d)$} \If{$n = max$} - \State $Q \gets Q - \{slot_{sn_1}\}$ - \State $SN \gets SN - \{sn_1\}$ - \State $Q \gets Q \cup newSlot$ + \State $Q \gets Q - \{\langle s_n,sv_n \rangle\}$ \Else \Comment{$n < max$} - \State $Q \gets Q \cup newSlot$ \State $n \gets n + 1$ \EndIf - \State $SN \gets SN \cup \{s\: |\: s = new\: sn_n\}$ - \State $status \gets true$ - \State $MSlot \gets \emptyset$ + \State $Q \gets Q \cup \{\langle s',sv' \rangle\}$ + \State \Return{$true$} \Else - \State $status \gets false$ - \State $MSlot \gets \{slot_{s}, \dots, slot_{sn_n}\} \forall $ - $slot_i = \langle i,E( \langle k,v \rangle ) \rangle \in Q$ + \State \Return{$(false,\{\langle i,sv_i \rangle \in Q \mid + s' \leq i \leq s_n\})$} \EndIf -\State \Return{$\langle status,MSlot \rangle$}\Comment{Return missed updates and status} \EndFunction \end{algorithmic} -- 2.34.1