@@ -21888,29 +21888,27 @@ \subsection{Subtypes}
21888
21888
\newcommand{\SrnRightTop}{2}
21889
21889
\newcommand{\SrnLeftTop}{3}
21890
21890
\newcommand{\SrnBottom}{4}
21891
- \newcommand{\SrnRightObjectOne}{5.1}
21892
- \newcommand{\SrnRightObjectTwo}{5.2}
21893
- \newcommand{\SrnRightObjectThree}{5.3}
21894
- \newcommand{\SrnRightObjectFour}{5.4}
21895
- \newcommand{\SrnNullOne}{6.1}
21896
- \newcommand{\SrnNullTwo}{6.2}
21897
- \newcommand{\SrnLeftFutureOr}{7}
21898
- \newcommand{\SrnLeftNullable}{7b}
21899
- \newcommand{\SrnTypeVariableReflexivityA}{8}
21900
- \newcommand{\SrnRightPromotedVariable}{9}
21901
- \newcommand{\SrnRightFutureOrA}{10}
21902
- \newcommand{\SrnRightFutureOrB}{11}
21903
- \newcommand{\SrnRightNullableOne}{11b.1}
21904
- \newcommand{\SrnRightNullableTwo}{11b.2}
21905
- \newcommand{\SrnRightNullableThree}{11b.3}
21906
- \newcommand{\SrnRightNullableFour}{11b.4}
21907
- \newcommand{\SrnLeftPromotedVariable}{12}
21908
- \newcommand{\SrnLeftVariableBound}{13}
21909
- \newcommand{\SrnRightFunction}{14}
21910
- \newcommand{\SrnPositionalFunctionType}{15}
21911
- \newcommand{\SrnNamedFunctionType}{16}
21912
- \newcommand{\SrnCovariance}{17}
21913
- \newcommand{\SrnSuperinterface}{18}
21891
+ %\newcommand{\SrnRightObjectOne}{}
21892
+ %\newcommand{\SrnRightObjectTwo}{}
21893
+ %\newcommand{\SrnRightObjectThree}{}
21894
+ \newcommand{\SrnRightObjectFour}{5}
21895
+ \newcommand{\SrnNullOne}{6}
21896
+ \newcommand{\SrnNullTwo}{7}
21897
+ \newcommand{\SrnLeftFutureOr}{8}
21898
+ \newcommand{\SrnLeftNullable}{9}
21899
+ \newcommand{\SrnTypeVariableReflexivityA}{10}
21900
+ \newcommand{\SrnRightPromotedVariable}{11}
21901
+ \newcommand{\SrnRightFutureOrA}{12}
21902
+ \newcommand{\SrnRightFutureOrB}{13}
21903
+ \newcommand{\SrnRightNullableOne}{14}
21904
+ \newcommand{\SrnRightNullableTwo}{15}
21905
+ \newcommand{\SrnLeftPromotedVariable}{16}
21906
+ \newcommand{\SrnLeftVariableBound}{17}
21907
+ \newcommand{\SrnRightFunction}{18}
21908
+ \newcommand{\SrnPositionalFunctionType}{19}
21909
+ \newcommand{\SrnNamedFunctionType}{20}
21910
+ \newcommand{\SrnCovariance}{21}
21911
+ \newcommand{\SrnSuperinterface}{22}
21914
21912
21915
21913
\begin{figure}[p]
21916
21914
\def\VSP{\vspace{4mm}}
@@ -21923,55 +21921,95 @@ \subsection{Subtypes}
21923
21921
\centerline{\inference[#1]{#3}{\SubtypeStd{#4}{#5}}}\VSP}
21924
21922
\def\RuleRawRaw#1#2#3#4{\centerline{\inference[#1]{#3}{#4}}\VSP}
21925
21923
%
21924
+ % ----------------------------------------------------------------------
21925
+ % Omitted rules stated here, with justification for
21926
+ % the omission.
21927
+ % ------------------------------------------------ Right Object 1
21928
+ % Not needed unless algorithmic: Instance of
21929
+ % \SrnLeftVariableBound.
21930
+ % \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
21931
+ % \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
21932
+ % }{X}{\code{Object}}
21933
+ % ------------------------------------------------ Right Object 2
21934
+ % Not needed unless algorithmic: Instance of
21935
+ % \SrnLeftPromotedVariable.
21936
+ % \RuleRaw{\SrnRightObjectTwo}{}{%
21937
+ % \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
21938
+ % ------------------------------------------------ Right Object 3
21939
+ % Not needed unless algorithmic: Derivable from
21940
+ % \SrnLeftFutureOr{} and \SrnRightObjectFour{} (to get
21941
+ % Future<S> <: Object).
21942
+ % \RuleRaw{\SrnRightObjectThree}{}{%
21943
+ % \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
21944
+ % ----------------------------------------------------------------------
21926
21945
\begin{minipage}[c]{0.49\textwidth}
21927
- \Axiom{\SrnReflexivity}{Reflexivity}{T}{T}
21928
- \Axiom{\SrnBottom}{Left Bottom}{\code{Never}}{T}
21929
- \RuleRaw{\SrnRightObjectTwo}{Right Object 2}{%
21930
- \SubtypeStd{S}{\code{Object}}}{\code{$X$\,\&\,$S$}}{\code{Object}}
21931
- \RuleRaw{\SrnRightObjectThree}{Right Object 3}{%
21932
- \SubtypeStd{S}{\code{Object}}}{\code{FutureOr<$S$>}}{\code{Object}}
21933
- \Axiom{\SrnNullOne}{Left Null One}{\code{Null}}{\code{$T$?}}
21946
+ % ------------------------------------------------ Reflexivity
21947
+ \Axiom{\SrnReflexivity}{}{T}{T}
21948
+ \ExtraVSP
21949
+ % ------------------------------------------------ Left Top
21950
+ % Non-algorithmic justification for this rule: Needed
21951
+ % to prove dynamic/void <: FutureOr<Object>?.
21952
+ \RuleRaw{\SrnLeftTop}{}{%
21953
+ S \in \{\DYNAMIC, \VOID\}\\
21954
+ \SubtypeStd{\code{Object?}}{T}}{S}{T}
21955
+ % ------------------------------------------------ Left Bottom
21956
+ \Axiom{\SrnBottom}{}{\code{Never}}{T}
21957
+ % ------------------------------------------------ Left Null 1
21958
+ \Axiom{\SrnNullOne}{}{\code{Null}}{\code{$T$?}}
21934
21959
\end{minipage}
21935
21960
\begin{minipage}[c]{0.49\textwidth}
21936
- \RuleRaw{\SrnRightTop}{Right Top}{%
21961
+ % ------------------------------------------------ Right Top
21962
+ \RuleRaw{\SrnRightTop}{}{%
21937
21963
T \in \{\code{Object?}, \DYNAMIC, \VOID\}}{S}{T}
21938
- \RuleRaw{\SrnLeftTop}{Left Top}{%
21939
- S \in \{\DYNAMIC, \VOID\} & \SubtypeStd{\code{Object?}}{T}}{S}{T}
21940
- \RuleRaw{\SrnRightObjectOne}{Right Object 1}{%
21941
- \code{$X$\,\EXTENDS\,$B$} & \SubtypeStd{B}{\code{Object}}%
21942
- }{X}{\code{Object}}
21943
- \RuleRaw{\SrnRightObjectFour}{Right Object 4}{%
21964
+ % ------------------------------------------------ Right Object 4
21965
+ \RuleRaw{\SrnRightObjectFour}{}{%
21944
21966
$S$\,\not\in \{\code{Null}, \DYNAMIC, \VOID\}\\
21945
- \mbox{$S$ is not of the form \code{$U$?}, $X$, %
21946
- \code{$X$\,\&\,$U$}, \code{FutureOr<$U$>}}}{S}{\code{Object}}
21947
- \Rule{\SrnNullTwo}{Left Null Two}{\code{Null}}{T}{%
21967
+ \mbox{$S$ is not of the form \code{$U$?}, $X$,}\\
21968
+ \mbox{\code{$X$\,\&\,$U$}, %
21969
+ or \code{FutureOr<$U$>}}}{S}{\code{Object}}
21970
+ % ------------------------------------------------ Left Null 2
21971
+ \Rule{\SrnNullTwo}{}{\code{Null}}{T}{%
21948
21972
\code{Null}}{\code{FutureOr<$T$>}}
21949
21973
\end{minipage}
21950
21974
21951
21975
\begin{minipage}[c]{0.49\textwidth}
21952
- \RuleTwo{\SrnLeftFutureOr}{Left FutureOr}{\code{Future<$S$>}}{T}{S}{T}{%
21976
+ % ------------------------------------------------ Left FutureOr
21977
+ \RuleTwo{\SrnLeftFutureOr}{}{%
21978
+ \code{Future<$S$>}}{T}{S}{T}{%
21953
21979
\code{FutureOr<$S$>}}{T}
21954
- \RuleTwo{\SrnRightPromotedVariable}{Right Promoted Variable}{S}{X}{S}{T}{
21980
+ % ------------------------------------------------ Right Promoted Variable
21981
+ \RuleTwo{\SrnRightPromotedVariable}{}{S}{X}{S}{T}{
21955
21982
S}{X \& T}
21956
- \Rule{\SrnRightFutureOrB}{Right FutureOr B}{S}{T}{S}{\code{FutureOr<$T$>}}
21957
- \Rule{\SrnRightNullableTwo}{Right Nullable 2}{S}{\code{Null}}{S}{%
21983
+ % ------------------------------------------------ Right FutureOr B
21984
+ \Rule{\SrnRightFutureOrB}{}{S}{T}{S}{%
21985
+ \code{FutureOr<$T$>}}
21986
+ % ------------------------------------------------ Right Nullable 2
21987
+ \Rule{\SrnRightNullableTwo}{}{S}{\code{Null}}{S}{%
21958
21988
\code{$T$?}}
21959
- \Rule{\SrnLeftVariableBound}{Left Variable Bound}{\Gamma(X)}{T}{X}{T}
21989
+ % ------------------------------------------------ Left Variable Bound
21990
+ \Rule{\SrnLeftVariableBound}{}{\Gamma(X)}{T}{X}{T}
21960
21991
\end{minipage}
21961
21992
\begin{minipage}[c]{0.49\textwidth}
21962
- \RuleTwo{\SrnLeftNullable}{Left Nullable}{S}{T}{\code{Null}}{T}{
21993
+ % ------------------------------------------------ Left Nullable
21994
+ \RuleTwo{\SrnLeftNullable}{}{S}{T}{\code{Null}}{T}{
21963
21995
\code{$S$?}}{T}
21964
- \Axiom{\SrnTypeVariableReflexivityA}{Left Promoted Variable A}{X \& S}{X}
21965
- \Rule{\SrnRightFutureOrA}{Right FutureOr A}{S}{\code{Future<$T$>}}{%
21966
- S}{\code{FutureOr<$T$>}}
21967
- \Rule{\SrnRightNullableOne}{Right Nullable 1}{S}{T}{S}{\code{$T$?}}
21968
- \Rule{\SrnLeftPromotedVariable}{Left Promoted Variable B}{S}{T}{X \& S}{T}
21969
- \RuleRaw{\SrnRightFunction}{Right Function}{T\mbox{ is a function type}}{
21970
- T}{\FUNCTION}
21996
+ % ------------------------------------------------ Left Promoted Variable A
21997
+ \Axiom{\SrnTypeVariableReflexivityA}{}{X \& S}{X}
21998
+ % ------------------------------------------------ Right FutureOr A
21999
+ \Rule{\SrnRightFutureOrA}{}{S}{%
22000
+ \code{Future<$T$>}}{S}{\code{FutureOr<$T$>}}
22001
+ % ------------------------------------------------ Right Nullable 1
22002
+ \Rule{\SrnRightNullableOne}{}{S}{T}{S}{\code{$T$?}}
22003
+ % ------------------------------------------------ Left Promoted Variable B
22004
+ \Rule{\SrnLeftPromotedVariable}{}{S}{T}{X \& S}{T}
22005
+ % ------------------------------------------------ Right Function
22006
+ \RuleRaw{\SrnRightFunction}{}{%
22007
+ T\mbox{ is a function type}}{T}{\FUNCTION}
21971
22008
\end{minipage}
21972
22009
%
21973
22010
\ExtraVSP
21974
- \RuleRawRaw{\SrnPositionalFunctionType}{Positional Function Types}{%
22011
+ % ------------------------------------------------ Positional Function Type
22012
+ \RuleRawRaw{\SrnPositionalFunctionType}{}{%
21975
22013
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
21976
22014
\Subtype{\Gamma'}{S_0}{T_0} \\
21977
22015
n_1 \leq n_2 &
@@ -21982,7 +22020,8 @@ \subsection{Subtypes}
21982
22020
\RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
21983
22021
\end{array}}
21984
22022
\ExtraVSP\ExtraVSP
21985
- \RuleRawRaw{\SrnNamedFunctionType}{Named Function Types}{
22023
+ % ------------------------------------------------ Named Function Type
22024
+ \RuleRawRaw{\SrnNamedFunctionType}{}{
21986
22025
\Gamma' = \Gamma\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
21987
22026
\Subtype{\Gamma'}{S_0}{T_0} &
21988
22027
\forall j \in 1 .. n\!:\;\Subtype{\Gamma'}{T_j}{S_j} \\
@@ -21995,14 +22034,15 @@ \subsection{Subtypes}
21995
22034
\end{array}}
21996
22035
%
21997
22036
\ExtraVSP
21998
- \RuleRaw{\SrnCovariance}{Covariance}{%
21999
- \code{\CLASS{} $C$<\TypeParametersNoBounds{X}{s}>\,\ldots\,\{\}} &
22000
- \forall j \in 1 .. s\!:\;\SubtypeStd{S_j}{T_j}}{%
22037
+ % ------------------------------------------------ Covariance
22038
+ \RuleRaw{\SrnCovariance}{}{%
22039
+ \mbox{$C$ is an interface type with $s$ type parameters} &
22040
+ \SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
22001
22041
\code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
22002
22042
\ExtraVSP
22003
- %% !!! Should include mixins (and other non-class interface types, if any).
22004
- \RuleRaw{\SrnSuperinterface}{Superinterface }{%
22005
- \code{\CLASS{} $C$<\TypeParametersNoBounds {X}{s}>\,\ldots\,\{\ }}\\
22043
+ % ------------------------------------------------ Superinterface
22044
+ \RuleRaw{\SrnSuperinterface}{}{%
22045
+ \mbox{ $C$ is an interface type with type parameters \List {X}{1}{s }}\\
22006
22046
\Superinterface{\code{$D$<\List{T}{1}{m}>}}{C} &
22007
22047
\SubtypeStd{[S_1/X_1,\ldots,S_s/X_s]\code{$D$<\List{T}{1}{m}>}}{T}}{%
22008
22048
\code{$C$<\List{S}{1}{s}>}\;}{\;T}
0 commit comments