@@ -22883,104 +22883,108 @@ \subsection{Subtypes}
22883
22883
\begin{figure}[p]
22884
22884
\def\VSP{\vspace{4mm}}
22885
22885
\def\ExtraVSP{\vspace{2mm}}
22886
- \def\Axiom#1#2#3#4{\centerline{\inference[#1]{}{\SubtypeStd{#3}{#4}}}\VSP}
22887
- \def\Rule#1#2#3#4#5#6{\centerline{\inference[#1]{\SubtypeStd{#3}{#4}}{\SubtypeStd{#5}{#6}}}\VSP}
22888
- \def\RuleTwo#1#2#3#4#5#6#7#8{%
22889
- \centerline{\inference[#1]{\SubtypeStd{#3}{#4} & \SubtypeStd{#5}{#6}}{\SubtypeStd{#7}{#8}}}\VSP}
22890
- \def\RuleRaw#1#2#3#4#5{%
22891
- \centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
22892
- \def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
22886
+ \def\Axiom#1#2#3{\centerline{\inference[#1]{}{\SubtypeStd{#2}{#3}}}\VSP}
22887
+ \def\Rule#1#2#3#4#5{%
22888
+ \centerline{\inference[#1]{\SubtypeStd{#2}{#3}}{\SubtypeStd{#4}{#5}}}\VSP}
22889
+ \def\RuleTwo#1#2#3#4#5#6#7{%
22890
+ \centerline{\inference[#1]{\SubtypeStd{#2}{#3} & %
22891
+ \SubtypeStd{#4}{#5}}{\SubtypeStd{#6}{#7}}}\VSP}
22892
+ \def\RuleRaw#1#2#3#4{%
22893
+ \centerline{\inference[#1]{#2}{\SubtypeStd{#3}{#4}}}\VSP}
22894
+ \def\RuleRawRaw#1#2#3{\centerline{\inference[#1]{#2}{#3}}\VSP}
22893
22895
%
22894
22896
% ----------------------------------------------------------------------
22895
22897
% Omitted rules stated here, with justification for
22896
22898
% the omission.
22897
22899
% ------------------------------------------------ Right Object 1
22898
22900
% Not needed unless algorithmic: Instance of
22899
22901
% \SrnLeftVariableBound.
22900
- % \RuleRaw{\SrnRightObjectOne}{Right Object 1}{ %
22902
+ % \RuleRaw{\SrnRightObjectOne}{%
22901
22903
% \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
22902
22904
% }{X}{\code{Object}}
22903
22905
% ------------------------------------------------ Right Object 2
22904
22906
% Not needed unless algorithmic: Instance of
22905
22907
% \SrnLeftPromotedVariable.
22906
- % \RuleRaw{\SrnRightObjectTwo}{}{%
22907
- % \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
22908
+ % \RuleRaw{\SrnRightObjectTwo}{%
22909
+ % \SubtypeStd{S}{\code{Object}}}{%
22910
+ % \code{$X$\,\&\,$S$}}{\code{Object}}
22908
22911
% ------------------------------------------------ Right Object 3
22909
22912
% Not needed unless algorithmic: Derivable from
22910
22913
% \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
22911
22914
% Future<S> <: Object).
22912
- % \RuleRaw{\SrnRightObjectThree}{}{%
22913
- % \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
22915
+ % \RuleRaw{\SrnRightObjectThree}{%
22916
+ % \SubtypeStd{S}{\code{Object}}}{%
22917
+ % \code{FutureOr<$S$>}}{\code{Object}}
22914
22918
% ----------------------------------------------------------------------
22915
22919
\begin{minipage}[c]{0.49\textwidth}
22916
22920
% ------------------------------------------------ Reflexivity
22917
- \Axiom{\SrnReflexivity}{}{ T}{T}
22921
+ \Axiom{\SrnReflexivity}{T}{T}
22918
22922
\ExtraVSP
22919
22923
% ------------------------------------------------ Left Top
22920
22924
% Non-algorithmic justification for this rule: Needed
22921
22925
% to prove dynamic/void <: FutureOr<Object>?.
22922
- \RuleRaw{\SrnLeftTop}{}{ %
22926
+ \RuleRaw{\SrnLeftTop}{%
22923
22927
S \in \{\DYNAMIC, \VOID\}\\
22924
22928
\SubtypeStd{\code{Object?}}{T}}{S}{T}
22925
22929
% ------------------------------------------------ Left Bottom
22926
- \Axiom{\SrnBottom}{}{ \code{Never}}{T}
22930
+ \Axiom{\SrnBottom}{\code{Never}}{T}
22927
22931
% ------------------------------------------------ Left Null 1
22928
- \Axiom{\SrnNullOne}{}{ \code{Null}}{\code{$T$?}}
22932
+ \Axiom{\SrnNullOne}{\code{Null}}{\code{$T$?}}
22929
22933
\end{minipage}
22930
22934
\begin{minipage}[c]{0.49\textwidth}
22931
22935
% ------------------------------------------------ Right Top
22932
- \RuleRaw{\SrnRightTop}{}{ %
22936
+ \RuleRaw{\SrnRightTop}{%
22933
22937
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
22934
22938
% ------------------------------------------------ Right Object 4
22935
- \RuleRaw{\SrnRightObjectFour}{}{ %
22939
+ \RuleRaw{\SrnRightObjectFour}{%
22936
22940
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
22937
22941
\mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
22938
22942
\mbox{\code{$X$\,\&\,$U$}, %
22939
22943
or \code{FutureOr<$U$>}}}{S}{\code{Object}}
22940
22944
% ------------------------------------------------ Left Null 2
22941
- \Rule{\SrnNullTwo}{}{ \code{Null}}{T}{%
22945
+ \Rule{\SrnNullTwo}{\code{Null}}{T}{%
22942
22946
\code{Null}}{\code{FutureOr<$T$>}}
22943
22947
\end{minipage}
22944
22948
22945
22949
\begin{minipage}[c]{0.49\textwidth}
22946
22950
% ------------------------------------------------ Left FutureOr
22947
- \RuleTwo{\SrnLeftFutureOr}{}{ %
22951
+ \RuleTwo{\SrnLeftFutureOr}{%
22948
22952
\code{Future<$S$>}}{T}{S}{T}{%
22949
22953
\code{FutureOr<$S$>}}{T}
22950
22954
% ------------------------------------------------ Right Promoted Variable
22951
- \RuleTwo{\SrnRightPromotedVariable}{}{ S}{X}{S}{T}{%
22955
+ \RuleTwo{\SrnRightPromotedVariable}{S}{X}{S}{T}{%
22952
22956
S}{X \& T}
22953
22957
% ------------------------------------------------ Right FutureOr B
22954
- \Rule{\SrnRightFutureOrB}{}{ S}{T}{S}{%
22958
+ \Rule{\SrnRightFutureOrB}{S}{T}{S}{%
22955
22959
\code{FutureOr<$T$>}}
22956
22960
% ------------------------------------------------ Right Nullable 2
22957
- \Rule{\SrnRightNullableTwo}{}{ S}{\code{Null}}{S}{%
22961
+ \Rule{\SrnRightNullableTwo}{S}{\code{Null}}{S}{%
22958
22962
\code{$T$?}}
22959
22963
% ------------------------------------------------ Left Variable Bound
22960
22964
\Rule{\SrnLeftVariableBound}{}{\Delta(X)}{T}{X}{T}
22961
22965
\end{minipage}
22962
22966
\begin{minipage}[c]{0.49\textwidth}
22963
22967
% ------------------------------------------------ Left Nullable
22964
- \RuleTwo{\SrnLeftNullable}{}{ S}{T}{\code{Null}}{T}{%
22968
+ \RuleTwo{\SrnLeftNullable}{S}{T}{\code{Null}}{T}{%
22965
22969
\code{$S$?}}{T}
22966
22970
% ------------------------------------------------ Left Promoted Variable A
22967
- \Axiom{\SrnTypeVariableReflexivityA}{}{ X \& S}{X}
22971
+ \Axiom{\SrnTypeVariableReflexivityA}{X \& S}{X}
22968
22972
% ------------------------------------------------ Right FutureOr A
22969
- \Rule{\SrnRightFutureOrA}{}{ S}{%
22973
+ \Rule{\SrnRightFutureOrA}{S}{%
22970
22974
\code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22971
22975
% ------------------------------------------------ Right Nullable 1
22972
- \Rule{\SrnRightNullableOne}{}{ S}{T}{S}{\code{$T$?}}
22976
+ \Rule{\SrnRightNullableOne}{S}{T}{S}{\code{$T$?}}
22973
22977
% ------------------------------------------------ Left Promoted Variable B
22974
- \Rule{\SrnLeftPromotedVariable}{}{ S}{T}{X \& S}{T}
22978
+ \Rule{\SrnLeftPromotedVariable}{S}{T}{X \& S}{T}
22975
22979
% ------------------------------------------------ Right Function
22976
- \RuleRaw{\SrnRightFunction}{}{ %
22980
+ \RuleRaw{\SrnRightFunction}{%
22977
22981
T\mbox{ is a function type}}{T}{\FUNCTION}
22978
22982
\end{minipage}
22979
22983
%
22980
22984
\ExtraVSP
22981
22985
% ------------------------------------------------ Positional Function Type
22982
22986
\RuleRawRaw{\SrnPositionalFunctionType}{}{%
22983
- \Gamma ' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22987
+ \Delta ' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22984
22988
\Subtype{\Delta'}{S_0}{T_0} \\
22985
22989
n_1 \leq n_2 &
22986
22990
n_1 + k_1 \geq n_2 + k_2 &
@@ -22992,7 +22996,7 @@ \subsection{Subtypes}
22992
22996
\ExtraVSP\ExtraVSP
22993
22997
% ------------------------------------------------ Named Function Type
22994
22998
\RuleRawRaw{\SrnNamedFunctionType}{}{%
22995
- \Gamma ' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22999
+ \Delta ' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22996
23000
\Subtype{\Delta'}{S_0}{T_0} &
22997
23001
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
22998
23002
\{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\} \\
@@ -23005,13 +23009,13 @@ \subsection{Subtypes}
23005
23009
%
23006
23010
\ExtraVSP
23007
23011
% ------------------------------------------------ Covariance
23008
- \RuleRaw{\SrnCovariance}{}{ %
23012
+ \RuleRaw{\SrnCovariance}{%
23009
23013
\mbox{$C$ is an interface type with $s$ type parameters} &
23010
23014
\SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
23011
23015
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
23012
23016
\ExtraVSP
23013
23017
% ------------------------------------------------ Superinterface
23014
- \RuleRaw{\SrnSuperinterface}{}{ %
23018
+ \RuleRaw{\SrnSuperinterface}{%
23015
23019
\mbox{$C$ is an interface type with type parameters \List{X}{1}{s}}\\
23016
23020
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
23017
23021
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
0 commit comments