@@ -22235,18 +22235,20 @@ \subsection{Subtypes}
2223522235 % ------------------------------------------------ Positional Function Type
2223622236 \RuleRawRaw{\SrnPositionalFunctionType}{%
2223722237 \Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22238+ \forall i \in 1..s\!:\;\MutualSubtype{\Delta'}{B_i}{B'\!_i} &
2223822239 \Subtype{\Delta'}{S_0}{T_0} \\
2223922240 n_1 \leq n_2 &
2224022241 n_1 + k_1 \geq n_2 + k_2 &
2224122242 \forall j \in 1 .. n_2 + k_2\!:\;\Subtype{\Delta'}{T_j}{S_j}}{%
2224222243 \begin{array}{c}
2224322244 \Delta\vdash\RawFunctionTypePositional{S_0}{X}{B}{s}{S}{n_1}{k_1}\;<:\;\\
22244- \RawFunctionTypePositional{T_0}{X}{B}{s}{T}{n_2}{k_2}
22245+ \RawFunctionTypePositional{T_0}{X}{B'\! }{s}{T}{n_2}{k_2}
2224522246 \end{array}}
2224622247 \ExtraVSP\ExtraVSP
2224722248 % ------------------------------------------------ Named Function Type
2224822249 \RuleRawRaw{\SrnNamedFunctionType}{%
2224922250 \Delta' = \Delta\uplus\{X_i\mapsto{}B_i\,|\,1 \leq i \leq s\} &
22251+ \forall i \in 1..s\!:\;\MutualSubtype{\Delta'}{B_i}{B'\!_i} &
2225022252 \Subtype{\Delta'}{S_0}{T_0} &
2225122253 \forall j \in 1 .. n\!:\;\Subtype{\Delta'}{T_j}{S_j}\\
2225222254 \{\,\List{y}{n+1}{n+k_2}\,\} \subseteq \{\,\List{x}{n+1}{n+k_1}\,\}\\
@@ -22256,13 +22258,16 @@ \subsection{Subtypes}
2225622258 (r_{n+q} = \REQUIRED{} \Rightarrow r'_{n+p} = \REQUIRED)}{%
2225722259 \begin{array}{c}
2225822260 \Delta\vdash\RawFunctionTypeNamed{S_0}{X}{B}{s}{S}{n}{x}{k_1}{r}\;<:\;\\
22259- \RawFunctionTypeNamed{T_0}{X}{B}{s}{T}{n}{y}{k_2}{r'}
22261+ \RawFunctionTypeNamed{T_0}{X}{B'\! }{s}{T}{n}{y}{k_2}{r'}
2226022262 \end{array}}
2226122263 %
2226222264 \ExtraVSP
2226322265 % ------------------------------------------------ Covariance
22266+ %% TODO(eernst): Type aliases have been expanded so there is no other
22267+ %% variance than covariance, but there will be in/out/inout in classes,
22268+ %% and then we'll need to handle variance here.
2226422269 \RuleRaw{\SrnCovariance}{%
22265- \mbox{$C$ is an interface type with $s$ type parameters} &
22270+ \mbox{$C$ is an interface type with $s$ type parameters. } &
2226622271 \SubtypeStd{S_j}{T_j}\mbox{, for each $j \in 1..s$}}{%
2226722272 \code{$C$<\List{S}{1}{s}>}}{\code{$C$<\List{T}{1}{s}>}}
2226822273 \ExtraVSP
@@ -22427,7 +22432,8 @@ \subsubsection{Subtype Rules}
2242722432In this specification we frequently refer to
2242822433subtype relationships and assignability
2242922434without mentioning the environment explicitly,
22430- as in \Index{\SubtypeNE{S}{T}}.
22435+ as in
22436+ \IndexCustom{\SubtypeNE{S}{T}}{$<:$@\SubtypeNE{S}{T}}.
2243122437This is only done when a specific location in code is in focus,
2243222438and it means that the environment is that which is obtained
2243322439by mapping each type variable in scope at that location
@@ -22461,7 +22467,7 @@ \subsubsection{Being a Subtype}
2246122467A type $S$ is shown to be a \Index{subtype} of another type $T$
2246222468in an environment $\Delta$ by providing
2246322469an instantiation of a rule $R$ whose conclusion is
22464- \IndexCustom{\SubtypeStd{S}{T}}{$\Delta$@\SubtypeStd{S}{T}},
22470+ \IndexCustom{\SubtypeStd{S}{T}}{$\Delta<: $@\SubtypeStd{S}{T}},
2246522471along with rule instantiations showing
2246622472each of the premises of $R$,
2246722473continuing until a rule with no premises is reached.
@@ -22690,9 +22696,17 @@ \subsubsection{Additional Subtyping Concepts}
2269022696
2269122697\LMHash{}%
2269222698$S$ is a \Index{supertype} of $T$ in a given environment $\Delta$,
22693- written \SupertypeStd{S}{T},
22699+ written
22700+ \IndexCustom{\SupertypeStd{S}{T}}{$\Delta:>$@\SupertypeStd{S}{T}},
2269422701if{}f \SubtypeStd{T}{S}.
2269522702
22703+ \LMHash{}%
22704+ $S$ and $T$ are \Index{mutual subtypes} of each other
22705+ in a given environment $\Delta$,
22706+ written
22707+ \IndexCustom{\MutualSubtypeStd{S}{T}}{$\Delta<:>$@\MutualSubtypeStd{S}{T}},
22708+ if{}f both \SubtypeStd{T}{S} and \SubtypeStd{S}{T}.
22709+
2269622710\LMHash{}%
2269722711A type $T$
2269822712\Index{may be assigned}
@@ -22850,7 +22864,8 @@ \subsection{Functions Dealing with Extreme Types}
2285022864the first applicable case must be used.
2285122865
2285222866\LMHash{}%
22853- The \Index{\TopMergeTypeName} of two types computes
22867+ The \IndexCustom{\TopMergeTypeName}{topMergeType@\TopMergeTypeName}
22868+ of two types computes
2285422869a canonical type which represents both of them,
2285522870in the case where they are structurally identical
2285622871modulo the choice among top types.
@@ -22915,7 +22930,8 @@ \subsection{Functions Dealing with Extreme Types}
2291522930\commentary{The ordering of the arguments makes no difference.}
2291622931
2291722932\LMHash{}%
22918- The \Index{\IsTopTypeName} predicate is true for any type which is in
22933+ The \IndexCustom{\IsTopTypeName}{isTopType@\IsTopTypeName}
22934+ predicate is true for any type which is in
2291922935the equivalence class of top types.
2292022936It is a syntactic characterization of top types
2292122937(\ref{superBoundedTypes}).
@@ -22929,8 +22945,9 @@ \subsection{Functions Dealing with Extreme Types}
2292922945\end{itemize}
2293022946
2293122947\noindent
22932- The \Index{\IsObjectTypeName} predicate is true if{}f
22933- the argument is a subtype and a supertype of \code{Object}.
22948+ The \IndexCustom{\IsObjectTypeName}{isObjectType@\IsObjectTypeName}
22949+ predicate is true if{}f the argument is
22950+ a subtype and a supertype of \code{Object}.
2293422951
2293522952\begin{itemize}
2293622953\item \DefEquals{\IsObjectType{Object}}{\metavar{true}}.
@@ -22939,8 +22956,8 @@ \subsection{Functions Dealing with Extreme Types}
2293922956\end{itemize}
2294022957
2294122958\noindent
22942- The \Index {\IsBottomTypeName} predicate is true if{}f
22943- the argument is a subtype of \code{Never}.
22959+ The \IndexCustom {\IsBottomTypeName}{isBottomType@\IsBottomTypeName}
22960+ predicate is true if{}f the argument is a subtype of \code{Never}.
2294422961
2294522962\begin{itemize}
2294622963\item \DefEquals{\IsBottomType{Never}}{\metavar{true}}.
@@ -22950,8 +22967,9 @@ \subsection{Functions Dealing with Extreme Types}
2295022967\end{itemize}
2295122968
2295222969\noindent
22953- The \Index{\IsNullTypeName} predicate is true if{}f
22954- the argument is a subtype and a supertype of \code{Null}.
22970+ The \IndexCustom{\IsNullTypeName}{isNullType@\IsNullTypeName}
22971+ predicate is true if{}f the argument is
22972+ a subtype and a supertype of \code{Null}.
2295522973
2295622974\begin{itemize}
2295722975\item \DefEquals{\IsNullType{Null}}{\metavar{true}}.
@@ -22960,8 +22978,8 @@ \subsection{Functions Dealing with Extreme Types}
2296022978\end{itemize}
2296122979
2296222980\noindent
22963- The \Index {\IsMoreTopTypeName} predicate defines a total order on
22964- top and \code{Object} types.
22981+ The \IndexCustom {\IsMoreTopTypeName}{isMoreTopType@\IsMoreTopTypeName}
22982+ predicate defines a total order on top and \code{Object} types.
2296522983
2296622984\begin{itemize}
2296722985\item \DefEquals{\IsMoreTopType{\VOID}{$T$}}{\metavar{true}}.
@@ -22978,8 +22996,8 @@ \subsection{Functions Dealing with Extreme Types}
2297822996\end{itemize}
2297922997
2298022998\noindent
22981- The \Index {\IsMoreBottomTypeName} predicate defines an almost total order on
22982- bottom and \code{Null} types.
22999+ The \IndexCustom {\IsMoreBottomTypeName}{isMoreBottomType@\IsMoreBottomTypeName}
23000+ predicate defines an almost total order on bottom and \code{Null} types.
2298323001\commentary{%
2298423002This does not consistently order
2298523003two different type variables with the same bound.%
@@ -23058,7 +23076,9 @@ \subsection{Type Normalization}
2305823076}
2305923077
2306023078\LMHash{}%
23061- The function \Index{\NormalizedTypeOfName} is then defined as follows:
23079+ The function
23080+ \IndexCustom{\NormalizedTypeOfName}{normalizedType@\NormalizedTypeOfName}
23081+ is then defined as follows:
2306223082\BlindDefineSymbol{T_a, T_u, T_r}%
2306323083Let $T_a$ be a type
2306423084(\commentary{where `a' stands for `argument'}).
0 commit comments