{x_1 : U \u F A_1 \vdash\upcast{U\u F A_1}{U\u F A_2}x_1 \ltdyn\thunk\upcast{U\u F A_1}{U\u F A_2}(\lett y_1 = \force x_1; \ret y_1) \ltdyn\thunk (\lett y_1 = \force x_1; \ret\upcast{A_1}{A_2}y_1)}
\inferrule
{\inferrule
{x_1 \ltdyn\force\upcast{U\u F A_1}{U\u FA_2}x_1 \ltdyn x_1\and
{\thunk (\lett y_1 = \force x_1; \ret\upcast{A_1}{A_2}y_1) \ltdyn\thunk (\lett y_2 = \force\upcast{U\u F A_1}{U\u F A_2} x_1; \ret y_2)}}
{x_1 : U \u F A_1 \vdash\thunk (\lett y_1 = \force x_1; \ret\upcast{A_1}{A_2}y_1) \ltdyn\thunk (\lett y_2 = \force\upcast{U\u F A_1}{U\u F A_2} x_1; \ret y_2) \ltdyn\upcast{U\u F A_1}{U\u F A_2}x_1}
\caption{Exponential Interaction}
\inferrule
{\u B_1 \ltdyn\u B_2}
{\bullet:\u F U \u B_2 \vdash\dncast{\u FU\u B_1}{\u FU\u B_2}\bullet\equidyn\lett x = \bullet; \ret\thunk\force x : \u F U \u B_1}
\end{figure}
\section{Models}
To determine what sorts of dynamic type we want for different
...
...
@@ -1035,9 +1122,123 @@ Today, many years later, with the benefit of much hindsight, we can
see Levy's proof as an application of the method of \emph{focusing}.
Here we adapt that proof to get an operational semantics for
\emph{Gradual} CBPV.
\emph{Gradual} CBPV that will .
%
If we focus even more intensely we can make all upcasts between
positive connectives implicit, but allowing positive variables rules
out that possibility.
\begin{figure}[H]
\mbox{Values: $\Gamma\vdash V : A$}\\
\begin{mathpar}
\inferrule
{\Gamma\vdash\hat V : A_1 \and A_1 \ltdyn A_2}
{\Gamma\vdash\upcast{A_1}{A_2}\hat V : A_2}
\end{mathpar}
\mbox{Value Constructors: $\Gamma\vdash\hat V : A$}\\
\begin{mathpar}
\inferrule
{x : A \in\Gamma}
{\Gamma\vdash x : A}
TODO
\inferrule
{\Gamma\vdash V : A \and\Gamma\vdash V' : A'}
{\Gamma\vdash ( V, V') : A \times A'}
\inferrule
{\Gamma\vdash V : A}
{\Gamma\vdash\sigma_{A,A'} V : A + A'}
\inferrule
{\Gamma\vdash V' : A'}
{\Gamma\vdash\sigma_{A,A'}' V' : A + A'}
\inferrule
{}
{\Gamma\vdash () : 1}
\inferrule
{\Gamma\vdash M : \u B}
{\Gamma\vdash\thunk M : U \u B}
\end{mathpar}
\mbox{Terms: $\Gamma\vdash M : \u B$}
\begin{mathpar}
\inferrule
{}
{\Gamma\vdash\err_{\u B} : \u B}
\inferrule
{\Gamma\vdash V : A}
{\Gamma\vdash\ret V : \u F A}
\inferrule
{\Gamma\vdash V : U \u B\and
\Gamma\pipe [ \u B ] \vdash S : \u C
}
{\Gamma\vdash\force V; S : \u B}
\inferrule
{\Gamma, x : A \vdash M : \u B}
{\Gamma\vdash\lambda x : A. M : A \to\u B}
\inferrule
{}
{\Gamma\vdash [] : \top}
\inferrule
{\Gamma\vdash M : \u B\and
\Gamma\vdash M' : \u B'}
{\Gamma\vdash [\pi\mapsto M \pipe\pi' \mapsto M'] : \u B \wedge\u B'}
\inferrule
{\Gamma\vdash V : A \times A'\and
\Gamma, x : A, x': A' \vdash M : \u B}
{\Gamma\vdash\lett (x,x') = V; M : \u B}
\inferrule
{\Gamma\vdash V : A + A'\and
\Gamma , x:A \vdash M : \u B\and
\Gamma , x:A' \vdash M' : \u B}
{\Gamma\vdash\case V \{\sigma x \mapsto M \pipe\sigma' x' \mapsto M' \} : \u B}
\inferrule
{\Gamma\vdash\hat M : \u B_2 \and\u B_1 \ltdyn\u B_2}
{\Gamma\vdash\dncast{\u B_1}{\u B_2}\hat M : \u B_1}
\end{mathpar}
\mbox{Spines $\Gamma\pipe[\u B ]\vdash S : \u C$}
\begin{mathpar}
\inferrule
{\Gamma\pipe [ \u B_1] \vdash S : \u C \and\u B_1 \ltdyn\u B_2}
{\Gamma\pipe [\u B_2] \vdash\dncast{\u B_1}{\u B_2}; S : \u C}
\end{mathpar}
\mbox{Computation Destructors $\Gamma\pipe[\u B ]\vdash\hat S : \u C$}
\begin{mathpar}
\inferrule
{}
{\Gamma\pipe [\u B ] \vdash\bullet : \u B}
\inferrule
{\Gamma\pipe [\u B] \vdash S : \u C \and
\Gamma\vdash V : A}
{\Gamma\pipe [ A \to\u B ] \vdash 'V; S : \u C}
\inferrule
{\Gamma\pipe [\u B]\vdash S : C}
{\Gamma\pipe [\u B \wedge\u B'] \vdash\pi; S : \u C}
\inferrule
{\Gamma\pipe [\u B']\vdash S : C}
{\Gamma\pipe [\u B \wedge\u B'] \vdash\pi'; S : \u C}
\inferrule
{\Gamma, x : A \vdash M : \u C}
{\Gamma\pipe [\u F A] \vdash\too x. M : \u C}
\end{mathpar}
\caption{Operational Gradual Call By Push Value (Sketchy)}