@@ -462,7 +462,7 @@ Reference Instructions
462
462
S; F; \val ^n~(\STRUCTNEW ~x) &\stepto & S'; F; (\REFSTRUCTADDR ~|S.\SSTRUCTS |)
463
463
\\&&
464
464
\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 \\
466
466
\land & \X {si} = \{\SITYPE ~F.\AMODULE .\MITYPES [x], \SIFIELDS ~(\packval _{\X {ft}}(\val ))^n\} \\
467
467
\land & S' = S \with \SSTRUCTS = S.\SSTRUCTS ~\X {si})
468
468
\end {array} \\
@@ -501,7 +501,7 @@ Reference Instructions
501
501
F; (\STRUCTNEWDEFAULT ~x) &\stepto & (\default _{\unpacktype (\X {ft})}))^n~(\STRUCTNEW ~x)
502
502
\\&&
503
503
\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)
505
505
\end {array} \\
506
506
\end {array}
507
507
@@ -511,7 +511,7 @@ Reference Instructions
511
511
S; F; (\STRUCTNEWDEFAULT~x) &\stepto& S'; F; (\REFSTRUCTADDR~|S.\SSTRUCTS|)
512
512
\\&&
513
513
\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 \\
515
515
\land & \X{si} = \{\SITYPE~F.\AMODULE.\MITYPES[x], \SIFIELDS~(\packval_{\X{ft}}(\default_{\unpacktype(\X{ft})}))^n\} \\
516
516
\land & S' = S \with \SSTRUCTS = S.\SSTRUCTS~\X{si})
517
517
\end{array} \\
@@ -561,7 +561,7 @@ Reference Instructions
561
561
S; F; (\REFSTRUCTADDR ~a)~(\STRUCTGET\K {\_ }\sx ^?~x~i) &\stepto & \val
562
562
&
563
563
\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 \\
565
565
\land & \val = \unpackval ^{\sx ^?}_{\X {ft}^\ast [i]}(S.\SSTRUCTS [a].\SIFIELDS [i]))
566
566
\end {array} \\
567
567
S; F; (\REFNULL ~t)~(\STRUCTGET\K {\_ }\sx ^?~x~i) &\stepto & \TRAP
@@ -612,7 +612,7 @@ Reference Instructions
612
612
S; F; (\REFSTRUCTADDR ~a)~\val ~(\STRUCTSET ~x~i) &\stepto & S'; \epsilon
613
613
&
614
614
\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 \\
616
616
\land & S' = S \with \SSTRUCTS [a].\SIFIELDS [i] = \packval _{\X {ft}^\ast [i]}(\val ))
617
617
\end {array} \\
618
618
S; F; (\REFNULL ~t)~\val ~(\STRUCTSET ~x~i) &\stepto & \TRAP
@@ -657,7 +657,7 @@ Reference Instructions
657
657
S; F; \val~(\I32.\CONST~n)~(\ARRAYNEW~x) &\stepto& S'; F; (\REFARRAYADDR~|S.\SARRAYS|)
658
658
\\&&
659
659
\begin{array}[t]{@{}r@{~}l@{}}
660
- (\iff & F.\AMODULE.\MITYPES[x] = \TARRAY~\X{ft} \\
660
+ (\iff & \expand( F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft} \\
661
661
\land & \X{ai} = \{\AITYPE~F.\AMODULE.\MITYPES[x], \AIFIELDS~(\packval_{\X{ft}}(\val))^n\} \\
662
662
\land & S' = S \with \SARRAYS = S.\SARRAYS~\X{ai})
663
663
\end{array} \\
@@ -696,7 +696,7 @@ Reference Instructions
696
696
F; (\I32 .\CONST ~n)~(\ARRAYNEWDEFAULT ~x) &\stepto & (\default _{\unpacktype (\X {ft}}))^n~(\ARRAYNEWFIXED ~x~n)
697
697
\\&&
698
698
\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})
700
700
\end {array} \\
701
701
\end {array}
702
702
@@ -706,7 +706,7 @@ Reference Instructions
706
706
S; F; (\I32.\CONST~n)~(\ARRAYNEWDEFAULT~x) &\stepto& S'; F; (\REFARRAYADDR~|S.\SARRAYS|)
707
707
\\&&
708
708
\begin{array}[t]{@{}r@{~}l@{}}
709
- (\iff & F.\AMODULE.\MITYPES[x] = \TARRAY~\X{ft} \\
709
+ (\iff & \expand( F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft} \\
710
710
\land & \X{ai} = \{\AITYPE~F.\AMODULE.\MITYPES[x], \AIFIELDS~(\packval_{\X{ft}}(\default_{\unpacktype(\X{ft}}))^n\} \\
711
711
\land & S' = S \with \SARRAYS = S.\SARRAYS~\X{ai})
712
712
\end{array} \\
@@ -751,7 +751,7 @@ Reference Instructions
751
751
S; F; \val ^n~(\ARRAYNEWFIXED ~x~n) &\stepto & S'; F; (\REFARRAYADDR ~|S.\SARRAYS |)
752
752
\\&&
753
753
\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 \\
755
755
\land & \X {ai} = \{\AITYPE ~F.\AMODULE .\MITYPES [x], \AIFIELDS ~(\packval _{\X {ft}}(\val ))^n\} \\
756
756
\land & S' = S \with \SARRAYS = S.\SARRAYS ~\X {ai})
757
757
\end {array} \\
@@ -814,14 +814,14 @@ Reference Instructions
814
814
S; F; (\I32 .\CONST ~s)~(\I32 .\CONST ~n)~(\ARRAYNEWDATA ~x~y) &\stepto & \TRAP
815
815
\\&&
816
816
\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 \\
818
818
\land & s + n\cdot |\X {ft}| > |S.\SDATAS [F.\AMODULE .\MIDATAS [y]].\DIDATA |)
819
819
\end {array} \\
820
820
\\[ 1 ex]
821
821
S; F; (\I32 .\CONST ~s)~(\I32 .\CONST ~n)~(\ARRAYNEWDATA ~x~y) &\stepto & (t.\CONST ~c)^n~(\ARRAYNEWFIXED ~x~n)
822
822
\\&&
823
823
\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 \\
825
825
\land & t = \unpacktype (\X {ft}) \\
826
826
\land & (\bytes _{\X {ft}}(c))^n = S.\SDATAS [F.\AMODULE .\MIDATAS [y]].\DIDATA [s \slice n\cdot |\X {ft}|] \\
827
827
\end {array} \\
@@ -931,7 +931,7 @@ Reference Instructions
931
931
S; F; (\REFARRAYADDR ~a)~(\I32 .\CONST ~i)~(\ARRAYGET\K {\_ }\sx ^?~x) &\stepto & \val
932
932
&
933
933
\begin {array}[t]{@{}r@{~}l@{}}
934
- (\iff & F.\AMODULE .\MITYPES [x] = \TARRAY ~\X {ft} \\
934
+ (\iff & \expand ( F.\AMODULE .\MITYPES [x]) = \TARRAY ~\X {ft} \\
935
935
\land & \val = \unpackval ^{\sx ^?}_{\X {ft}}(S.\SARRAYS [a].\AIFIELDS [i]))
936
936
\end {array} \\
937
937
S; F; (\REFARRAYADDR ~a)~(\I32 .\CONST ~i)~(\ARRAYGET\K {\_ }\sx ^?~x) &\stepto & \val
@@ -990,7 +990,7 @@ Reference Instructions
990
990
S; F; (\REFARRAYADDR ~a)~(\I32 .\CONST ~i)~\val ~(\ARRAYSET ~x) &\stepto & S'; \epsilon
991
991
&
992
992
\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 \\
994
994
\land & S' = S \with \SARRAYS [a].\AIFIELDS [i] = \packval _{\X {ft}}(\val ))
995
995
\end {array} \\
996
996
S; F; (\REFNULL ~t)~(\I32 .\CONST ~i)~\val ~(\ARRAYSET ~x) &\stepto & \TRAP
@@ -3589,9 +3589,9 @@ Control Instructions
3589
3589
3590
3590
1. Let :math: `F` be the :ref: `current <exec-notation-textual >` :ref: `frame <syntax-frame >`.
3591
3591
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.
3593
3593
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 )`.
3595
3595
3596
3596
4. Let :math: `L` be the label whose arity is :math: `n` and whose continuation is the end of the block.
3597
3597
@@ -3606,7 +3606,7 @@ Control Instructions
3606
3606
\begin {array}{lcl}
3607
3607
S; F; \val ^m~\BLOCK ~\X {bt}~\instr ^\ast ~\END &\stepto &
3608
3608
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])
3610
3610
\end {array}
3611
3611
3612
3612
@@ -3617,9 +3617,9 @@ Control Instructions
3617
3617
3618
3618
1. Let :math: `F` be the :ref: `current <exec-notation-textual >` :ref: `frame <syntax-frame >`.
3619
3619
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.
3621
3621
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 )`.
3623
3623
3624
3624
4. Let :math: `L` be the label whose arity is :math: `m` and whose continuation is the start of the loop.
3625
3625
@@ -3634,7 +3634,7 @@ Control Instructions
3634
3634
\begin {array}{lcl}
3635
3635
S; F; \val ^m~\LOOP ~\X {bt}~\instr ^\ast ~\END &\stepto &
3636
3636
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])
3638
3638
\end {array}
3639
3639
3640
3640
@@ -3978,9 +3978,9 @@ Control Instructions
3978
3978
3979
3979
5. Let :math: `\X {tab}` be the :ref: `table instance <syntax-tableinst >` :math: `S.\STABLES [\X {ta}]`.
3980
3980
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 .
3982
3982
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]`.
3984
3984
3985
3985
8. Assert: due to :ref: `validation <valid-call_indirect >`, a value with :ref: `value type <syntax-valtype >` |I32 | is on the top of the stack.
3986
3986
@@ -4004,9 +4004,9 @@ Control Instructions
4004
4004
4005
4005
16. Let :math: `\X {f}` be the :ref: `function instance <syntax-funcinst >` :math: `S.\SFUNCS [a]`.
4006
4006
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 `.
4008
4008
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:
4010
4010
4011
4011
a. Trap.
4012
4012
@@ -4022,7 +4022,7 @@ Control Instructions
4022
4022
\begin {array}[t]{@{}r@{~}l@{}}
4023
4023
(\iff & S.\STABLES [F.\AMODULE .\MITABLES [x]].\TIELEM [i] = \REFFUNCADDR ~a \\
4024
4024
\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 )
4026
4026
\end {array}
4027
4027
\\[ 1 ex]
4028
4028
\begin {array}{lcl@{\qquad }l}
@@ -4099,9 +4099,9 @@ Control Instructions
4099
4099
4100
4100
5. Let :math: `\X {tab}` be the :ref: `table instance <syntax-tableinst >` :math: `S.\STABLES [\X {ta}]`.
4101
4101
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 .
4103
4103
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]`.
4105
4105
4106
4106
8. Assert: due to :ref: `validation <valid-call_indirect >`, a value with :ref: `value type <syntax-valtype >` |I32 | is on the top of the stack.
4107
4107
@@ -4121,9 +4121,9 @@ Control Instructions
4121
4121
4122
4122
14. Let :math: `\X {f}` be the :ref: `function instance <syntax-funcinst >` :math: `S.\SFUNCS [a]`.
4123
4123
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 `.
4125
4125
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:
4127
4127
4128
4128
a. Trap.
4129
4129
@@ -4210,7 +4210,7 @@ Invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
4210
4210
4211
4211
2. Let :math: `f` be the :ref: `function instance <syntax-funcinst >`, :math: `S.\SFUNCS [a]`.
4212
4212
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 ) `.
4214
4214
4215
4215
4. Let :math: `\local ^\ast ` be the list of :ref: `locals <syntax-local >` :math: `f.\FICODE .\FLOCALS `.
4216
4216
@@ -4237,7 +4237,7 @@ Invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
4237
4237
\\ \qquad
4238
4238
\begin {array}[t]{@{}r@{~}l@{}}
4239
4239
(\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] \\
4241
4241
\wedge & f.\FICODE = \{ \FTYPE ~x, \FLOCALS ~\{\LTYPE ~t\} ^k, \FBODY ~\instr ^\ast ~\END \} \\
4242
4242
\wedge & F = \{ \AMODULE ~f.\FIMODULE , ~\ALOCALS ~\val ^n~(\default _t)^k \})
4243
4243
\end {array} \\
@@ -4254,7 +4254,7 @@ Tail-invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
4254
4254
4255
4255
1. Assert: due to :ref: `validation <valid-call >`, :math: `S.\SFUNCS [a]` exists.
4256
4256
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 ) `.
4258
4258
4259
4259
3. Assert: due to :ref: `validation <valid-return_call >`, there are at least :math: `n` values on the top of the stack.
4260
4260
@@ -4279,7 +4279,7 @@ Tail-invocation of :ref:`function address <syntax-funcaddr>` :math:`a`
4279
4279
\begin {array}{lcl@{\qquad }l}
4280
4280
S; \FRAME _m\{ F\}~B^\ast [\val ^n~(\RETURNINVOKE ~a)]~\END &\stepto &
4281
4281
\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])
4283
4283
\end {array}
4284
4284
4285
4285
@@ -4336,15 +4336,17 @@ Furthermore, the resulting store must be :ref:`valid <valid-store>`, i.e., all d
4336
4336
\end {array}
4337
4337
\\ \qquad
4338
4338
\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] \\
4340
4341
\wedge & (S'; \result ) \in \X {hf}(S; \val ^n)) \\
4341
4342
\end {array} \\
4342
4343
\begin {array}{lcl@{\qquad }l}
4343
4344
S; \val ^n~(\INVOKE ~a) &\stepto & S; \val ^n~(\INVOKE ~a)
4344
4345
\end {array}
4345
4346
\\ \qquad
4346
4347
\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] \\
4348
4350
\wedge & \bot \in \X {hf}(S; \val ^n)) \\
4349
4351
\end {array} \\
4350
4352
\end {array}
0 commit comments