Skip to content
Snippets Groups Projects
Commit cbb43c72 authored by Yao-david Kolegain's avatar Yao-david Kolegain
Browse files

update algo variables with the variables of LA

parent dca72244
No related branches found
No related tags found
No related merge requests found
Pipeline #16514 passed
......@@ -145,15 +145,15 @@ proposed by a process. Each process $p_i, i \in [n]$ has input $x_i$ from a join
\SetAlgoLined
\Local{Map $reg_i : reg_i[1..n]:=[\bot,\dots,\bot] $.}
\BlankLine
\Fn{Propose\ $(V)$}{
\Fn{Propose\ $(x_i)$}{
% On utilise le reliable broadcast pour écrire ce qui empêche un byzantin d'envoyer
\Rbroadcast{ \small INPUT\ \normalsize$(V)$}\label{BLASWMR::L2}\;
\WaitUntil{ $\exists REG$, \small VALUES\ \normalsize$(REG)$ received from at least $n-f$ diff. processes with $REG[i] = V$}\label{BLASWMR::L3}\;
return $\bigcup{v \in REG} $.\label{BLASWMR::L4}
\Rbroadcast{ \small INPUT\ \normalsize$(x_i)$}\label{BLASWMR::L2}\;
\WaitUntil{ $\exists REG$, \small VALUES\ \normalsize$(REG)$ received from at least $n-f$ diff. processes with $REG[i] = x_i$}\label{BLASWMR::L3}\;
return $\bigcup{x \in REG} $.\label{BLASWMR::L4}
}
\When{a message \small INPUT\ \normalsize$(V)$ from $p_j$ is \Rdelivered}{
\If{ $V \in E \wedge reg_i[j] = \bot$}{\label{BLASWMR::L6}
$reg_i[j] := (V)$\label{BLASWMR::L7}\Comment*{add value and its label}
\When{a message \small INPUT\ \normalsize$(x_j)$ from $p_j$ is \Rdelivered}{
\If{ $x_j \in E \wedge reg_i[j] = \bot$}{\label{BLASWMR::L6}
$reg_i[j] := (x_j)$\label{BLASWMR::L7}\Comment*{add value and its label}
\If{$|\{k \mid reg_i[k] \neq \bot \}| \geq n-f$ \label{BLASWMR::L8}}{broadcast{ \small VALUES\ \normalsize$(reg_i)$.}}\label{BLASWMR::L9}
}
......@@ -167,15 +167,15 @@ proposed by a process. Each process $p_i, i \in [n]$ has input $x_i$ from a join
\SetAlgoLined
\Local{Map $reg_i : reg_i[1..n]:=[\bot,\dots,\bot] $.}
\BlankLine
\Fn{Propose\ $(V)$}{
\Fn{Propose\ $(x_i)$}{
% On utilise le reliable broadcast pour écrire ce qui empêche un byzantin d'envoyer
\Rbroadcast{ \small INPUT\ \normalsize$(V)$}\label{BLAALGO::L2}\;
\WaitUntil{ $\exists REG$, \small VALUES\ \normalsize$(REG)$ received from at least $n-f$ diff. processes with $REG[i] = V$}\label{BLAALGO::L3}\;
return $\bigcup{v \in REG} $.\label{BLAALGO::L4}
\Rbroadcast{ \small INPUT\ \normalsize$(x_i)$}\label{BLAALGO::L2}\;
\WaitUntil{ $\exists REG$, \small VALUES\ \normalsize$(REG)$ received from at least $n-f$ diff. processes with $REG[i] = x_i$}\label{BLAALGO::L3}\;
return $\bigcup{x \in REG} $.\label{BLAALGO::L4}
}\label{BLAALGO::L1}
\When{a message \small INPUT\ \normalsize$(V)$ from $p_j$ is \Rdelivered}{
\When{a message \small INPUT\ \normalsize$(x_j)$ from $p_j$ is \Rdelivered}{
\If{$reg_i[j] = \bot$}{\label{BLAALGO::L5}
$reg_i[j] := V$\label{BLAALGO::L6}\Comment*{add value and its label}
$reg_i[j] := x_j$\label{BLAALGO::L6}\Comment*{add value and its label}
broadcast{ \small VALUES\ \normalsize$(reg_i)$
\label{BLAALGO::L7}}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment