Theory UteDefs
theory UteDefs
imports "../HOModel"
begin
section ‹Verification of the \ute{} Consensus Algorithm›
text ‹
Algorithm \ute{} is presented in~\<^cite>‹"biely:tolerating"›. It is an
uncoordinated algorithm that tolerates value (a.k.a.\ Byzantine) faults,
and can be understood as a variant of \emph{UniformVoting}. The parameters
$T$, $E$, and $\alpha$ appear as thresholds of the algorithm and in the
communication predicates. Their values can be chosen within certain bounds
in order to adapt the algorithm to the characteristics of different systems.
We formalize in Isabelle the correctness proof of the algorithm that
appears in~\<^cite>‹"biely:tolerating"›, using the framework of theory
‹HOModel›.
›
subsection ‹Model of the Algorithm›
text ‹
We begin by introducing an anonymous type of processes of finite
cardinality that will instantiate the type variable ‹'proc›
of the generic HO model.
›
typedecl Proc
axiomatization where Proc_finite: "OFCLASS(Proc, finite_class)"
instance Proc :: finite by (rule Proc_finite)
abbreviation
"N ≡ card (UNIV::Proc set)"
text ‹
The algorithm proceeds in \emph{phases} of $2$ rounds each (we call
\emph{steps} the individual rounds that constitute a phase).
The following utility functions compute the phase and step of a round,
given the round number.
›
abbreviation
"nSteps ≡ 2"
definition phase where "phase (r::nat) ≡ r div nSteps"
definition step where "step (r::nat) ≡ r mod nSteps"
lemma phase_zero [simp]: "phase 0 = 0"
by (simp add: phase_def)
lemma step_zero [simp]: "step 0 = 0"
by (simp add: step_def)
lemma phase_step: "(phase r * nSteps) + step r = r"
by (auto simp add: phase_def step_def)
text ‹The following record models the local state of a process.›
record 'val pstate =
x :: 'val
vote :: "'val option"
decide :: "'val option"
text ‹Possible messages sent during the execution of the algorithm.›