@@ -23,6 +23,8 @@ This definition varies slightly from the original one in~\cite{catlogic}.
An element $x \in\cofe$ of a COFE is called \emph{discrete} if
\[\All y \in\cofe. x \nequiv{0} y \Ra x = y\]
A COFE $A$ is called \emph{discrete} if all its elements are discrete.
For a set $X$, we write $\Delta X$ for the discrete COFE with $x \nequiv{n} x' \eqdef x = x'$
\end{defn}
\begin{defn}
...
...
@@ -31,6 +33,7 @@ This definition varies slightly from the original one in~\cite{catlogic}.
It is \emph{contractive} if
\[\All n, x \in\cofe, y \in\cofe. (\All m < n. x \nequiv{m} y)\Ra f(x)\nequiv{n} f(x)\]
\end{defn}
The reason that contractive functions are interesting is that for every contractive $f : \cofe\to\cofe$ with $\cofe$ inhabited, there exists a fixed-point $\fix(f)$ such that $\fix(f)= f(\fix(f))$.
\begin{defn}
The category $\COFEs$ consists of COFEs as objects, and non-expansive functions as arrows.
@@ -33,7 +33,7 @@ We start by defining the COFE of \emph{step-indexed propositions}: For every ste
\end{align*}
Now we can rewrite $\UPred(\monoid)$ as monotone step-indexed predicates over $\monoid$, where the definition of a ``monotone'' function here is a little funny.
\begin{align*}
\UPred(\monoid) \approx{}&\monoid\monra\SProp\\
\UPred(\monoid) \cong{}&\monoid\monra\SProp\\
\eqdef{}&\setComp{\pred: \monoid\nfn\SProp}{\All n, m, x, y. n \in\pred(x) \land x \mincl y \land m \leq n \land y \in\mval_m \Ra m \in\pred(y)}
\end{align*}
The reason we chose the first definition is that it is easier to work with in Coq.
...
...
@@ -77,35 +77,35 @@ $K \fpfn (-)$ is a locally non-expansive functor from $\CMRAs$ to $\CMRAs$.
\subsection{Agreement}
Given some COFE $\cofe$, we define $\agm(\cofe)$ as follows:
\newcommand{\agc}{\mathrm{c}}% the "c" field of an agreement element
\newcommand{\agV}{\mathrm{V}}% the "V" field of an agreement element
\newcommand{\aginjc}{\mathrm{c}}% the "c" field of an agreement element
\newcommand{\aginjV}{\mathrm{V}}% the "V" field of an agreement element
\melt\equiv\meltB\eqdef{}&\melt.\agV = \meltB.\agV\land\All n. n \in\melt.\agV\Ra\melt.\agc(n) \nequiv{n}\meltB.\agc(n) \\
\melt\nequiv{n}\meltB\eqdef{}& (\All m \leq n. m \in\melt.\agV\Lra m \in\meltB.\agV) \land (\All m \leq n. m \in\melt.\agV\Ra\melt.\agc(m) \nequiv{m}\meltB.\agc(m)) \\
\mval_n \eqdef{}&\setComp{\melt\in\monoid}{ n \in\melt.\agV\land\All m \leq n. \melt.\agc(n) \nequiv{m}\melt.\agc(m) }\\
\melt\equiv\meltB\eqdef{}&\melt.\aginjV = \meltB.\aginjV\land\All n. n \in\melt.\aginjV\Ra\melt.\aginjc(n) \nequiv{n}\meltB.\aginjc(n) \\
\melt\nequiv{n}\meltB\eqdef{}& (\All m \leq n. m \in\melt.\aginjV\Lra m \in\meltB.\aginjV) \land (\All m \leq n. m \in\melt.\aginjV\Ra\melt.\aginjc(m) \nequiv{m}\meltB.\aginjc(m)) \\
\mval_n \eqdef{}&\setComp{\melt\in\monoid}{ n \in\melt.\aginjV\land\All m \leq n. \melt.\aginjc(n) \nequiv{m}\melt.\aginjc(m) }\\
\mcore\melt\eqdef{}&\melt\\
\melt\mtimes\meltB\eqdef{}& (\melt.\agc, \setComp{n}{n \in\melt.\agV\land n \in\meltB.\agV\land\melt\nequiv{n}\meltB})
\melt\mtimes\meltB\eqdef{}& (\melt.\aginjc, \setComp{n}{n \in\melt.\aginjV\land n \in\meltB.\aginjV\land\melt\nequiv{n}\meltB})
\end{align*}
$\agm(-)$ is a locally non-expansive functor from $\COFEs$ to $\CMRAs$.
You can think of the $\agc$ as a \emph{chain} of elements of $\cofe$ that has to converge only for $n \in\agV$ steps.
You can think of the $\aginjc$ as a \emph{chain} of elements of $\cofe$ that has to converge only for $n \in\aginjV$ steps.
The reason we store a chain, rather than a single element, is that $\agm(\cofe)$ needs to be a COFE itself, so we need to be able to give a limit for every chain of $\agm(\cofe)$.
However, given such a chain, we cannot constructively define its limit: Clearly, the $\agV$ of the limit is the limit of the $\agV$ of the chain.
However, given such a chain, we cannot constructively define its limit: Clearly, the $\aginjV$ of the limit is the limit of the $\aginjV$ of the chain.
But what to pick for the actual data, for the element of $\cofe$?
Only if $\agV=\mathbb{N}$ we have a chain of $\cofe$ that we can take a limit of; if the $\agV$ is smaller, the chain ``cancels'', \ie stops converging as we reach indices $n \notin\agV$.
Only if $\aginjV=\mathbb{N}$ we have a chain of $\cofe$ that we can take a limit of; if the $\aginjV$ is smaller, the chain ``cancels'', \ie stops converging as we reach indices $n \notin\aginjV$.
To mitigate this, we apply the usual construction to close a set; we go from elements of $\cofe$ to chains of $\cofe$.
We define an injection $\ag$ into $\agm(\cofe)$ as follows:
\[\ag(x)\eqdef\record{\mathrm c \eqdef\Lam\any. x, \mathrm V \eqdef\mathbb{N}}\]
We define an injection $\aginj$ into $\agm(\cofe)$ as follows:
\[\aginj(x)\eqdef\record{\mathrm c \eqdef\Lam\any. x, \mathrm V \eqdef\mathbb{N}}\]
There are no interesting frame-preserving updates for $\agm(\cofe)$, but we can show the following: