Commit 83979416 authored by Ralf Jung's avatar Ralf Jung
Browse files

move \text... to their respective sections; get rid of \fork

parent b45812dd
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
\section{Parameters to the logic} \section{Parameters to the logic}
\begin{itemize} \begin{itemize}
\item A set \textdom{Exp} of \emph{expressions} (metavariable $\expr$) with a % \item A set \textdom{Exp} of \emph{expressions} (metavariable $\expr$) with a
subset \textdom{Val} of values ($\val$). We assume that if $\expr$ is an % subset \textdom{Val} of values ($\val$). We assume that if $\expr$ is an
expression then so is $\fork{\expr}$. We moreover assume a value % expression then so is $\fork{\expr}$. We moreover assume a value
\textsf{fRet} (giving the intended return value of a fork), and we assume that % \textsf{fRet} (giving the intended return value of a fork), and we assume that
\begin{align*} % \begin{align*}
\fork{\expr} &\notin \textdom{Val} \\ % \fork{\expr} &\notin \textdom{Val} \\
\fork{\expr_1} = \fork{\expr_2} &\implies \expr_1 = \expr_2 % \fork{\expr_1} = \fork{\expr_2} &\implies \expr_1 = \expr_2
\end{align*} % \end{align*}
\item A set $\textdom{Ectx}$ of \emph{evaluation contexts} ($\ectx$) that includes the empty context $[\; ]$, \item A set $\textdom{Ectx}$ of \emph{evaluation contexts} ($\ectx$) that includes the empty context $[\; ]$,
a plugging operation $\ectx[\expr]$ that produces an expression, and context composition $\circ$ a plugging operation $\ectx[\expr]$ that produces an expression, and context composition $\circ$
satisfying the following axioms: satisfying the following axioms:
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
\ectx[\expr_1] = \ectx[\expr_2] &\implies \expr_1 = \expr_2 \\ \ectx[\expr_1] = \ectx[\expr_2] &\implies \expr_1 = \expr_2 \\
\ectx_1 \circ \ectx_2 = [\; ] &\implies \ectx_1 = \ectx_2 = [\; ] \\ \ectx_1 \circ \ectx_2 = [\; ] &\implies \ectx_1 = \ectx_2 = [\; ] \\
\ectx[\expr] \in \textdom{Val} &\implies \ectx = [\;] \\ \ectx[\expr] \in \textdom{Val} &\implies \ectx = [\;] \\
\ectx[\expr] = \fork{\expr'} &\implies \ectx = [\;] % \ectx[\expr] = \fork{\expr'} &\implies \ectx = [\;]
\end{align*} \end{align*}
\item A set \textdom{State} of shared machine states (\eg heaps), metavariable $\state$. \item A set \textdom{State} of shared machine states (\eg heaps), metavariable $\state$.
...@@ -34,14 +34,14 @@ and notions of an expression to be \emph{reducible} or \emph{stuck}, such that ...@@ -34,14 +34,14 @@ and notions of an expression to be \emph{reducible} or \emph{stuck}, such that
\lnot \textlog{reducible}(\expr') \lnot \textlog{reducible}(\expr')
\end{align*} \end{align*}
and the following hold and the following hold
\begin{align*} % \begin{align*}
&\textlog{stuck}(\fork{\expr})& \\ % &\textlog{stuck}(\fork{\expr})& \\
&\textlog{stuck}(\val)&\\ % &\textlog{stuck}(\val)&\\
&\ectx[\expr] = \ectx'[\expr'] \implies \textlog{reducible}(\expr') \implies % &\ectx[\expr] = \ectx'[\expr'] \implies \textlog{reducible}(\expr') \implies
\expr \notin \textdom{Val} \implies \Exists \ectx''. \ectx' = \ectx \circ \ectx'' &\mbox{(step-by-value)} \\ % \expr \notin \textdom{Val} \implies \Exists \ectx''. \ectx' = \ectx \circ \ectx'' &\mbox{(step-by-value)} \\
&\ectx[\expr] = \ectx'[\fork{\expr'}] \implies % &\ectx[\expr] = \ectx'[\fork{\expr'}] \implies
\expr \notin \textdom{Val} \implies \Exists \ectx''. \ectx' = \ectx \circ \ectx'' &\mbox{(fork-by-value)} \\ % \expr \notin \textdom{Val} \implies \Exists \ectx''. \ectx' = \ectx \circ \ectx'' &\mbox{(fork-by-value)} \\
\end{align*} % \end{align*}
\item A predicate \textlog{atomic} on expressions satisfying \item A predicate \textlog{atomic} on expressions satisfying
\begin{align*} \begin{align*}
...@@ -78,11 +78,11 @@ Let $\mcarp{M} \eqdef |\monoid| \setminus \{\mzero\}$. ...@@ -78,11 +78,11 @@ Let $\mcarp{M} \eqdef |\monoid| \setminus \{\mzero\}$.
{\cfg{\state}{\expr} \step \cfg{\state'}{\expr'}} {\cfg{\state}{\expr} \step \cfg{\state'}{\expr'}}
{\cfg{\state}{\tpool [i \mapsto \ectx[\expr]]} \step {\cfg{\state}{\tpool [i \mapsto \ectx[\expr]]} \step
\cfg{\state'}{\tpool [i \mapsto \ectx[\expr']]}} \cfg{\state'}{\tpool [i \mapsto \ectx[\expr']]}}
\and % \and
\infer % \infer
{} % {}
{\cfg{\state}{\tpool [i \mapsto \ectx[\fork{\expr}]]} \step % {\cfg{\state}{\tpool [i \mapsto \ectx[\fork{\expr}]]} \step
\cfg{\state}{\tpool [i \mapsto \ectx[\textsf{fRet}]] [j \mapsto \expr]}} % \cfg{\state}{\tpool [i \mapsto \ectx[\textsf{fRet}]] [j \mapsto \expr]}}
\end{mathpar} \end{mathpar}
\section{Syntax} \section{Syntax}
...@@ -567,10 +567,10 @@ We write $\provesalways$ to denote judgments that can only be extended with a bo ...@@ -567,10 +567,10 @@ We write $\provesalways$ to denote judgments that can only be extended with a bo
{\hoare{\prop}{\expr}{\Ret\val. \propB}[\mask] \and \text{$\expr$ not a value} {\hoare{\prop}{\expr}{\Ret\val. \propB}[\mask] \and \text{$\expr$ not a value}
} }
{\hoare{\prop * \later\propC}{\expr}{\Ret\val. \propB * \propC}[\mask \uplus \mask']} {\hoare{\prop * \later\propC}{\expr}{\Ret\val. \propB * \propC}[\mask \uplus \mask']}
\and % \and
\inferH{Fork} % \inferH{Fork}
{\hoare{\prop}{\expr}{\Ret\any. \TRUE}[\top]} % {\hoare{\prop}{\expr}{\Ret\any. \TRUE}[\top]}
{\hoare{\later\prop * \later\propB}{\fork{\expr}}{\Ret\val. \val = \textsf{fRet} \land \propB}[\mask]} % {\hoare{\later\prop * \later\propB}{\fork{\expr}}{\Ret\val. \val = \textsf{fRet} \land \propB}[\mask]}
\and \and
\inferH{ACsq} \inferH{ACsq}
{\prop \vs[\mask \uplus \mask'][\mask] \prop' \\ {\prop \vs[\mask \uplus \mask'][\mask] \prop' \\
......
...@@ -389,28 +389,28 @@ $\rho\nequiv{n} \rho' \iff n=0 \lor \bigl(\dom(\rho)=\dom(\rho') \land ...@@ -389,28 +389,28 @@ $\rho\nequiv{n} \rho' \iff n=0 \lor \bigl(\dom(\rho)=\dom(\rho') \land
\typedsection{Weakest precondition}{\mathit{wp} : \Delta(\pset{\mathbb{N}}) \times \Delta(\textdom{Exp}) \times (\Delta(\textdom{Val}) \to \textdom{Prop}) \to \textdom{Prop} \in {\cal U}} \typedsection{Weakest precondition}{\mathit{wp} : \Delta(\pset{\mathbb{N}}) \times \Delta(\textdom{Exp}) \times (\Delta(\textdom{Val}) \to \textdom{Prop}) \to \textdom{Prop} \in {\cal U}}
\begin{align*} % \begin{align*}
\mathit{wp}_\mask(\expr, q) &\eqdef \Lam W. % \mathit{wp}_\mask(\expr, q) &\eqdef \Lam W.
\begin{aligned}[t] % \begin{aligned}[t]
\{\, (n, \rs) &\mid \All W_F \geq W; k \leq n; \rs_F; \state; \mask_F \sep \mask. k > 0 \land k \in (\fullSat{\state}{\mask \cup \mask_F}{\rs \rtimes \rs_F}{W_F}) \implies{}\\ % \{\, (n, \rs) &\mid \All W_F \geq W; k \leq n; \rs_F; \state; \mask_F \sep \mask. k > 0 \land k \in (\fullSat{\state}{\mask \cup \mask_F}{\rs \rtimes \rs_F}{W_F}) \implies{}\\
&\qquad % &\qquad
(\expr \in \textdom{Val} \implies \Exists W' \geq W_F. \Exists \rs'. \\ % (\expr \in \textdom{Val} \implies \Exists W' \geq W_F. \Exists \rs'. \\
&\qquad\qquad % &\qquad\qquad
k \in (\fullSat{\state}{\mask \cup \mask_F}{\rs' \rtimes \rs_F}{W'}) \land (k, \rs') \in q(\expr)(W'))~\land \\ % k \in (\fullSat{\state}{\mask \cup \mask_F}{\rs' \rtimes \rs_F}{W'}) \land (k, \rs') \in q(\expr)(W'))~\land \\
&\qquad % &\qquad
(\All\ectx,\expr_0,\expr'_0,\state'. \expr = \ectx[\expr_0] \land \cfg{\state}{\expr_0} \step \cfg{\state'}{\expr'_0} \implies \Exists W' \geq W_F. \Exists \rs'. \\ % (\All\ectx,\expr_0,\expr'_0,\state'. \expr = \ectx[\expr_0] \land \cfg{\state}{\expr_0} \step \cfg{\state'}{\expr'_0} \implies \Exists W' \geq W_F. \Exists \rs'. \\
&\qquad\qquad % &\qquad\qquad
k - 1 \in (\fullSat{\state'}{\mask \cup \mask_F}{\rs' \rtimes \rs_F}{W'}) \land (k-1, \rs') \in wp_\mask(\ectx[\expr_0'], q)(W'))~\land \\ % k - 1 \in (\fullSat{\state'}{\mask \cup \mask_F}{\rs' \rtimes \rs_F}{W'}) \land (k-1, \rs') \in wp_\mask(\ectx[\expr_0'], q)(W'))~\land \\
&\qquad % &\qquad
(\All\ectx,\expr'. \expr = \ectx[\fork{\expr'}] \implies \Exists W' \geq W_F. \Exists \rs', \rs_1', \rs_2'. \\ % (\All\ectx,\expr'. \expr = \ectx[\fork{\expr'}] \implies \Exists W' \geq W_F. \Exists \rs', \rs_1', \rs_2'. \\
&\qquad\qquad % &\qquad\qquad
k - 1 \in (\fullSat{\state}{\mask \cup \mask_F}{\rs' \rtimes \rs_F}{W'}) \land \rs' = \rs_1' \rtimes \rs_2'~\land \\ % k - 1 \in (\fullSat{\state}{\mask \cup \mask_F}{\rs' \rtimes \rs_F}{W'}) \land \rs' = \rs_1' \rtimes \rs_2'~\land \\
&\qquad\qquad % &\qquad\qquad
(k-1, \rs_1') \in \mathit{wp}_\mask(\ectx[\textsf{fRet}], q)(W') \land % (k-1, \rs_1') \in \mathit{wp}_\mask(\ectx[\textsf{fRet}], q)(W') \land
(k-1, \rs_2') \in \mathit{wp}_\top(\expr', \Lam\any. \top)(W')) % (k-1, \rs_2') \in \mathit{wp}_\top(\expr', \Lam\any. \top)(W'))
\,\} % \,\}
\end{aligned} % \end{aligned}
\end{align*} % \end{align*}
\begin{lem} \begin{lem}
$\mathit{wp}$ is well-defined: $\mathit{wp}_{\mask}(\expr, q)$ is a valid proposition, and $\mathit{wp}$ is a non-expansive map. Besides, the dependency on the recursive occurrence is contractive, so $\mathit{wp}$ has a fixed-point. $\mathit{wp}$ is well-defined: $\mathit{wp}_{\mask}(\expr, q)$ is a valid proposition, and $\mathit{wp}$ is a non-expansive map. Besides, the dependency on the recursive occurrence is contractive, so $\mathit{wp}$ has a fixed-point.
\end{lem} \end{lem}
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SETUP %% SETUP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SetSymbolFont{stmry}{bold}{U}{stmry}{m}{n} % this fixes warnings when \boldsymbol is used with stmaryrd included
\extrarowheight=\jot % else, arrays are scrunched compared to, say, aligned \extrarowheight=\jot % else, arrays are scrunched compared to, say, aligned
\newcolumntype{.}{@{}} \newcolumntype{.}{@{}}
...@@ -84,17 +85,6 @@ ...@@ -84,17 +85,6 @@
\newtheorem{thm}{Theorem} \newtheorem{thm}{Theorem}
\newtheorem{exercise}{Exercise} \newtheorem{exercise}{Exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% FONTS & FORMATTING
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SetSymbolFont{stmry}{bold}{U}{stmry}{m}{n} % this fixes warnings when \boldsymbol is used with stmaryrd included
\newcommand{\textdom}[1]{\textit{#1}}
\newcommand{\textlog}[1]{\textsf{#1}}
\newcommand{\textsort}[1]{\textlog{#1}}
\newcommand{\textlang}[1]{\texttt{#1}}
\newcommand{\textmon}[1]{\textsc{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% GENERIC MACROS %% GENERIC MACROS
...@@ -217,6 +207,8 @@ ...@@ -217,6 +207,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CMRA (RESOURCE ALGEBRA) SYMBOLS & NOTATION & IDENTIFIERS % CMRA (RESOURCE ALGEBRA) SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textmon}[1]{\textsc{#1}}
\newcommand{\monoid}{M} \newcommand{\monoid}{M}
\newcommand{\melt}{a} \newcommand{\melt}{a}
...@@ -238,6 +230,7 @@ ...@@ -238,6 +230,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MODEL-SPECIFIC SYMBOLS & NOTATION & IDENTIFIERS %% MODEL-SPECIFIC SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textdom}[1]{\textit{#1}}
\newcommand{\wIso}{\xi} \newcommand{\wIso}{\xi}
...@@ -245,7 +238,7 @@ ...@@ -245,7 +238,7 @@
\newcommand{\rsB}{s} \newcommand{\rsB}{s}
\newcommand{\pres}{\pi} \newcommand{\pres}{\pi}
\newcommand{\wld}{w}
\newcommand{\ghostRes}{g} \newcommand{\ghostRes}{g}
%% Various pieces of syntax %% Various pieces of syntax
...@@ -276,6 +269,8 @@ ...@@ -276,6 +269,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOGIC SYMBOLS & NOTATION & IDENTIFIERS %% LOGIC SYMBOLS & NOTATION & IDENTIFIERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textlog}[1]{\textsf{#1}}
\newcommand{\textsort}[1]{\textlog{#1}}
\newcommand{\Sig}{\mathcal{S}} \newcommand{\Sig}{\mathcal{S}}
\newcommand{\SigType}{\mathcal{T}} \newcommand{\SigType}{\mathcal{T}}
...@@ -421,7 +416,7 @@ ...@@ -421,7 +416,7 @@
\newcommand{\FALSE}{\textlog{False}} \newcommand{\FALSE}{\textlog{False}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LANGUAGE-LEVEL SYNTAX AND SEMANTICS % LANGUAGE SYNTAX AND SEMANTICS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\expr}{e} \newcommand{\expr}{e}
\newcommand{\val}{v} \newcommand{\val}{v}
...@@ -433,7 +428,6 @@ ...@@ -433,7 +428,6 @@
\newcommand{\tpool}{T} \newcommand{\tpool}{T}
\newcommand{\cfg}[2]{{#1};{#2}} \newcommand{\cfg}[2]{{#1};{#2}}
\newcommand{\fork}[1]{\textlang{fork}\;{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DERIVED CONSTRUCTIONS % DERIVED CONSTRUCTIONS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment