@@ -139,17 +139,18 @@ Finally, we can define the core piece of the program logic, the proposition that
\paragraph{Defining weakest precondition.}
We assume that everything making up the definition of the language, \ie values, expressions, states, the conversion functions, reduction relation and all their properties, are suitably reflected into the logic (\ie they are part of the signature $\Sig$).
We further assume (as a parameter) a predicate $\stateinterp : \State\times\List(\Obs)\times\mathbb N \to\iProp$ that interprets the machine state as an Iris proposition, and a predicate $\pred_F: \Val\to\iProp$ that serves as postcondition for forked-off threads.
The state interpretation can depend on the current physical state, the list of \emph{future} observations as well as the total number of \emph{forked} threads (that is one less that the total number of threads).
We further assume (as a parameter) a predicate $\stateinterp : \State\times\mathbb N \times\List(\Obs)\times\mathbb N \to\iProp$ that interprets the machine state as an Iris proposition, a predicate $\pred_F: \Val\to\iProp$ that serves as postcondition for forked-off threads, and a function $n_\rhd: \mathbb N \to\mathbb N$ specifying the number of additional laters used for each physical step.
The state interpretation can depend on the current physical state, the number of steps since the begining of the execution, the list of \emph{future} observations as well as the total number of \emph{forked} threads (that is one less that the total number of threads).
It should be monotone with respect to the step counter: $\stateinterp(\state, n_s, \vec\obs, n_t)\vs[\emptyset]\stateinterp(\state, n_s, \vec\obs, n_t +1)$.
This can be instantiated, for example, with ownership of an authoritative RA to tie the physical state to fragments that are used for user-level proofs.
Finally, weakest precondition takes a parameter $\stuckness\in\set{\NotStuck, \MaybeStuck}$ indicating whether program execution is allowed to get stuck.
The $\stateinterp$ and $\pred_F$ will always be set by the context; typically, when instantiating Iris with a language, we also pick the corresponding state interpretation $\stateinterp$ and fork-postcondition $\pred_F$.
...
...
@@ -186,6 +187,14 @@ The following rules can all be derived:
@@ -217,7 +226,7 @@ The most general form of the adequacy statement is about proving properties of a
Assume we are given some $\vec\expr_1$, $\state_1$, $\vec\obs$, $\tpool_2$, $\state_2$ such that $(\vec\expr_1, \state_1)\tpsteps[\vec\obs](\tpool_2, \state_2)$, and we are also given a \emph{meta-level} property $\metaprop$ that we want to show.
To verify that $\metaprop$ holds, it is sufficient to show the following Iris entailment:
@@ -281,7 +290,7 @@ Similarly we could show that the postcondition makes adequate statements about t
\begin{cor}[Adequate postcondition]
Assume we are given some $\expr_1$ and a set $V \subseteq\Val$ such that the following holds (assuming we can talk about sets like $V$ inside the logic):
\[
\TRUE\proves\All\state_1, \vec\obs. \pvs[\top]\Exists\stuckness, \stateinterp, \pred_F. \stateinterp(\state_1,\vec\obs,0)*\wpre[\stateinterp;\pred_F]{\expr_1}[\stuckness;\top]{x.\; x \in V}
\TRUE\proves\All\state_1, \vec\obs. \pvs[\top]\Exists\stuckness, \stateinterp, \pred_F. \stateinterp(\state_1,0,\vec\obs,0)*\wpre[\stateinterp;\pred_F]{\expr_1}[\stuckness;\top]{x.\; x \in V}
\]
Then it is the case that:
\[
...
...
@@ -298,7 +307,7 @@ As a final example, we could use adequacy to show that the state $\state$ of the
\begin{cor}[Adequate state interpretation]
Assume we are given some $\expr_1$ and a set $\Sigma\subseteq\State$ such that the following holds (assuming we can talk about sets like $\Sigma$ inside the logic):
\[
\TRUE\proves\All\state_1, \vec\obs. \pvs[\top]\Exists\stuckness, \stateinterp, \pred, \pred_F. \stateinterp(\state_1,\vec\obs,0)*\wpre[\stateinterp;\pred_F]{\expr_1}[\stuckness;\top]{\pred}*(\All\state_2, m. \stateinterp(\state_2,(),m)\!\vs[\top][\emptyset]\state_2\in\Sigma)
@@ -308,7 +317,7 @@ As a final example, we could use adequacy to show that the state $\state$ of the
To show this, we assume some $\state_1, \vec\obs, \tpool_2, \state_2$ such that $([\expr_1], \state_1)\tpsteps[\vec\obs](\tpool_2, \state_2)$, and we instantiate adequacy with this execution and $\metaprop\eqdef\state_2\in\Sigma$.
Then we have to show:
\[
(\All\state_2, m. \stateinterp(\state_2,(),m)\!\vs[\top][\emptyset]\state_2\in\Sigma)\proves\consstate^{\stateinterp;[\pred];\pred_F}_{\stuckness}(\tpool_2, \state_2)\vs[\top][\emptyset]\state_2\in\Sigma