Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 \documentclass[fleqn]{article} | 1 \documentclass[fleqn, draft]{article} |
| 2 \usepackage{proof, amsmath} | 2 \usepackage{proof, amsmath, amssymb, ifthen} |
| 3 \input{macros.tex} | |
| 3 | 4 |
| 4 % types | 5 % types |
| 5 \newcommand{\Arrow}[2]{#1 \rightarrow #2} | 6 \newcommand{\Arrow}[3][-]{#2 \overset{#1}{\rightarrow} #3} |
| 6 \newcommand{\Bool}{\mathbf{bool}} | 7 \newcommand{\Bool}{\mathbf{bool}} |
| 7 \newcommand{\Bottom}{\mathbf{bottom}} | 8 \newcommand{\Bottom}{\mathbf{bottom}} |
| 8 \newcommand{\Dynamic}{\mathbf{dynamic}} | 9 \newcommand{\Dynamic}{\mathbf{dynamic}} |
| 9 \newcommand{\Null}{\mathbf{Null}} | 10 \newcommand{\Null}{\mathbf{Null}} |
| 10 \newcommand{\Num}{\mathbf{num}} | 11 \newcommand{\Num}{\mathbf{num}} |
| 11 \newcommand{\Object}{\mathbf{Object}} | 12 \newcommand{\Object}{\mathbf{Object}} |
| 12 \newcommand{\TApp}[2]{#1\mathrm{<}#2\mathrm{>}} | 13 \newcommand{\TApp}[2]{#1\mathrm{<}#2\mathrm{>}} |
| 13 \newcommand{\Type}{\mathbf{Type}} | 14 \newcommand{\Type}{\mathbf{Type}} |
| 14 | 15 |
| 15 % expressions | 16 % expressions |
| 16 \newcommand{\eapp}[2]{#1(#2)} | 17 \newcommand{\eassign}[2]{#1 = #2} |
| 17 \newcommand{\eas}[2]{#1\ \mathbf{as}\ #2} | 18 \newcommand{\eas}[2]{#1\ \mathbf{as}\ #2} |
| 18 \newcommand{\eassign}[2]{#1 = #2} | 19 \newcommand{\echeck}[2]{\kwop{check}(#1, #2)} |
| 20 \newcommand{\ecall}[2]{#1(#2)} | |
| 21 \newcommand{\edcall}[2]{\kwop{dcall}(#1, #2)} | |
| 22 \newcommand{\edload}[2]{\kwop{dload}(#1, #2)} | |
| 19 \newcommand{\eff}{\mathrm{ff}} | 23 \newcommand{\eff}{\mathrm{ff}} |
| 20 \newcommand{\eis}[2]{#1\ \mathbf{is}\ #2} | 24 \newcommand{\eis}[2]{#1\ \mathbf{is}\ #2} |
| 21 \newcommand{\elambda}[2]{(#1) \Rightarrow #2} | 25 \newcommand{\elambda}[3]{(#1):#2 \Rightarrow #3} |
| 26 \newcommand{\eload}[2]{#1.#2} | |
| 27 \newcommand{\eset}[3]{\eassign{#1.#2}{#3}} | |
| 22 \newcommand{\enew}[3]{\mathbf{new}\,\TApp{#1}{#2}(#3)} | 28 \newcommand{\enew}[3]{\mathbf{new}\,\TApp{#1}{#2}(#3)} |
| 23 \newcommand{\enull}{\mathbf{null}} | 29 \newcommand{\enull}{\mathbf{null}} |
| 24 \newcommand{\eprimapp}[2]{\eapp{#1}{#2}} | 30 \newcommand{\eprimapp}[2]{\ecall{#1}{#2}} |
| 25 \newcommand{\eproj}[2]{#1.#2} | 31 \newcommand{\esend}[3]{\ecall{\eload{#1}{#2}}{#3}} |
| 26 \newcommand{\esend}[3]{\eapp{\eproj{#1}{#2}}{#3}} | |
| 27 \newcommand{\esuper}{\mathbf{super}} | 32 \newcommand{\esuper}{\mathbf{super}} |
| 28 \newcommand{\ethis}{\mathbf{this}} | 33 \newcommand{\ethis}{\mathbf{this}} |
| 34 \newcommand{\ethrow}{\mathbf{throw}} | |
| 29 \newcommand{\ett}{\mathrm{tt}} | 35 \newcommand{\ett}{\mathrm{tt}} |
| 30 | 36 |
| 31 % keywords | 37 % keywords |
| 32 \newcommand{\kwclass}{\mathbf{class}} | 38 \newcommand{\kwclass}{\kw{class}} |
| 33 \newcommand{\kwextends}{\mathbf{extends}} | 39 \newcommand{\kwextends}{\kw{extends}} |
| 34 \newcommand{\kwelse}{\mathbf{else}} | 40 \newcommand{\kwelse}{\kw{else}} |
| 35 \newcommand{\kwif}{\mathbf{if}} | 41 \newcommand{\kwif}{\kw{if}} |
| 36 \newcommand{\kwin}{\mathbf{in}} | 42 \newcommand{\kwin}{\kw{in}} |
| 37 \newcommand{\kwlet}{\mathbf{let}} | 43 \newcommand{\kwlet}{\kw{let}} |
| 38 \newcommand{\kwreturn}{\mathbf{return}} | 44 \newcommand{\kwreturn}{\kw{return}} |
| 39 \newcommand{\kwthen}{\mathbf{then}} | 45 \newcommand{\kwthen}{\kw{then}} |
| 40 \newcommand{\kwvar}{\mathbf{var}} | 46 \newcommand{\kwvar}{\kw{var}} |
| 41 | 47 |
| 42 % declarations | 48 % declarations |
| 43 \newcommand{\dclass}[3]{\kwclass\ #1\ \kwextends\ #2\ \{#3\}} | 49 \newcommand{\dclass}[3]{\kwclass\ #1\ \kwextends\ #2\ \{#3\}} |
| 44 \newcommand{\dfun}[4]{#1\ #2(#3)\ #4} | 50 \newcommand{\dfun}[4]{#2(#3):#1 = #4} |
| 45 \newcommand{\dvar}[2]{\kwvar\ #1\ =\ #2} | 51 \newcommand{\dvar}[2]{\kwvar\ #1\ =\ #2} |
| 46 | 52 |
| 47 % statements | 53 % statements |
| 48 \newcommand{\sifthenelse}[3]{\kwif\ (#1)\ \kwthen\ #2\ \kwelse\ #3} | 54 \newcommand{\sifthenelse}[3]{\kwif\ (#1)\ \kwthen\ #2\ \kwelse\ #3} |
| 49 \newcommand{\sreturn}[1]{\kwreturn\ #1} | 55 \newcommand{\sreturn}[1]{\kwreturn\ #1} |
| 50 | 56 |
| 51 % programs | 57 % programs |
| 52 \newcommand{\program}[2]{\kwlet\ #1\ \kwin\ #2} | 58 \newcommand{\program}[2]{\kwlet\ #1\ \kwin\ #2} |
| 53 | 59 |
| 54 % relational operators | 60 % relational operators |
| 55 \newcommand{\sub}{\mathop{<:}} | 61 \newcommand{\sub}{\mathbin{<:}} |
| 56 | 62 |
| 57 % utilities | 63 % utilities |
| 58 \newcommand{\many}[1]{\overrightarrow{#1}} | 64 \newcommand{\many}[1]{\overrightarrow{#1}} |
| 59 \newcommand{\alt}{\ \mathop{|}\ } | 65 \newcommand{\alt}{\ \mathop{|}\ } |
| 66 \newcommand{\opt}[1]{[#1]} | |
| 60 | 67 |
| 61 % inference rules | 68 % inference rules |
| 62 \newcommand{\axiom}[1]{\infer{#1}{}} | 69 \newcommand{\infrulem}[3][]{ |
| 63 \newcommand{\infrule}[2]{\infer{#2}{#1}} | 70 \begin{array}{c@{\ }c} |
| 64 | 71 \begin{array}{cccc} |
| 65 % relations | 72 #2 \vspace{-2mm} |
| 73 \end{array} \\ | |
| 74 \hrulefill & #1 \\ | |
| 75 \begin{array}{l} | |
| 76 #3 | |
| 77 \end{array} | |
| 78 \end{array} | |
| 79 } | |
| 80 | |
| 81 \newcommand{\axiomm}[2][]{ | |
| 82 \begin{array}{cc} | |
| 83 \hrulefill & #1 \\ | |
| 84 \begin{array}{c} | |
| 85 #2 | |
| 86 \end{array} | |
| 87 \end{array} | |
| 88 } | |
| 89 | |
| 90 \newcommand{\infrule}[3][]{ | |
| 91 \[ | |
| 92 \infrulem[#1]{#2}{#3} | |
| 93 \] | |
| 94 } | |
| 95 | |
| 96 \newcommand{\axiom}[2][]{ | |
| 97 \[ | |
| 98 \axiomm[#1]{#2} | |
| 99 \] | |
| 100 } | |
| 101 | |
| 102 % judgements and relations | |
| 103 \newboolean{show_translation} | |
| 104 \setboolean{show_translation}{false} | |
| 105 \newcommand{\iftrans}[1]{\ifthenelse{\boolean{show_translation}}{#1}{}} | |
| 106 | |
| 107 \newcommand{\blockOk}[4]{#1 \vdash #2 \, : \, #3\iftrans{\, \Uparrow\, #4}} | |
| 108 \newcommand{\declOk}[5][]{#2 \vdash_{#1} #3 \, \Uparrow\, \iftrans{#4\, :\,} #5} | |
| 66 \newcommand{\extends}[4][:]{#2[#3\ #1\ #4]} | 109 \newcommand{\extends}[4][:]{#2[#3\ #1\ #4]} |
| 110 \newcommand{\fieldLookup}[4]{#1 \vdash #2.#3\, \leadsto\, #4} | |
| 111 \newcommand{\hastype}[3]{#1 \vdash #2 \, : \, #3} | |
| 112 \newcommand{\stmtOk}[5]{#1 \vdash #2 \, : \, #3\, \Uparrow \iftrans{#4\, :\,} #5 } | |
| 67 \newcommand{\subst}[2]{[#1/#2]} | 113 \newcommand{\subst}[2]{[#1/#2]} |
| 68 \newcommand{\subtypeOf}[3]{#1 \vdash\ #2 \sub\ #3} | 114 \newcommand{\subtypeOfOpt}[5][?]{#2 \vdash\ #3 \sub^{#1} #4\, \Uparrow\, #5} |
| 69 | 115 \newcommand{\subtypeOf}[4][]{#2 \vdash\ #3 \sub^{#1} #4} |
| 116 \newcommand{\yieldsOk}[5]{#1 \vdash #2 \, : \, #3\, \Uparrow\, \iftrans{#4\, :\, } #5} | |
| 70 \title{Dart strong mode definition} | 117 \title{Dart strong mode definition} |
| 71 | 118 |
| 72 \begin{document} | 119 \begin{document} |
| 73 | 120 |
| 121 \textbf{\large PRELIMINARY DRAFT} | |
| 122 | |
| 74 \section*{Syntax} | 123 \section*{Syntax} |
| 75 | 124 |
| 76 | 125 |
| 126 Terms and types. Note that we allow types to be optional in certain positions | |
| 127 (currently function arguments and return types, and on variable declarations). | |
| 128 Implicitly these are either inferred or filled in with dynamic. | |
|
vsm
2015/07/13 22:36:56
Is there a benefit to modeling inference here? It
Leaf
2015/07/14 22:39:50
Maybe. I need to think about whether it can be se
| |
| 129 | |
| 130 There are explicit terms for dynamic calls and loads, and for dynamic type | |
| 131 checks. | |
|
Siggi Cherem (dart-lang)
2015/07/10 00:20:58
I admit, this surprised me a bit. I was expecting
Leaf
2015/07/14 22:39:50
See my reply to Vijay's comment on dcall in the st
| |
| 132 | |
| 133 Fields can only be set within a method via a reference to this, so no dynamic | |
| 134 set operation is required (essentially dynamic set becomes a dynamic call to a | |
| 135 setter). This just simplifies the presentation a bit. | |
|
vsm
2015/07/13 22:36:56
Perhaps worth doing the same with loads for simpli
Leaf
2015/07/14 22:39:50
Done.
Leaf
2015/07/14 22:39:50
Acknowledged.
| |
| 136 | |
| 77 \[ | 137 \[ |
| 78 \begin{array}{lcl} | 138 \begin{array}{lcl} |
| 79 \text{Type identifiers} & ::= & C, G, T, S, \ldots \\ | 139 \text{Type identifiers} & ::= & C, G, T, S, \ldots \\ |
| 80 % | 140 % |
| 141 \text{Arrow kind ($k$)} & ::= & +, -\\ | |
| 142 % | |
| 81 \text{Types $\tau, \sigma$} & ::= & | 143 \text{Types $\tau, \sigma$} & ::= & |
| 82 T \alt \Dynamic \alt \Object \alt \Null \alt \Type \alt \Num \alt \Bool \\ && | 144 T \alt \Dynamic \alt \Object \alt \Null \alt \Type \alt \Num \\ && |
| 83 \alt \Arrow{\many{\tau}}{\sigma} \alt \TApp{C}{\many{\tau}} \\ | 145 \alt \Bool |
| 146 \alt \Arrow[k]{\many{\tau}}{\sigma} \alt \TApp{C}{\many{\tau}} \\ | |
| 147 % | |
| 148 \text{Optional type ($[\tau]$)} & ::= & \_ \alt \tau \\ | |
| 84 % | 149 % |
| 85 \text{Term identifiers} & ::= & a, b, x, y, m, n, \ldots \\ | 150 \text{Term identifiers} & ::= & a, b, x, y, m, n, \ldots \\ |
| 86 % | 151 % |
| 87 \text{Primops ($\phi$)} & ::= & \mathrm{+}, \mathrm{-} \ldots \mathrm{||} \ldots \\ | 152 \text{Primops ($\phi$)} & ::= & \mathrm{+}, \mathrm{-} \ldots \mathrm{||} \ldots \\ |
|
Siggi Cherem (dart-lang)
2015/07/10 00:20:58
not sure we get much from using a $\phi$ for ops :
Leaf
2015/07/14 22:39:50
Done.
| |
| 88 % | 153 % |
| 89 \text{lhs ($l$)} & ::= & x \alt \eproj{e}{m} \\ | |
| 90 % | |
| 91 \text{Expressions $e$} & ::= & | 154 \text{Expressions $e$} & ::= & |
| 92 x \alt i \alt \ett \alt \eff \alt \enull \alt \ethis \alt \esuper | 155 x \alt i \alt \ett \alt \eff \alt \enull \alt \ethis \\&& |
| 93 \alt \elambda{\many{x:\tau}}{e} \alt \enew{C}{\many{\tau}}{\many{e}} \\&& | 156 \alt \elambda{\many{x:\opt{\tau}}}{\opt{\sigma}}{e} |
| 94 \alt \eprimapp{\phi}{\many{e}} \alt \eapp{e}{\many{e}} | 157 \alt \enew{C}{\many{\tau}}{} \\&& |
| 95 \alt \eproj{e}{m} \alt \eassign{l}{e} \\&& | 158 \alt \eprimapp{\phi}{\many{e}} \alt \ecall{e}{\many{e}} |
|
Siggi Cherem (dart-lang)
2015/07/10 00:20:58
is \eprimapp only when you know it's a primitive t
Leaf
2015/07/14 22:39:50
The +/- etc syntax is just sugar, and I'm not mode
| |
| 96 \alt \eas{e}{\tau} \alt \eis{e}{\tau} \\ | 159 \alt \edcall{e}{\many{e}} \\&& |
| 160 \alt \eload{e}{m} \alt \edload{e}{m} \\&& | |
| 161 \alt \eassign{x}{e} \alt \eset{\ethis}{m}{e} \\&& | |
| 162 \alt \ethrow \alt \eas{e}{\tau} \alt \eis{e}{\tau} \alt \echeck{e}{\tau}\\ | |
| 97 % | 163 % |
| 98 \text{Declaration ($\mathit{vd}$)} & ::= & | 164 \text{Declaration ($\mathit{vd}$)} & ::= & |
| 99 \dvar{x}{e} \alt \dvar{x:\tau}{e} \alt \dfun{\tau}{f}{\many{x:\tau}}{b} \\ | 165 \dvar{x:\opt{\tau}}{e} \alt \dfun{\tau}{f}{\many{x:\tau}}{s} \\ |
| 100 % | 166 % |
| 101 \text{Statements ($s$)} & ::= & \mathit{vd} \alt e \alt \sifthenelse{e}{b_1}{b_2 } | 167 \text{Statements ($s$)} & ::= & \mathit{vd} \alt e \alt \sifthenelse{e}{s_1}{s_2 } |
| 102 \alt \sreturn{e} \alt s;s \\ | 168 \alt \sreturn{e} \alt s;s \\ |
| 103 % | 169 % |
| 104 \text{Blocks ($b$)} & ::= & \{s;\} \\ | |
| 105 % | |
| 106 \text{Class decl ($\mathit{cd}$)} & ::= & \dclass{\TApp{C}{\many{T}}}{\TApp{G}{\ many{S}}}{\many{\mathit{vd}}} \\ | 170 \text{Class decl ($\mathit{cd}$)} & ::= & \dclass{\TApp{C}{\many{T}}}{\TApp{G}{\ many{S}}}{\many{\mathit{vd}}} \\ |
|
vsm
2015/07/13 22:36:56
Do you think we'll need to model implements as wel
Leaf
2015/07/14 22:39:50
Not sure that it's essential for the first pass.
| |
| 107 % | 171 % |
| 108 \text{Toplevel decl ($\mathit{td}$)} & ::= & \mathit{vd} \alt \mathit{cd}\\ | 172 \text{Toplevel decl ($\mathit{td}$)} & ::= & \mathit{vd} \alt \mathit{cd}\\ |
| 109 % | 173 % |
| 110 \text{Program ($P$)} & ::= & \program{\many{\mathit{td}}}{b} | 174 \text{Program ($P$)} & ::= & \program{\many{\mathit{td}}}{s} |
|
vsm
2015/07/13 22:36:56
s here is effectively the body of main?
Leaf
2015/07/14 22:39:50
yes.
| |
| 111 \end{array} | 175 \end{array} |
| 112 \] | 176 \] |
| 113 | 177 |
| 114 | 178 |
| 179 Type contexts map type variables to their bounds. | |
| 180 | |
| 181 Class signatures describe the methods and fields in an object, along with the | |
| 182 super class of the class. There are no static methods or fields. | |
| 183 | |
| 184 The class hierararchy records the classes with their signatures. | |
| 185 | |
| 186 The term context maps term variables to their types. I also abuse notation and | |
| 187 allow for the attachment of an optional type to term contexts as follows: | |
| 188 $\Gamma_\sigma$ refers to a term context within the body of a method whose class | |
| 189 type is $\sigma$. | |
| 115 | 190 |
| 116 \[ | 191 \[ |
| 117 \begin{array}{lcl} | 192 \begin{array}{lcl} |
| 193 \text{Type context ($\Delta$)} & ::= & \epsilon \alt \Delta, X \sub \tau \\ | |
|
vsm
2015/07/13 22:36:56
Define what X is in your list above?
Leaf
2015/07/14 22:39:50
Should be type variable T. Fixed.
| |
| 118 \text{Class signature ($\mathit{Sig}$)} & ::= & \dclass{\TApp{C}{\many{T}}}{\TA pp{G}{\many{S}}}{\many{x:\tau}} \\ | 194 \text{Class signature ($\mathit{Sig}$)} & ::= & \dclass{\TApp{C}{\many{T}}}{\TA pp{G}{\many{S}}}{\many{x:\tau}} \\ |
| 119 \text{Type context ($\Delta$)} & ::= & \epsilon \alt \Delta, X \sub \tau \\ | 195 \text{Class hierarchy ($\Phi$)} & ::= & \epsilon \alt \Phi, C\ :\ \mathit{Sig} \\ |
| 120 \text{Class hierarchy ($\Phi$)} & ::= & \epsilon \alt \Phi, C\ :\ \mathit{Sig} | 196 \text{Term context ($\Gamma$)} & ::= & \epsilon \alt \Gamma, x\ :\ \tau |
| 121 \end{array} | 197 \end{array} |
| 122 \] | 198 \] |
| 123 | 199 |
| 124 | 200 |
| 125 \section*{Subtyping} | 201 \section*{Subtyping} |
| 126 \[ | 202 |
| 127 \begin{array}{ccc} | 203 \subsection*{Variant Subtyping} |
| 128 \axiom{\subtypeOf{\Phi, \Delta}{\tau}{\Dynamic}} & | 204 |
| 129 \axiom{\subtypeOf{\Phi, \Delta}{\tau}{\Object}} \\\\ | 205 We include a special kind of covariant function space to model certain dart |
| 130 % | 206 idioms. An arrow type decorated with a positive variance annotation ($+$) |
| 131 \axiom{\subtypeOf{\Phi, \Delta}{\Bottom}{\tau}} & | 207 treats $\Dynamic$ in its argument list covariantly: or equivalently, it treats |
| 132 \axiom{\subtypeOf{\Phi, \Delta}{\tau}{\tau}} \\\\ | 208 $\Dynamic$ as bottom. This variant subtyping relation captures this special |
| 133 % | 209 treatment of dynamic. |
|
vsm
2015/07/13 22:36:56
Do you need an explicit $-$? This is just standar
Leaf
2015/07/14 22:39:50
I'm defining two different relations: variant subt
| |
| 134 \infrule{\Delta = \extends[\sub]{\Delta'}{S}{\sigma} & | 210 |
| 211 \axiom{\subtypeOf[+]{\Phi, \Delta}{\Dynamic}{\tau}} | |
| 212 | |
| 213 \infrule{\subtypeOf{\Phi, \Delta}{\sigma}{\tau} \quad \sigma \neq \Dynamic} | |
| 214 {\subtypeOf[+]{\Phi, \Delta}{\sigma}{\tau}} | |
| 215 | |
| 216 \infrule{\subtypeOf{\Phi, \Delta}{\sigma}{\tau}} | |
| 217 {\subtypeOf[-]{\Phi, \Delta}{\sigma}{\tau}} | |
| 218 | |
| 219 \subsection*{Invariant Subtyping} | |
| 220 | |
| 221 Regular subtyping is defined in a fairly standard way, except that generics are | |
| 222 uniformly covariant, and that function argument types fall into the variant | |
| 223 subtyping relation defined above. | |
| 224 | |
| 225 \axiom{\subtypeOf{\Phi, \Delta}{\tau}{\Dynamic}} | |
| 226 | |
| 227 \axiom{\subtypeOf{\Phi, \Delta}{\tau}{\Object}} | |
| 228 | |
| 229 \axiom{\subtypeOf{\Phi, \Delta}{\Bottom}{\tau}} | |
| 230 | |
| 231 \axiom{\subtypeOf{\Phi, \Delta}{\tau}{\tau}} | |
| 232 | |
| 233 \infrule{(S\, :\, \sigma) \in \Delta \quad | |
| 135 \subtypeOf{\Phi, \Delta}{\sigma}{\tau}} | 234 \subtypeOf{\Phi, \Delta}{\sigma}{\tau}} |
| 136 {\subtypeOf{\Phi, \Delta}{S}{\tau}} \\\\ | 235 {\subtypeOf{\Phi, \Delta}{S}{\tau}} |
| 137 % | 236 |
| 138 \infrule{\subtypeOf{\Phi, \Delta}{\sigma_i}{\tau_i} & i \in 0, \ldots, n & | 237 \infrule{\subtypeOf[k_1]{\Phi, \Delta}{\sigma_i}{\tau_i} \quad i \in 0, \ldots, n \quad\quad |
| 139 \subtypeOf{\Phi, \Delta}{\tau_r}{\sigma_r}} | 238 \subtypeOf{\Phi, \Delta}{\tau_r}{\sigma_r} \\ |
| 239 \quad (k_0 = \mbox{-}) \lor (k_1 = \mbox{+}) | |
| 240 } | |
| 140 {\subtypeOf{\Phi, \Delta} | 241 {\subtypeOf{\Phi, \Delta} |
| 141 {\Arrow{\tau_0, \ldots, \tau_n}{\tau_r}} | 242 {\Arrow[k_0]{\tau_0, \ldots, \tau_n}{\tau_r}} |
| 142 {\Arrow{\sigma_0, \ldots, \sigma_n}{\sigma_r}}} \\\\ | 243 {\Arrow[k_1]{\sigma_0, \ldots, \sigma_n}{\sigma_r}}} |
| 143 % | 244 |
| 144 \infrule{\subtypeOf{\Phi, \Delta}{\tau_i}{\sigma_i} & i \in 0, \ldots, n} | 245 \infrule{\subtypeOf{\Phi, \Delta}{\tau_i}{\sigma_i} & i \in 0, \ldots, n} |
| 145 {\subtypeOf{\Phi, \Delta} | 246 {\subtypeOf{\Phi, \Delta} |
| 146 {\TApp{C}{\tau_0, \ldots, \tau_n}} | 247 {\TApp{C}{\tau_0, \ldots, \tau_n}} |
| 147 {\TApp{C}{\sigma_0, \ldots, \sigma_n}}}\\\\ | 248 {\TApp{C}{\sigma_0, \ldots, \sigma_n}}} |
| 148 % | 249 |
| 149 \infrule{\Phi = \extends{\Phi'}{C}{\dclass{\TApp{C}{T_0,\ldots,T_n}}{\TApp{C'}{\ upsilon_0, \ldots, \upsilon_k}}{\ldots}} \\ | 250 \infrule{(C : \dclass{\TApp{C}{T_0,\ldots,T_n}}{\TApp{C'}{\upsilon_0, \ldots, \u psilon_k}}{\ldots}) \in \Phi \\ |
| 150 \subtypeOf{\Phi, \Delta}{\subst{\tau_0, \ldots, \tau_n}{T_0, \ldots, T_ n}{\TApp{C'}{\upsilon_0, \ldots, \upsilon_k}}}{\TApp{G}{\sigma_0, \ldots, \sigma _m}}} | 251 \subtypeOf{\Phi, \Delta}{\subst{\tau_0, \ldots, \tau_n}{T_0, \ldots, T_ n}{\TApp{C'}{\upsilon_0, \ldots, \upsilon_k}}}{\TApp{G}{\sigma_0, \ldots, \sigma _m}}} |
| 151 {\subtypeOf{\Phi, \Delta} | 252 {\subtypeOf{\Phi, \Delta} |
| 152 {\TApp{C}{\tau_0, \ldots, \tau_n}} | 253 {\TApp{C}{\tau_0, \ldots, \tau_n}} |
| 153 {\TApp{G}{\sigma_0, \ldots, \sigma_m}}} | 254 {\TApp{G}{\sigma_0, \ldots, \sigma_m}}} |
| 154 \end{array} | 255 |
| 155 \] | 256 \section*{Typing} |
| 257 \input{static-semantics} | |
| 258 | |
| 259 \section*{Translation} | |
| 260 | |
| 261 These are the same rules, extended with a translated term which corresponds to | |
| 262 the original term with the additional dynamic type checks inserted to reify the | |
| 263 static unsoundness as runtime type errors. | |
| 264 | |
| 265 \setboolean{show_translation}{true} | |
| 266 %\input{static-semantics} | |
| 267 | |
| 156 | 268 |
| 157 \end{document} | 269 \end{document} |
| OLD | NEW |