@@ -22002,103 +22002,107 @@ \subsection{Subtypes}
22002
22002
\begin{figure}[p]
22003
22003
\def\VSP{\vspace{4mm}}
22004
22004
\def\ExtraVSP{\vspace{2mm}}
22005
- \def\Axiom#1#2#3#4{\centerline{\inference[#1]{}{\SubtypeStd{#3}{#4}}}\VSP}
22006
- \def\Rule#1#2#3#4#5#6{\centerline{\inference[#1]{\SubtypeStd{#3}{#4}}{\SubtypeStd{#5}{#6}}}\VSP}
22007
- \def\RuleTwo#1#2#3#4#5#6#7#8{%
22008
- \centerline{\inference[#1]{\SubtypeStd{#3}{#4} & \SubtypeStd{#5}{#6}}{\SubtypeStd{#7}{#8}}}\VSP}
22009
- \def\RuleRaw#1#2#3#4#5{%
22010
- \centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
22011
- \def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
22005
+ \def\Axiom#1#2#3{\centerline{\inference[#1]{}{\SubtypeStd{#2}{#3}}}\VSP}
22006
+ \def\Rule#1#2#3#4#5{%
22007
+ \centerline{\inference[#1]{\SubtypeStd{#2}{#3}}{\SubtypeStd{#4}{#5}}}\VSP}
22008
+ \def\RuleTwo#1#2#3#4#5#6#7{%
22009
+ \centerline{\inference[#1]{\SubtypeStd{#2}{#3} & %
22010
+ \SubtypeStd{#4}{#5}}{\SubtypeStd{#6}{#7}}}\VSP}
22011
+ \def\RuleRaw#1#2#3#4{%
22012
+ \centerline{\inference[#1]{#2}{\SubtypeStd{#3}{#4}}}\VSP}
22013
+ \def\RuleRawRaw#1#2#3{\centerline{\inference[#1]{#2}{#3}}\VSP}
22012
22014
%
22013
22015
% ----------------------------------------------------------------------
22014
22016
% Omitted rules stated here, with justification for
22015
22017
% the omission.
22016
22018
% ------------------------------------------------ Right Object 1
22017
22019
% Not needed unless algorithmic: Instance of
22018
22020
% \SrnLeftVariableBound.
22019
- % \RuleRaw{\SrnRightObjectOne}{Right Object 1}{ %
22021
+ % \RuleRaw{\SrnRightObjectOne}{%
22020
22022
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22021
22023
% }{X}{\code{Object}}
22022
22024
% ------------------------------------------------ Right Object 2
22023
22025
% Not needed unless algorithmic: Instance of
22024
22026
% \SrnLeftPromotedVariable.
22025
- % \RuleRaw{\SrnRightObjectTwo}{}{%
22026
- % \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22027
+ % \RuleRaw{\SrnRightObjectTwo}{%
22028
+ % \SubtypeStd{S}{\code{Object}}}{%
22029
+ % \code{$X$\,\&\,$S$}}{\code{Object}}
22027
22030
% ------------------------------------------------ Right Object 3
22028
22031
% Not needed unless algorithmic: Derivable from
22029
22032
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22030
22033
% Future<S> <: Object).
22031
- % \RuleRaw{\SrnRightObjectThree}{}{%
22032
- % \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22034
+ % \RuleRaw{\SrnRightObjectThree}{%
22035
+ % \SubtypeStd{S}{\code{Object}}}{%
22036
+ % \code{FutureOr<$S$>}}{\code{Object}}
22033
22037
% ----------------------------------------------------------------------
22034
22038
\begin{minipage}[c]{0.49\textwidth}
22035
22039
% ------------------------------------------------ Reflexivity
22036
- \Axiom{\SrnReflexivity}{}{ T}{T}
22040
+ \Axiom{\SrnReflexivity}{T}{T}
22037
22041
\ExtraVSP
22038
22042
% ------------------------------------------------ Left Top
22039
22043
% Non-algorithmic justification for this rule: Needed
22040
22044
% to prove dynamic/void <: FutureOr<Object>?.
22041
- \RuleRaw{\SrnLeftTop}{}{ %
22045
+ \RuleRaw{\SrnLeftTop}{%
22042
22046
S \in \{\DYNAMIC, \VOID\}\\
22043
22047
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22044
22048
% ------------------------------------------------ Left Bottom
22045
- \Axiom{\SrnBottom}{}{ \code{Never}}{T}
22049
+ \Axiom{\SrnBottom}{\code{Never}}{T}
22046
22050
% ------------------------------------------------ Left Null 1
22047
- \Axiom{\SrnNullOne}{}{ \code{Null}}{\code{$T$?}}
22051
+ \Axiom{\SrnNullOne}{\code{Null}}{\code{$T$?}}
22048
22052
\end{minipage}
22049
22053
\begin{minipage}[c]{0.49\textwidth}
22050
22054
% ------------------------------------------------ Right Top
22051
- \RuleRaw{\SrnRightTop}{}{ %
22055
+ \RuleRaw{\SrnRightTop}{%
22052
22056
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22053
22057
% ------------------------------------------------ Right Object 4
22054
- \RuleRaw{\SrnRightObjectFour}{}{ %
22058
+ \RuleRaw{\SrnRightObjectFour}{%
22055
22059
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22056
22060
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22057
22061
\mbox{\code{$X$\,\&\,$U$}, %
22058
22062
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22059
22063
% ------------------------------------------------ Left Null 2
22060
- \Rule{\SrnNullTwo}{}{ \code{Null}}{T}{%
22064
+ \Rule{\SrnNullTwo}{\code{Null}}{T}{%
22061
22065
\code{Null}}{\code{FutureOr<$T$>}}
22062
22066
\end{minipage}
22063
22067
22064
22068
\begin{minipage}[c]{0.49\textwidth}
22065
22069
% ------------------------------------------------ Left FutureOr
22066
- \RuleTwo{\SrnLeftFutureOr}{}{ %
22070
+ \RuleTwo{\SrnLeftFutureOr}{%
22067
22071
\code{Future<$S$>}}{T}{S}{T}{%
22068
22072
\code{FutureOr<$S$>}}{T}
22069
22073
% ------------------------------------------------ Right Promoted Variable
22070
- \RuleTwo{\SrnRightPromotedVariable}{}{ S}{X}{S}{T}{%
22074
+ \RuleTwo{\SrnRightPromotedVariable}{S}{X}{S}{T}{%
22071
22075
S}{X \& T}
22072
22076
% ------------------------------------------------ Right FutureOr B
22073
- \Rule{\SrnRightFutureOrB}{}{ S}{T}{S}{%
22077
+ \Rule{\SrnRightFutureOrB}{S}{T}{S}{%
22074
22078
\code{FutureOr<$T$>}}
22075
22079
% ------------------------------------------------ Right Nullable 2
22076
- \Rule{\SrnRightNullableTwo}{}{ S}{\code{Null}}{S}{%
22080
+ \Rule{\SrnRightNullableTwo}{S}{\code{Null}}{S}{%
22077
22081
\code{$T$?}}
22078
22082
% ------------------------------------------------ Left Variable Bound
22079
- \Rule{\SrnLeftVariableBound}{}{ \Gamma(X)}{T}{X}{T}
22083
+ \Rule{\SrnLeftVariableBound}{\Gamma(X)}{T}{X}{T}
22080
22084
\end{minipage}
22081
22085
\begin{minipage}[c]{0.49\textwidth}
22082
22086
% ------------------------------------------------ Left Nullable
22083
- \RuleTwo{\SrnLeftNullable}{}{ S}{T}{\code{Null}}{T}{%
22087
+ \RuleTwo{\SrnLeftNullable}{S}{T}{\code{Null}}{T}{%
22084
22088
\code{$S$?}}{T}
22085
22089
% ------------------------------------------------ Left Promoted Variable A
22086
- \Axiom{\SrnTypeVariableReflexivityA}{}{ X \& S}{X}
22090
+ \Axiom{\SrnTypeVariableReflexivityA}{X \& S}{X}
22087
22091
% ------------------------------------------------ Right FutureOr A
22088
- \Rule{\SrnRightFutureOrA}{}{ S}{%
22092
+ \Rule{\SrnRightFutureOrA}{S}{%
22089
22093
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22090
22094
% ------------------------------------------------ Right Nullable 1
22091
- \Rule{\SrnRightNullableOne}{}{ S}{T}{S}{\code{$T$?}}
22095
+ \Rule{\SrnRightNullableOne}{S}{T}{S}{\code{$T$?}}
22092
22096
% ------------------------------------------------ Left Promoted Variable B
22093
- \Rule{\SrnLeftPromotedVariable}{}{ S}{T}{X \& S}{T}
22097
+ \Rule{\SrnLeftPromotedVariable}{S}{T}{X \& S}{T}
22094
22098
% ------------------------------------------------ Right Function
22095
- \RuleRaw{\SrnRightFunction}{}{ %
22099
+ \RuleRaw{\SrnRightFunction}{%
22096
22100
T\mbox{ is a function type}}{T}{\FUNCTION}
22097
22101
\end{minipage}
22098
22102
%
22099
22103
\ExtraVSP
22100
22104
% ------------------------------------------------ Positional Function Type
22101
- \RuleRawRaw{\SrnPositionalFunctionType}{}{ %
22105
+ \RuleRawRaw{\SrnPositionalFunctionType}{%
22102
22106
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22103
22107
\Subtype{\Gamma'}{S_0}{T_0} \\
22104
22108
n_1 \leq n_2 &
@@ -22110,7 +22114,7 @@ \subsection{Subtypes}
22110
22114
\end{array}}
22111
22115
\ExtraVSP\ExtraVSP
22112
22116
% ------------------------------------------------ Named Function Type
22113
- \RuleRawRaw{\SrnNamedFunctionType}{}{ %
22117
+ \RuleRawRaw{\SrnNamedFunctionType}{%
22114
22118
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22115
22119
\Subtype{\Gamma'}{S_0}{T_0} &
22116
22120
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
@@ -22124,13 +22128,13 @@ \subsection{Subtypes}
22124
22128
%
22125
22129
\ExtraVSP
22126
22130
% ------------------------------------------------ Covariance
22127
- \RuleRaw{\SrnCovariance}{}{ %
22131
+ \RuleRaw{\SrnCovariance}{%
22128
22132
\mbox{$C$ is an interface type with $s$ type parameters} &
22129
22133
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
22130
22134
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22131
22135
\ExtraVSP
22132
22136
% ------------------------------------------------ Superinterface
22133
- \RuleRaw{\SrnSuperinterface}{}{ %
22137
+ \RuleRaw{\SrnSuperinterface}{%
22134
22138
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
22135
22139
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
22136
22140
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
0 commit comments