diff --git a/specification/wasm-3.0/4.1-execution.values.spectec b/specification/wasm-3.0/4.1-execution.values.spectec index 463f87ef45..060abbaaae 100644 --- a/specification/wasm-3.0/4.1-execution.values.spectec +++ b/specification/wasm-3.0/4.1-execution.values.spectec @@ -126,4 +126,5 @@ rule Externaddr_ok/func: rule Externaddr_ok/sub: s |- externaddr : xt -- Externaddr_ok: s |- externaddr : xt' + -- Externtype_ok: {} |- xt : OK -- Externtype_sub: {} |- xt' <: xt diff --git a/specification/wasm-latest/4.1-execution.values.spectec b/specification/wasm-latest/4.1-execution.values.spectec index 463f87ef45..060abbaaae 100644 --- a/specification/wasm-latest/4.1-execution.values.spectec +++ b/specification/wasm-latest/4.1-execution.values.spectec @@ -126,4 +126,5 @@ rule Externaddr_ok/func: rule Externaddr_ok/sub: s |- externaddr : xt -- Externaddr_ok: s |- externaddr : xt' + -- Externtype_ok: {} |- xt : OK -- Externtype_sub: {} |- xt' <: xt diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index 02198ef1a4..d8a21d05d5 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -6450,10 +6450,11 @@ relation Externaddr_ok: `%|-%:%`(store, externaddr, externtype) `%|-%:%`(s, FUNC_externaddr(a), FUNC_externtype((funcinst.TYPE_funcinst : deftype <: typeuse))) -- if (s.FUNCS_store[a] = funcinst) - ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-129.37 + ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-130.37 rule sub{s : store, externaddr : externaddr, xt : externtype, xt' : externtype}: `%|-%:%`(s, externaddr, xt) -- Externaddr_ok: `%|-%:%`(s, externaddr, xt') + -- Externtype_ok: `%|-%:OK`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt) -- Externtype_sub: `%|-%<:%`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt', xt) } diff --git a/spectec/test-latex/TEST.md b/spectec/test-latex/TEST.md index a6ee03c79c..79d2898548 100644 --- a/spectec/test-latex/TEST.md +++ b/spectec/test-latex/TEST.md @@ -9696,6 +9696,8 @@ $$ \frac{ s \vdash {\mathit{externaddr}} : {\mathit{xt}'} \qquad +\{ \} \vdash {\mathit{xt}} : \mathsf{ok} + \qquad \{ \} \vdash {\mathit{xt}'} \leq {\mathit{xt}} }{ s \vdash {\mathit{externaddr}} : {\mathit{xt}} diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index 1b691d2a9c..d7ff003181 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -5973,10 +5973,11 @@ relation Externaddr_ok: `%|-%:%`(store, externaddr, externtype) `%|-%:%`(s, FUNC_externaddr(a), FUNC_externtype((funcinst.TYPE_funcinst : deftype <: typeuse))) -- if (s.FUNCS_store[a] = funcinst) - ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-129.37 + ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-130.37 rule sub{s : store, externaddr : externaddr, xt : externtype, xt' : externtype}: `%|-%:%`(s, externaddr, xt) -- Externaddr_ok: `%|-%:%`(s, externaddr, xt') + -- Externtype_ok: `%|-%:OK`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt) -- Externtype_sub: `%|-%<:%`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt', xt) } @@ -17824,10 +17825,11 @@ relation Externaddr_ok: `%|-%:%`(store, externaddr, externtype) `%|-%:%`(s, FUNC_externaddr(a), FUNC_externtype((funcinst.TYPE_funcinst : deftype <: typeuse))) -- if (s.FUNCS_store[a] = funcinst) - ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-129.37 + ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-130.37 rule sub{s : store, externaddr : externaddr, xt : externtype, xt' : externtype}: `%|-%:%`(s, externaddr, xt) -- Externaddr_ok: `%|-%:%`(s, externaddr, xt') + -- Externtype_ok: `%|-%:OK`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt) -- Externtype_sub: `%|-%<:%`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt', xt) } @@ -29813,10 +29815,11 @@ relation Externaddr_ok: `%|-%:%`(store, externaddr, externtype) -- if (a < |s.FUNCS_store|) -- if (s.FUNCS_store[a] = funcinst) - ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-129.37 + ;; ../../../../specification/wasm-latest/4.1-execution.values.spectec:126.1-130.37 rule sub{s : store, externaddr : externaddr, xt : externtype, xt' : externtype}: `%|-%:%`(s, externaddr, xt) -- Externaddr_ok: `%|-%:%`(s, externaddr, xt') + -- Externtype_ok: `%|-%:OK`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt) -- Externtype_sub: `%|-%<:%`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, xt', xt) } diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index a158820d00..ed099750cc 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -17769,6 +17769,8 @@ The external address :math:`{\mathit{externaddr}}` is :ref:`valid ` w * The external address :math:`{\mathit{externaddr}}` is :ref:`valid ` with the external type :math:`{\mathit{xt}'}`. + * Under the context :math:`\{ \mathsf{return}~\epsilon \}`, the external type :math:`{\mathit{externtype}}` is :ref:`valid `. + * The external type :math:`{\mathit{xt}'}` :ref:`matches ` the external type :math:`{\mathit{externtype}}`. @@ -17829,6 +17831,8 @@ The external address :math:`{\mathit{externaddr}}` is :ref:`valid ` w * The external address :math:`{\mathit{externaddr}}` is :ref:`valid ` with the external type :math:`{\mathit{xt}'}`. + * Under the context :math:`\{ \mathsf{return}~\epsilon \}`, the external type :math:`{\mathit{xt}}` is :ref:`valid `. + * The external type :math:`{\mathit{xt}'}` :ref:`matches ` the external type :math:`{\mathit{xt}}`. @@ -29767,6 +29771,7 @@ Externaddr_ok - s.FUNCS[a] is funcinst. - Or: - externaddr is valid with the external type xt'. + - Under the context { RETURN: ?() }, externtype is valid. - xt' matches externtype. Externaddr_ok/tag @@ -29797,6 +29802,7 @@ Externaddr_ok/func Externaddr_ok/sub - the external address externaddr is valid with the external type xt if: - externaddr is valid with the external type xt'. + - Under the context { RETURN: ?() }, xt is valid. - xt' matches xt. Idctxt_ok