@@ -42,7 +42,7 @@ Now we can rewrite $\UPred(\monoid)$ as monotone step-indexed predicates over $\
...
@@ -42,7 +42,7 @@ Now we can rewrite $\UPred(\monoid)$ as monotone step-indexed predicates over $\
The reason we chose the first definition is that it is easier to work with in Coq.
The reason we chose the first definition is that it is easier to work with in Coq.
\clearpage
\clearpage
\section{CMRA constructions}
\section{RA and CMRA constructions}
\subsection{Product}
\subsection{Product}
\label{sec:prodm}
\label{sec:prodm}
...
@@ -378,54 +378,79 @@ We obtain the following frame-preserving update:
...
@@ -378,54 +378,79 @@ We obtain the following frame-preserving update:
% }
% }
% \end{mathpar}
% \end{mathpar}
% \subsection{STS with tokens monoid}
\subsection{STS with tokens}
% \label{sec:stsmon}
\label{sec:stsmon}
% Given a state-transition system~(STS) $(\STSS, \ra)$, a set of tokens $\STSS$, and a labeling $\STSL: \STSS \ra \mathcal{P}(\STST)$ of \emph{protocol-owned} tokens for each state, we construct a monoid modeling an authoritative current state and permitting transitions given a \emph{bound} on the current state and a set of \emph{locally-owned} tokens.
Given a state-transition system~(STS, \ie a directed graph) $(\STSS, {\stsstep}\subseteq\STSS\times\STSS)$, a set of tokens $\STST$, and a labeling $\STSL: \STSS\ra\wp(\STST)$ of \emph{protocol-owned} tokens for each state, we construct a monoid modeling an authoritative current state and permitting transitions given a \emph{bound} on the current state and a set of \emph{locally-owned} tokens.
% The construction follows the idea of STSs as described in CaReSL \cite{caresl}.
The construction follows the idea of STSs as described in CaReSL \cite{caresl}.
% We first lift the transition relation to $\STSS \times \mathcal{P}(\STST)$ (implementing a \emph{law of token conservation}) and define upwards closure:
We first lift the transition relation to $\STSS\times\wp(\STST)$ (implementing a \emph{law of token conservation}) and define a stepping relation for the \emph{frame} of a given token set:
% \begin{align*}
\begin{align*}
% (s, T) \ra (s', T') \eqdef&\, s \ra s' \land \STSL(s) \uplus T = \STSL(s') \uplus T' \\
(s, T) \stsstep (s', T') \eqdef{}& s \stsstep s' \land\STSL(s) \uplus T = \STSL(s') \uplus T' \\
s \stsfstep{T} s' \eqdef{}&\Exists T_1, T_2. T_1 \sep\STSL(s) \cup T \l+and (s, T_1) \stsstep (s', T_2)
% \upclose(S, T) \eqdef&\, \setComp{ s' \in \STSS}{\exists s \in S.\; \textsf{frame}(s, T) \ststrans \textsf{frame}(s', T) }
\end{align*}
% \end{align*}
% \noindent
We further define \emph{closed} sets of states (given a particular set of tokens) as well as the \emph{closure} of a set:
% We have
\begin{align*}
% \begin{quote}
\STSclsd(S, T) \eqdef{}&\All s \in S. \STSL(s) \sep T \land\All s'. s \stsfstep{T} s' \Ra s' \in S \\
% If $(s, T) \ra (s', T')$\\
\upclose(S, T) \eqdef{}&\setComp{ s' \in\STSS}{\Exists s \in S. s \stsftrans{T} s' }
% and $T_\f \sep (T \uplus \STSL(s))$,\\
\end{align*}
% then $\textsf{frame}(s, T_\f) \ra \textsf{frame}(s', T_\f)$.
% \end{quote}
% \begin{proof}
% This follows directly by framing the tokens in $\STST \setminus (T_\f \uplus T \uplus \STSL(s))$ around the given transition, which yields $(s, \STST \setminus (T_\f \uplus \STSL{T}(s))) \ra (s', T' \uplus (\STST \setminus (T_\f \uplus T \uplus \STSL{T}(s))))$.
% This is exactly what we have to show, since we know $\STSL(s) \uplus T = \STSL(s') \uplus T'$.
% \end{proof}
% Let $\STSMon{\STSS}$ be the monoid with carrier
The STS RA is defined as follows
% \[
\begin{align*}
% \setComp{ (s, S, T) \in \exm{\STSS} \times \mathcal{P}(\STSS) \times \mathcal{P}(\STST) }{ \begin{aligned} &(s = \munit \lor s \in S) \land \upclose(S, T) = S \land{} \\& S \neq \emptyset \land \All s \in S. \STSL(s) \sep T \end{aligned} }
% Some sugar makes it more convenient to assert being at least in a certain state and owning some tokens: $(s, T) : \STSMon{\STSS} \eqdef (\munit, \upclose(\{s\}, T), T) : \STSMon{\STSS}$, and
We will need the following frame-preserving update:
% Assume some upwards-closed $S_\f, T_\f$ (the frame cannot be authoritative) s.t.\ $s \in S_\f$ and $T_\f \sep (T \uplus \STSL(s))$. We have to show that this frame combines with our final monoid element, which is the case if $s' \in S_\f$ and $T_\f \sep T'$.
The core of the STS construction is only satisfying the RA axioms because we are \emph{not} demanding the core to be a homomorphism---all we demand is for the core to be monotone with respect the \ruleref{ra-incl}.
% By upward-closedness, it suffices to show $\textsf{frame}(s, T_\f) \ststrans \textsf{frame}(s', T_\f)$.
% This follows by induction on the path $(s, T) \ststrans (s', T')$, and using the lemma proven above for each step.
In other words, the following does \emph{not} hold for the STS core as defined above: