Theory DistributedExecution
subsection ‹Network Model \label{sec:networkModel}›
text ‹In the past subsections, we described the algorithms each peer uses to integrate received
messages and broadcast new messages when an edit operation has been made on that peer.
In this section, we model the WOOT Framework as a distributed application and set the
basis for the consistency properties, we want to establish.
We assume a finite set of peers starting with the same initial state of an empty W-string, each
peer reaches a finite set of subsequent states, caused by the integration of received (or locally
generated messages). A message is always generated from a concrete state of a peer, using the
algorithms described in Section \ref{sec:edit}. Moreover, we assume that the same message will only
be delivered once to a peer. Finally, we assume that the happened before relation, formed by
\begin{itemize}
\item Subsequent states of the same peer
\item States following the reception and states that were the generation sites
\end{itemize}
do not contain loops. (Equivalently that the transitive closure of the relation is a strict
partial order.)
The latter is a standard assumption in the modelling of distributed systems (compare e.g.
\<^cite>‹‹Chapter 6.1› in "raynal2013"›) effectively implied by the fact that there are no physical causal
loops.
Additionally, we assume that a message will be only received by a peer, when the antecedent
messages have already been received by the peer. This is a somewhat technical assumption to
simplify the description of the system. In a practical implementation a peer would buffer the set
of messages that cannot yet be integrated. Note that this assumption is automatically implied if
causal delivery is assumed.
We establish two properties under the above assumptions
\begin{itemize}
\item The integration algorithm never fails.
\item Two peers having received the same set of messages will be in the same state.
\end{itemize}
The model assumptions are derived from Gomes et al.\<^cite>‹"gomes2017verifying"› and
Shapiro et al.\<^cite>‹"shapiro:inria-00555588"› with minor modifications required for WOOT.›
theory DistributedExecution
imports IntegrateAlgorithm CreateAlgorithms "HOL-Library.Product_Lexorder"
begin
type_synonym 'p event_id = "'p × nat"