@@ -462,7 +462,7 @@ Reference Instructions
462462 S; F; \val ^n~(\STRUCTNEW ~x) &\stepto & S'; F; (\REFSTRUCTADDR ~|S.\SSTRUCTS |)
463463 \\&&
464464 \begin {array}[t]{@{}r@{~}l@{}}
465- (\iff & F.\AMODULE .\MITYPES [x] = \TSTRUCT ~\X {ft}^n \\
465+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TSTRUCT ~\X {ft}^n \\
466466 \land & \X {si} = \{\SITYPE ~F.\AMODULE .\MITYPES [x], \SIFIELDS ~(\packval _{\X {ft}}(\val ))^n\} \\
467467 \land & S' = S \with \SSTRUCTS = S.\SSTRUCTS ~\X {si})
468468 \end {array} \\
@@ -501,7 +501,7 @@ Reference Instructions
501501 F; (\STRUCTNEWDEFAULT ~x) &\stepto & (\default _{\unpacktype (\X {ft})}))^n~(\STRUCTNEW ~x)
502502 \\&&
503503 \begin {array}[t]{@{}r@{~}l@{}}
504- (\iff & F.\AMODULE .\MITYPES [x] = \TSTRUCT ~\X {ft}^n)
504+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TSTRUCT ~\X {ft}^n)
505505 \end {array} \\
506506 \end {array}
507507
@@ -511,7 +511,7 @@ Reference Instructions
511511 S; F; (\STRUCTNEWDEFAULT~x) &\stepto& S'; F; (\REFSTRUCTADDR~|S.\SSTRUCTS|)
512512 \\&&
513513 \begin{array}[t]{@{}r@{~}l@{}}
514- (\iff & F.\AMODULE.\MITYPES[x] = \TSTRUCT~\X{ft}^n \\
514+ (\iff & \expand( F.\AMODULE.\MITYPES[x]) = \TSTRUCT~\X{ft}^n \\
515515 \land & \X{si} = \{\SITYPE~F.\AMODULE.\MITYPES[x], \SIFIELDS~(\packval_{\X{ft}}(\default_{\unpacktype(\X{ft})}))^n\} \\
516516 \land & S' = S \with \SSTRUCTS = S.\SSTRUCTS~\X{si})
517517 \end{array} \\
@@ -561,7 +561,7 @@ Reference Instructions
561561 S; F; (\REFSTRUCTADDR ~a)~(\STRUCTGET\K {\_ }\sx ^?~x~i) &\stepto & \val
562562 &
563563 \begin {array}[t]{@{}r@{~}l@{}}
564- (\iff & F.\AMODULE .\MITYPES [x] = \TSTRUCT ~\X {ft}^\ast \\
564+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TSTRUCT ~\X {ft}^n \\
565565 \land & \val = \unpackval ^{\sx ^?}_{\X {ft}^\ast [i]}(S.\SSTRUCTS [a].\SIFIELDS [i]))
566566 \end {array} \\
567567 S; F; (\REFNULL ~t)~(\STRUCTGET\K {\_ }\sx ^?~x~i) &\stepto & \TRAP
@@ -612,7 +612,7 @@ Reference Instructions
612612 S; F; (\REFSTRUCTADDR ~a)~\val ~(\STRUCTSET ~x~i) &\stepto & S'; \epsilon
613613 &
614614 \begin {array}[t]{@{}r@{~}l@{}}
615- (\iff & F.\AMODULE .\MITYPES [x] = \TSTRUCT ~\X {ft}^\ast \\
615+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TSTRUCT ~\X {ft}^n \\
616616 \land & S' = S \with \SSTRUCTS [a].\SIFIELDS [i] = \packval _{\X {ft}^\ast [i]}(\val ))
617617 \end {array} \\
618618 S; F; (\REFNULL ~t)~\val ~(\STRUCTSET ~x~i) &\stepto & \TRAP
@@ -657,7 +657,7 @@ Reference Instructions
657657 S; F; \val~(\I32.\CONST~n)~(\ARRAYNEW~x) &\stepto& S'; F; (\REFARRAYADDR~|S.\SARRAYS|)
658658 \\&&
659659 \begin{array}[t]{@{}r@{~}l@{}}
660- (\iff & F.\AMODULE.\MITYPES[x] = \TARRAY~\X{ft} \\
660+ (\iff & \expand( F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft} \\
661661 \land & \X{ai} = \{\AITYPE~F.\AMODULE.\MITYPES[x], \AIFIELDS~(\packval_{\X{ft}}(\val))^n\} \\
662662 \land & S' = S \with \SARRAYS = S.\SARRAYS~\X{ai})
663663 \end{array} \\
@@ -696,7 +696,7 @@ Reference Instructions
696696 F; (\I32 .\CONST ~n)~(\ARRAYNEWDEFAULT ~x) &\stepto & (\default _{\unpacktype (\X {ft}}))^n~(\ARRAYNEWFIXED ~x~n)
697697 \\&&
698698 \begin {array}[t]{@{}r@{~}l@{}}
699- (\iff & F.\AMODULE .\MITYPES . \MITYPES [x] = \TARRAY ~\X {ft})
699+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TARRAY ~\X {ft})
700700 \end {array} \\
701701 \end {array}
702702
@@ -706,7 +706,7 @@ Reference Instructions
706706 S; F; (\I32.\CONST~n)~(\ARRAYNEWDEFAULT~x) &\stepto& S'; F; (\REFARRAYADDR~|S.\SARRAYS|)
707707 \\&&
708708 \begin{array}[t]{@{}r@{~}l@{}}
709- (\iff & F.\AMODULE.\MITYPES[x] = \TARRAY~\X{ft} \\
709+ (\iff & \expand( F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft} \\
710710 \land & \X{ai} = \{\AITYPE~F.\AMODULE.\MITYPES[x], \AIFIELDS~(\packval_{\X{ft}}(\default_{\unpacktype(\X{ft}}))^n\} \\
711711 \land & S' = S \with \SARRAYS = S.\SARRAYS~\X{ai})
712712 \end{array} \\
@@ -751,7 +751,7 @@ Reference Instructions
751751 S; F; \val ^n~(\ARRAYNEWFIXED ~x~n) &\stepto & S'; F; (\REFARRAYADDR ~|S.\SARRAYS |)
752752 \\&&
753753 \begin {array}[t]{@{}r@{~}l@{}}
754- (\iff & F.\AMODULE .\MITYPES [x] = \TARRAY ~\X {ft} \\
754+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TARRAY ~\X {ft}^n \\
755755 \land & \X {ai} = \{\AITYPE ~F.\AMODULE .\MITYPES [x], \AIFIELDS ~(\packval _{\X {ft}}(\val ))^n\} \\
756756 \land & S' = S \with \SARRAYS = S.\SARRAYS ~\X {ai})
757757 \end {array} \\
@@ -814,14 +814,14 @@ Reference Instructions
814814 S; F; (\I32 .\CONST ~s)~(\I32 .\CONST ~n)~(\ARRAYNEWDATA ~x~y) &\stepto & \TRAP
815815 \\&&
816816 \begin {array}[t]{@{}r@{~}l@{}}
817- (\iff & F.\AMODULE .\MITYPES [x] = \TARRAY ~\X {ft}^n \\
817+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TARRAY ~\X {ft}^n \\
818818 \land & s + n\cdot |\X {ft}| > |S.\SDATAS [F.\AMODULE .\MIDATAS [y]].\DIDATA |)
819819 \end {array} \\
820820 \\[ 1 ex]
821821 S; F; (\I32 .\CONST ~s)~(\I32 .\CONST ~n)~(\ARRAYNEWDATA ~x~y) &\stepto & (t.\CONST ~c)^n~(\ARRAYNEWFIXED ~x~n)
822822 \\&&
823823 \begin {array}[t]{@{}r@{~}l@{}}
824- (\iff & F.\AMODULE .\MITYPES [x] = \TARRAY ~\X {ft}^n \\
824+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TARRAY ~\X {ft}^n \\
825825 \land & t = \unpacktype (\X {ft}) \\
826826 \land & (\bytes _{\X {ft}}(c))^n = S.\SDATAS [F.\AMODULE .\MIDATAS [y]].\DIDATA [s \slice n\cdot |\X {ft}|] \\
827827 \end {array} \\
@@ -931,7 +931,7 @@ Reference Instructions
931931 S; F; (\REFARRAYADDR ~a)~(\I32 .\CONST ~i)~(\ARRAYGET\K {\_ }\sx ^?~x) &\stepto & \val
932932 &
933933 \begin {array}[t]{@{}r@{~}l@{}}
934- (\iff & F.\AMODULE .\MITYPES [x] = \TARRAY ~\X {ft} \\
934+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TARRAY ~\X {ft} \\
935935 \land & \val = \unpackval ^{\sx ^?}_{\X {ft}}(S.\SARRAYS [a].\AIFIELDS [i]))
936936 \end {array} \\
937937 S; F; (\REFARRAYADDR ~a)~(\I32 .\CONST ~i)~(\ARRAYGET\K {\_ }\sx ^?~x) &\stepto & \val
@@ -990,7 +990,7 @@ Reference Instructions
990990 S; F; (\REFARRAYADDR ~a)~(\I32 .\CONST ~i)~\val ~(\ARRAYSET ~x) &\stepto & S'; \epsilon
991991 &
992992 \begin {array}[t]{@{}r@{~}l@{}}
993- (\iff & F.\AMODULE .\MITYPES [x] = \TSTRUCT ~\X {ft}^n \\
993+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TSTRUCT ~\X {ft}^n \\
994994 \land & S' = S \with \SARRAYS [a].\AIFIELDS [i] = \packval _{\X {ft}}(\val ))
995995 \end {array} \\
996996 S; F; (\REFNULL ~t)~(\I32 .\CONST ~i)~\val ~(\ARRAYSET ~x) &\stepto & \TRAP
@@ -3589,9 +3589,9 @@ Control Instructions
35893589
359035901. Let :math: `F` be the :ref: `current <exec-notation-textual >` :ref: `frame <syntax-frame >`.
35913591
3592- 2. Assert: due to :ref: `validation <valid-blocktype >`, :math: `\expand _ {S;F}(\blocktype )` is defined.
3592+ 2. Assert: due to :ref: `validation <valid-blocktype >`, :math: `\fblocktype _ {S;F}(\blocktype )` is defined.
35933593
3594- 3. Let :math: `[t_1 ^m] \to [t_2 ^n]` be the :ref: `instruction type <syntax-instrtype >` :math: `\expand _ {S;F}(\blocktype )`.
3594+ 3. Let :math: `[t_1 ^m] \to [t_2 ^n]` be the :ref: `instruction type <syntax-instrtype >` :math: `\fblocktype _ {S;F}(\blocktype )`.
35953595
359635964. Let :math: `L` be the label whose arity is :math: `n` and whose continuation is the end of the block.
35973597
@@ -3606,7 +3606,7 @@ Control Instructions
36063606 \begin {array}{lcl}
36073607 S; F; \val ^m~\BLOCK ~\X {bt}~\instr ^\ast ~\END &\stepto &
36083608 S; F; \LABEL _n\{\epsilon \}~\val ^m~\instr ^\ast ~\END
3609- \\&&\quad (\iff \expand _ {S;F}(\X {bt}) = [t_1 ^m] \to [t_2 ^n])
3609+ \\&&\quad (\iff \fblocktype _ {S;F}(\X {bt}) = [t_1 ^m] \to [t_2 ^n])
36103610 \end {array}
36113611
36123612
@@ -3617,9 +3617,9 @@ Control Instructions
36173617
361836181. Let :math: `F` be the :ref: `current <exec-notation-textual >` :ref: `frame <syntax-frame >`.
36193619
3620- 2. Assert: due to :ref: `validation <valid-blocktype >`, :math: `\expand _ {S;F}(\blocktype )` is defined.
3620+ 2. Assert: due to :ref: `validation <valid-blocktype >`, :math: `\fblocktype _ {S;F}(\blocktype )` is defined.
36213621
3622- 3. Let :math: `[t_1 ^m] \to [t_2 ^n]` be the :ref: `instruction type <syntax-instrtype >` :math: `\expand _ {S;F}(\blocktype )`.
3622+ 3. Let :math: `[t_1 ^m] \to [t_2 ^n]` be the :ref: `instruction type <syntax-instrtype >` :math: `\fblocktype _ {S;F}(\blocktype )`.
36233623
362436244. Let :math: `L` be the label whose arity is :math: `m` and whose continuation is the start of the loop.
36253625
@@ -3634,7 +3634,7 @@ Control Instructions
36343634 \begin {array}{lcl}
36353635 S; F; \val ^m~\LOOP ~\X {bt}~\instr ^\ast ~\END &\stepto &
36363636 S; F; \LABEL _m\{\LOOP ~\X {bt}~\instr ^\ast ~\END \}~\val ^m~\instr ^\ast ~\END
3637- \\&&\quad (\iff \expand _ {S;F}(\X {bt}) = [t_1 ^m] \to [t_2 ^n])
3637+ \\&&\quad (\iff \fblocktype _ {S;F}(\X {bt}) = [t_1 ^m] \to [t_2 ^n])
36383638 \end {array}
36393639
36403640
@@ -3978,9 +3978,9 @@ Control Instructions
39783978
397939795. Let :math: `\X {tab}` be the :ref: `table instance <syntax-tableinst >` :math: `S.\STABLES [\X {ta}]`.
39803980
3981- 6. Assert: due to :ref: `validation <valid-call_indirect >`, :math: `F.\AMODULE .\MITYPES [y]` exists .
3981+ 6. Assert: due to :ref: `validation <valid-call_indirect >`, :math: `F.\AMODULE .\MITYPES [y]` is defined .
39823982
3983- 7. Let :math: `\X {ft }_{\F {expect}}` be the :ref: `function type <syntax-functype >` :math: `F.\AMODULE .\MITYPES [y]`.
3983+ 7. Let :math: `\X {dt }_{\F {expect}}` be the :ref: `defined type <syntax-deftype >` :math: `F.\AMODULE .\MITYPES [y]`.
39843984
398539858. Assert: due to :ref: `validation <valid-call_indirect >`, a value with :ref: `value type <syntax-valtype >` |I32 | is on the top of the stack.
39863986
@@ -4004,9 +4004,9 @@ Control Instructions
40044004
4005400516. Let :math: `\X {f}` be the :ref: `function instance <syntax-funcinst >` :math: `S.\SFUNCS [a]`.
40064006
4007- 17. Let :math: `\X {ft }_{\F {actual}}` be the :ref: `function type <syntax-functype >` :math: `\X {f}.\FITYPE `.
4007+ 17. Let :math: `\X {dt }_{\F {actual}}` be the :ref: `defined type <syntax-deftype >` :math: `\X {f}.\FITYPE `.
40084008
4009- 18. If :math: `\X {ft }_{\F {actual}}` and : math: `\X {ft }_{\F {expect}}` differ , then:
4009+ 18. If :math: `\X {dt }_{\F {actual}}` does not :ref: ` match < match-deftype >` : math: `\X {dt }_{\F {expect}}`, then:
40104010
40114011 a. Trap.
40124012
@@ -4022,7 +4022,7 @@ Control Instructions
40224022 \begin {array}[t]{@{}r@{~}l@{}}
40234023 (\iff & S.\STABLES [F.\AMODULE .\MITABLES [x]].\TIELEM [i] = \REFFUNCADDR ~a \\
40244024 \wedge & S.\SFUNCS [a] = f \\
4025- \wedge & S \vdashfunctypematch F.\AMODULE .\MITYPES [y] \matchesfunctype f.\FITYPE )
4025+ \wedge & S \vdashdeftypematch F.\AMODULE .\MITYPES [y] \matchesdeftype f.\FITYPE )
40264026 \end {array}
40274027 \\[ 1 ex]
40284028 \begin {array}{lcl@{\qquad }l}
@@ -4099,9 +4099,9 @@ Control Instructions
40994099
410041005. Let :math: `\X {tab}` be the :ref: `table instance <syntax-tableinst >` :math: `S.\STABLES [\X {ta}]`.
41014101
4102- 6. Assert: due to :ref: `validation <valid-call_indirect >`, :math: `F.\AMODULE .\MITYPES [x]` exists .
4102+ 6. Assert: due to :ref: `validation <valid-call_indirect >`, :math: `F.\AMODULE .\MITYPES [x]` is defined .
41034103
4104- 7. Let :math: `\X {ft }_{\F {expect}}` be the :ref: `function type <syntax-functype >` :math: `F.\AMODULE .\MITYPES [x]`.
4104+ 7. Let :math: `\X {dt }_{\F {expect}}` be the :ref: `defined type <syntax-deftype >` :math: `F.\AMODULE .\MITYPES [x]`.
41054105
410641068. Assert: due to :ref: `validation <valid-call_indirect >`, a value with :ref: `value type <syntax-valtype >` |I32 | is on the top of the stack.
41074107
@@ -4121,9 +4121,9 @@ Control Instructions
41214121
4122412214. Let :math: `\X {f}` be the :ref: `function instance <syntax-funcinst >` :math: `S.\SFUNCS [a]`.
41234123
4124- 15. Let :math: `\X {ft }_{\F {actual}}` be the :ref: `function type <syntax-functype >` :math: `\X {f}.\FITYPE `.
4124+ 15. Let :math: `\X {dt }_{\F {actual}}` be the :ref: `defined type <syntax-functype >` :math: `\X {f}.\FITYPE `.
41254125
4126- 16. If :math: `\X {ft }_{\F {actual}}` and : math: `\X {ft }_{\F {expect}}` differ , then:
4126+ 16. If :math: `\X {dt }_{\F {actual}}` does not :ref: ` match < match-functype >` : math: `\X {dt }_{\F {expect}}`, then:
41274127
41284128 a. Trap.
41294129
@@ -4210,7 +4210,7 @@ Invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
42104210
421142112. Let :math: `f` be the :ref: `function instance <syntax-funcinst >`, :math: `S.\SFUNCS [a]`.
42124212
4213- 3. Let :math: `[t_1 ^n] \toF [t_2 ^m]` be the :ref: `function type <syntax-functype >` :math: `\X {f}.\FITYPE `.
4213+ 3. Let :math: `\TFUNC ~ [t_1 ^n] \toF [t_2 ^m]` be the :ref: `structured type <syntax-strtype >` :math: `\expand ( \ X {f}.\FITYPE ) `.
42144214
421542154. Let :math: `\local ^\ast ` be the list of :ref: `locals <syntax-local >` :math: `f.\FICODE .\FLOCALS `.
42164216
@@ -4237,7 +4237,7 @@ Invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
42374237 \\ \qquad
42384238 \begin {array}[t]{@{}r@{~}l@{}}
42394239 (\iff & S.\SFUNCS [a] = f \\
4240- \wedge & S.f.\FITYPE = [t_1 ^n] \toF [t_2 ^m] \\
4240+ \wedge & \expand ( S.f.\FITYPE ) = \TFUNC ~ [t_1 ^n] \toF [t_2 ^m] \\
42414241 \wedge & f.\FICODE = \{ \FTYPE ~x, \FLOCALS ~\{\LTYPE ~t\} ^k, \FBODY ~\instr ^\ast ~\END \} \\
42424242 \wedge & F = \{ \AMODULE ~f.\FIMODULE , ~\ALOCALS ~\val ^n~(\default _t)^k \})
42434243 \end {array} \\
@@ -4254,7 +4254,7 @@ Tail-invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
42544254
425542551. Assert: due to :ref: `validation <valid-call >`, :math: `S.\SFUNCS [a]` exists.
42564256
4257- 2. Let :math: `[t_1 ^n] \toF [t_2 ^m]` be the :ref: `function type <syntax-functype >` :math: `S.\SFUNCS [a].\FITYPE `.
4257+ 2. Let :math: `\TFUNC ~ [t_1 ^n] \toF [t_2 ^m]` be the :ref: `structured type <syntax-strtype >` :math: `\expand ( S.\SFUNCS [a].\FITYPE ) `.
42584258
425942593. Assert: due to :ref: `validation <valid-return_call >`, there are at least :math: `n` values on the top of the stack.
42604260
@@ -4279,7 +4279,7 @@ Tail-invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
42794279 \begin {array}{lcl@{\qquad }l}
42804280 S; \FRAME _m\{ F\}~B^\ast [\val ^n~(\RETURNINVOKE ~a)]~\END &\stepto &
42814281 \val ^n~(\INVOKE ~a)
4282- & (\iff S.\SFUNCS [a].\FITYPE = [t_1 ^n] \toF [t_2 ^m])
4282+ & (\iff \expand ( S.\SFUNCS [a].\FITYPE ) = \TFUNC ~ [t_1 ^n] \toF [t_2 ^m])
42834283 \end {array}
42844284
42854285
@@ -4336,15 +4336,17 @@ Furthermore, the resulting store must be :ref:`valid <valid-store>`, i.e., all d
43364336 \end {array}
43374337 \\ \qquad
43384338 \begin {array}[t]{@{}r@{~}l@{}}
4339- (\iff & S.\SFUNCS [a] = \{ \FITYPE ~[t_1 ^n] \toF [t_2 ^m], \FIHOSTCODE ~\X {hf} \} \\
4339+ (\iff & S.\SFUNCS [a] = \{ \FITYPE ~\deftype , \FIHOSTCODE ~\X {hf} \} \\
4340+ \wedge & \expand (\deftype ) = \TFUNC ~[t_1 ^n] \toF [t_2 ^m] \\
43404341 \wedge & (S'; \result ) \in \X {hf}(S; \val ^n)) \\
43414342 \end {array} \\
43424343 \begin {array}{lcl@{\qquad }l}
43434344 S; \val ^n~(\INVOKE ~a) &\stepto & S; \val ^n~(\INVOKE ~a)
43444345 \end {array}
43454346 \\ \qquad
43464347 \begin {array}[t]{@{}r@{~}l@{}}
4347- (\iff & S.\SFUNCS [a] = \{ \FITYPE ~[t_1 ^n] \toF [t_2 ^m], \FIHOSTCODE ~\X {hf} \} \\
4348+ (\iff & S.\SFUNCS [a] = \{ \FITYPE ~\deftype , \FIHOSTCODE ~\X {hf} \} \\
4349+ \wedge & \expand (\deftype ) = \TFUNC ~[t_1 ^n] \toF [t_2 ^m] \\
43484350 \wedge & \bot \in \X {hf}(S; \val ^n)) \\
43494351 \end {array} \\
43504352 \end {array}
0 commit comments