46 lines
1.2 KiB
TeX
46 lines
1.2 KiB
TeX
We define $k$ as the id of the round \\
|
|
the $getMax(..)$ function able to return the highest round played in the system.
|
|
|
|
\begin{algorithm}[H]
|
|
\DontPrintSemicolon
|
|
\SetAlgoLined
|
|
\KwIn{le message $m$}
|
|
\BlankLine
|
|
\While{true}{
|
|
proves = READ() \\
|
|
k = getMax(dump) + 1 \\
|
|
APPEND(k || m) \\
|
|
\If{PROVE(k)}{
|
|
APPEND(k) \\
|
|
return
|
|
}
|
|
}
|
|
\caption{AB\_Broadcast}
|
|
\end{algorithm}
|
|
|
|
We define $k\_max$ as an intager \\
|
|
$getMax(..)$ function able to return the highest round played in the system. \\
|
|
% $proves_r$ as the sub set of proves with only the valid proves associated to the round r \\
|
|
$proves_r \subseteq proves$ s.a. $\forall PROVE(x) \in proves_r$, x is in the form $r || m$ with $m$ who cannot be empty \\
|
|
$proves_r^i$ is the $PROVE(r || m )$ operation submited by the process i if exist \\
|
|
|
|
\begin{algorithm}[H]
|
|
\DontPrintSemicolon
|
|
\SetAlgoLined
|
|
\BlankLine
|
|
\While{true}{
|
|
proves = READ() \\
|
|
k\_max = getMax(proves) \\
|
|
\For{r=k+1 \emph{\KwTo} k\_max}{
|
|
APPEND(r)\\
|
|
$proves_r$ = \{$\forall i, PROVE(r)_i \in READ()$\} \\
|
|
\For{i = 1 \emph{\KwTo} $|P|$}{
|
|
\If{$\exists PROVE(r)_i \in proves_r$}{
|
|
AB\_Recv($m$ s.t. $PROVE(r || m) \in proves$)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
\caption{AB\_Listen}
|
|
\end{algorithm} |