From fbcdf9789dc55fff0846e0fef086c554cf486d63 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Tue, 9 Jul 2024 09:21:45 +0200 Subject: [PATCH] Remove use of comma operator --- document/core/valid/conventions.rst | 11 ----- document/core/valid/instructions.rst | 6 +-- spectec/spec/wasm-1.0/6-typing.watsup | 10 ++--- spectec/spec/wasm-2.0/6-typing.watsup | 10 ++--- spectec/spec/wasm-3.0/6-typing.watsup | 10 ++--- spectec/spec/wasm-3.0/C-conventions.watsup | 2 +- spectec/src/el/ast.ml | 2 +- spectec/test-frontend/TEST.md | 10 ++--- spectec/test-latex/TEST.md | 18 +++++--- spectec/test-middlend/TEST.md | 50 +++++++++++----------- spectec/test-splice/TEST.md | 12 ++++-- 11 files changed, 70 insertions(+), 71 deletions(-) diff --git a/document/core/valid/conventions.rst b/document/core/valid/conventions.rst index b6272b3579..822ede5174 100644 --- a/document/core/valid/conventions.rst +++ b/document/core/valid/conventions.rst @@ -230,17 +230,6 @@ More concretely, contexts are defined as :ref:`records ` ${:C} $${syntax: context} -.. _notation-extend: - -In addition to field access written ${:C.FIELD}, the following notation is adopted for manipulating contexts: - -* ${:C, FIELD A*} denotes the same context as ${:C} but with the elements ${:A*} prepended to its ${:FIELD} component sequence. - -.. note:: - :ref:`Indexing notation ` like ${resulttype: C.LABELS[i]} is used to look up indices in their respective :ref:`index space ` in the context. - Context extension notation ${:C, FIELD A} is primarily used to locally extend *relative* index spaces, such as :ref:`label indices `. - Accordingly, the notation is defined to append at the *front* of the respective sequence, introducing a new relative index ${:0} and shifting the existing ones. - .. index:: ! type closure .. _type-closure: diff --git a/document/core/valid/instructions.rst b/document/core/valid/instructions.rst index 3b0e493c4c..944c5b2007 100644 --- a/document/core/valid/instructions.rst +++ b/document/core/valid/instructions.rst @@ -1394,7 +1394,7 @@ Control Instructions $${rule: Instr_ok/block} .. note:: - The :ref:`notation ` ${context: C, LABELS (t*)} inserts the new label type at index ${:0}, shifting all others. + The :ref:`notation ` ${context: {LABELS (t*)} ++ C} inserts the new label type at index ${:0}, shifting all others. .. _valid-loop: @@ -1414,7 +1414,7 @@ $${rule: Instr_ok/block} $${rule: Instr_ok/loop} .. note:: - The :ref:`notation ` ${context: C, LABELS (t*)} inserts the new label type at index ${:0}, shifting all others. + The :ref:`notation ` ${context: {LABELS (t*)} ++ C} inserts the new label type at index ${:0}, shifting all others. .. _valid-if: @@ -1437,7 +1437,7 @@ $${rule: Instr_ok/loop} $${rule: Instr_ok/if} .. note:: - The :ref:`notation ` ${context: C, LABELS (t*)} inserts the new label type at index ${:0}, shifting all others. + The :ref:`notation ` ${context: {LABELS (t*)} ++ C} inserts the new label type at index ${:0}, shifting all others. .. _valid-br: diff --git a/spectec/spec/wasm-1.0/6-typing.watsup b/spectec/spec/wasm-1.0/6-typing.watsup index 7c5dccfb39..a17d019440 100644 --- a/spectec/spec/wasm-1.0/6-typing.watsup +++ b/spectec/spec/wasm-1.0/6-typing.watsup @@ -162,16 +162,16 @@ rule Instr_ok/select: rule Instr_ok/block: C |- BLOCK t? instr* : eps -> t? - -- Instrs_ok: C, LABELS (t?) |- instr* : eps -> t? + -- Instrs_ok: {LABELS (t?)} ++ C |- instr* : eps -> t? rule Instr_ok/loop: C |- LOOP t? instr* : eps -> t? - -- Instrs_ok: C, LABELS (eps) |- instr* : eps -> eps + -- Instrs_ok: {LABELS (eps)} ++ C |- instr* : eps -> eps rule Instr_ok/if: C |- IF t? instr_1* ELSE instr_2* : I32 -> t? - -- Instrs_ok: C, LABELS (t?) |- instr_1* : eps -> t? - -- Instrs_ok: C, LABELS (t?) |- instr_2* : eps -> t? + -- Instrs_ok: {LABELS (t?)} ++ C |- instr_1* : eps -> t? + -- Instrs_ok: {LABELS (t?)} ++ C |- instr_2* : eps -> t? ;; Branch instructions @@ -333,7 +333,7 @@ rule Type_ok: rule Func_ok: C |- FUNC x (LOCAL t)* expr : t_1* -> t_2? -- if C.TYPES[x] = t_1* -> t_2? - -- Expr_ok: C, LOCALS t_1* t*, LABELS (t_2?), RETURN (t_2?) |- expr : t_2? + -- Expr_ok: C ++ {LOCALS t_1* t*, LABELS (t_2?), RETURN (t_2?)} |- expr : t_2? rule Global_ok: C |- GLOBAL gt expr : gt diff --git a/spectec/spec/wasm-2.0/6-typing.watsup b/spectec/spec/wasm-2.0/6-typing.watsup index e8ca8b766e..d30a280b4f 100644 --- a/spectec/spec/wasm-2.0/6-typing.watsup +++ b/spectec/spec/wasm-2.0/6-typing.watsup @@ -203,18 +203,18 @@ rule Blocktype_ok/typeidx: rule Instr_ok/block: C |- BLOCK bt instr* : t_1* -> t_2* -- Blocktype_ok: C |- bt : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_2*) |- instr* : t_1* -> t_2* + -- Instrs_ok: {LABELS (t_2*)} ++ C |- instr* : t_1* -> t_2* rule Instr_ok/loop: C |- LOOP bt instr* : t_1* -> t_2* -- Blocktype_ok: C |- bt : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_1*) |- instr* : t_1* -> t_2* + -- Instrs_ok: {LABELS (t_1*)} ++ C |- instr* : t_1* -> t_2* rule Instr_ok/if: C |- IF bt instr_1* ELSE instr_2* : t_1* I32 -> t_2* -- Blocktype_ok: C |- bt : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_2*) |- instr_1* : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_2*) |- instr_2* : t_1* -> t_2* + -- Instrs_ok: {LABELS (t_2*)} ++ C |- instr_1* : t_1* -> t_2* + -- Instrs_ok: {LABELS (t_2*)} ++ C |- instr_2* : t_1* -> t_2* ;; Branch instructions @@ -554,7 +554,7 @@ rule Type_ok: rule Func_ok: C |- FUNC x (LOCAL t)* expr : t_1* -> t_2* -- if C.TYPES[x] = t_1* -> t_2* - -- Expr_ok: C, LOCALS t_1* t*, LABELS (t_2*), RETURN (t_2*) |- expr : t_2* + -- Expr_ok: C ++ {LOCALS t_1* t*, LABELS (t_2*), RETURN (t_2*)} |- expr : t_2* rule Global_ok: C |- GLOBAL gt expr : gt diff --git a/spectec/spec/wasm-3.0/6-typing.watsup b/spectec/spec/wasm-3.0/6-typing.watsup index 676a7eedb9..04c8e1febe 100644 --- a/spectec/spec/wasm-3.0/6-typing.watsup +++ b/spectec/spec/wasm-3.0/6-typing.watsup @@ -598,18 +598,18 @@ rule Blocktype_ok/typeidx: rule Instr_ok/block: C |- BLOCK bt instr* : t_1* -> t_2* -- Blocktype_ok: C |- bt : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_2*) |- instr* : t_1* ->_(x*) t_2* + -- Instrs_ok: {LABELS (t_2*)} ++ C |- instr* : t_1* ->_(x*) t_2* rule Instr_ok/loop: C |- LOOP bt instr* : t_1* -> t_2* -- Blocktype_ok: C |- bt : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_1*) |- instr* : t_1* ->_(x*) t_2* + -- Instrs_ok: {LABELS (t_1*)} ++ C |- instr* : t_1* ->_(x*) t_2* rule Instr_ok/if: C |- IF bt instr_1* ELSE instr_2* : t_1* I32 -> t_2* -- Blocktype_ok: C |- bt : t_1* -> t_2* - -- Instrs_ok: C, LABELS (t_2*) |- instr_1* : t_1* ->_(x_1*) t_2* - -- Instrs_ok: C, LABELS (t_2*) |- instr_2* : t_1* ->_(x_2*) t_2* + -- Instrs_ok: {LABELS (t_2*)} ++ C |- instr_1* : t_1* ->_(x_1*) t_2* + -- Instrs_ok: {LABELS (t_2*)} ++ C |- instr_2* : t_1* ->_(x_2*) t_2* ;; Branch instructions @@ -1205,7 +1205,7 @@ rule Func_ok: C |- FUNC x local* expr : C.TYPES[x] -- Expand: C.TYPES[x] ~~ FUNC (t_1* -> t_2*) -- (Local_ok: C |- local : lct)* - -- Expr_ok: C, LOCALS (SET t_1)* lct*, LABELS (t_2*), RETURN (t_2*) |- expr : t_2* + -- Expr_ok: C ++ {LOCALS (SET t_1)* lct*, LABELS (t_2*), RETURN (t_2*)} |- expr : t_2* rule Global_ok: C |- GLOBAL globaltype expr : globaltype diff --git a/spectec/spec/wasm-3.0/C-conventions.watsup b/spectec/spec/wasm-3.0/C-conventions.watsup index 68d93a9d85..6c08111aa3 100644 --- a/spectec/spec/wasm-3.0/C-conventions.watsup +++ b/spectec/spec/wasm-3.0/C-conventions.watsup @@ -47,7 +47,7 @@ rule NotationTypingInstrScheme/global.get: rule NotationTypingInstrScheme/block: C |- BLOCK blocktype instr* : t_1* -> t_2* -- Blocktype_ok: C |- blocktype : t_1* -> t_2* - -- NotationTypingInstrScheme: C, LABELS (t_2*) |- instr* : t_1* -> t_2* + -- NotationTypingInstrScheme: {LABELS (t_2*)} ++ C |- instr* : t_1* -> t_2* ;; Execution notation diff --git a/spectec/src/el/ast.ml b/spectec/src/el/ast.ml index 39a24857fb..3aea0640e2 100644 --- a/spectec/src/el/ast.ml +++ b/spectec/src/el/ast.ml @@ -115,7 +115,7 @@ and exp' = | ExtE of exp * path * exp (* exp `[` path `=..` exp `]` *) | StrE of expfield nl_list (* `{` list(expfield, `,`) `}` *) | DotE of exp * atom (* exp `.` atom *) - | CommaE of exp * exp (* exp `,` exp *) + | CommaE of exp * exp (* exp `,` exp *) (* TODO(3, rossberg): Remove? *) | CatE of exp * exp (* exp `++` exp *) | MemE of exp * exp (* exp `<-` exp *) | LenE of exp (* `|` exp `|` *) diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index e560fe7edc..3c75f9a690 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -4070,19 +4070,19 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) - ;; 6-typing.watsup:598.1-601.63 + ;; 6-typing.watsup:598.1-601.67 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:603.1-606.63 + ;; 6-typing.watsup:603.1-606.67 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_1*{t_1 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:608.1-612.67 + ;; 6-typing.watsup:608.1-612.71 rule if{C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: `%|-%:%`(C, `IF%%ELSE%`_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype} :: [I32_valtype]), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -4754,7 +4754,7 @@ relation Func_ok: `%|-%:%`(context, func, deftype) `%|-%:%`(C, FUNC_func(x, local*{local : local}, expr), C.TYPES_context[x!`%`_idx.0]) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], FUNC_comptype(`%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lct))*{lct : localtype, local : local} - -- Expr_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [], RETURN ?(), REFS []} ++ C, expr, `%`_resulttype(t_2*{t_2 : valtype})) + -- Expr_ok: `%|-%:%`(C ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []}, expr, `%`_resulttype(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -6369,7 +6369,7 @@ relation NotationTypingInstrScheme: `%|-%:%`(context, instr*, functype) `%|-%:%`(C, [GLOBAL.GET_instr(x)], `%->%`_functype(`%`_resulttype([]), `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; C-conventions.watsup:47.1-50.74 + ;; C-conventions.watsup:47.1-50.78 rule block{C : context, blocktype : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, [BLOCK_instr(blocktype, instr*{instr : instr})], `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, blocktype, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) diff --git a/spectec/test-latex/TEST.md b/spectec/test-latex/TEST.md index 724e9685ec..e1b4e6e105 100644 --- a/spectec/test-latex/TEST.md +++ b/spectec/test-latex/TEST.md @@ -5302,7 +5302,8 @@ $$ \frac{ C \vdash {\mathit{bt}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} }{ C \vdash \mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize T{-}block}]} @@ -5315,7 +5316,8 @@ $$ \frac{ C \vdash {\mathit{bt}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_1^\ast}) \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_1^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} }{ C \vdash \mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize T{-}loop}]} @@ -5328,9 +5330,11 @@ $$ \frac{ C \vdash {\mathit{bt}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}_1^\ast} : {t_1^\ast}~{\rightarrow}_{({x_1^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}_1^\ast} : {t_1^\ast}~{\rightarrow}_{({x_1^\ast})}\,{t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}_2^\ast} : {t_1^\ast}~{\rightarrow}_{({x_2^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}_2^\ast} : {t_1^\ast}~{\rightarrow}_{({x_2^\ast})}\,{t_2^\ast} }{ C \vdash \mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~\mathsf{else}~{{\mathit{instr}}_2^\ast} : {t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize T{-}if}]} @@ -6798,7 +6802,8 @@ C{.}\mathsf{types}{}[x] \approx \mathsf{func}~({t_1^\ast} \rightarrow {t_2^\ast} \qquad (C \vdash {\mathit{local}} : {{\mathit{lt}}})^\ast \qquad -C, \mathsf{locals}~{(\mathsf{set}~t_1)^\ast}~{{{\mathit{lt}}}^\ast}, \mathsf{labels}~({t_2^\ast}), \mathsf{return}~({t_2^\ast}) \vdash {\mathit{expr}} : {t_2^\ast} +C \oplus \{ \begin{array}[t]{@{}l@{}} +\mathsf{locals}~{(\mathsf{set}~t_1)^\ast}~{{{\mathit{lt}}}^\ast},\; \mathsf{labels}~({t_2^\ast}),\; \mathsf{return}~({t_2^\ast}) \}\end{array} \vdash {\mathit{expr}} : {t_2^\ast} }{ C \vdash \mathsf{func}~x~{{\mathit{local}}^\ast}~{\mathit{expr}} : C{.}\mathsf{types}{}[x] } \, {[\textsc{\scriptsize T{-}func}]} @@ -9705,7 +9710,8 @@ $$ \frac{ C \vdash {\mathit{blocktype}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} }{ C \vdash \mathsf{block}~{\mathit{blocktype}}~{{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize NotationTypingInstrScheme{-}block}]} diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index 9914fb807c..b1c6e7afa5 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -4060,19 +4060,19 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) - ;; 6-typing.watsup:598.1-601.63 + ;; 6-typing.watsup:598.1-601.67 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:603.1-606.63 + ;; 6-typing.watsup:603.1-606.67 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_1*{t_1 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:608.1-612.67 + ;; 6-typing.watsup:608.1-612.71 rule if{C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: `%|-%:%`(C, `IF%%ELSE%`_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype} :: [I32_valtype]), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -4744,7 +4744,7 @@ relation Func_ok: `%|-%:%`(context, func, deftype) `%|-%:%`(C, FUNC_func(x, local*{local : local}, expr), C.TYPES_context[x!`%`_idx.0]) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], FUNC_comptype(`%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lct))*{lct : localtype, local : local} - -- Expr_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [], RETURN ?(), REFS []} ++ C, expr, `%`_resulttype(t_2*{t_2 : valtype})) + -- Expr_ok: `%|-%:%`(C ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []}, expr, `%`_resulttype(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -6359,7 +6359,7 @@ relation NotationTypingInstrScheme: `%|-%:%`(context, instr*, functype) `%|-%:%`(C, [GLOBAL.GET_instr(x)], `%->%`_functype(`%`_resulttype([]), `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; C-conventions.watsup:47.1-50.74 + ;; C-conventions.watsup:47.1-50.78 rule block{C : context, blocktype : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, [BLOCK_instr(blocktype, instr*{instr : instr})], `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, blocktype, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -10473,19 +10473,19 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) - ;; 6-typing.watsup:598.1-601.63 + ;; 6-typing.watsup:598.1-601.67 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:603.1-606.63 + ;; 6-typing.watsup:603.1-606.67 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_1*{t_1 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:608.1-612.67 + ;; 6-typing.watsup:608.1-612.71 rule if{C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: `%|-%:%`(C, `IF%%ELSE%`_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype} :: [I32_valtype]), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -11157,7 +11157,7 @@ relation Func_ok: `%|-%:%`(context, func, deftype) `%|-%:%`(C, FUNC_func(x, local*{local : local}, expr), C.TYPES_context[x!`%`_idx.0]) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], FUNC_comptype(`%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lct))*{lct : localtype, local : local} - -- Expr_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [], RETURN ?(), REFS []} ++ C, expr, `%`_resulttype(t_2*{t_2 : valtype})) + -- Expr_ok: `%|-%:%`(C ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []}, expr, `%`_resulttype(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -12772,7 +12772,7 @@ relation NotationTypingInstrScheme: `%|-%:%`(context, instr*, functype) `%|-%:%`(C, [GLOBAL.GET_instr(x)], `%->%`_functype(`%`_resulttype([]), `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; C-conventions.watsup:47.1-50.74 + ;; C-conventions.watsup:47.1-50.78 rule block{C : context, blocktype : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, [BLOCK_instr(blocktype, instr*{instr : instr})], `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, blocktype, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -16886,19 +16886,19 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) - ;; 6-typing.watsup:598.1-601.63 + ;; 6-typing.watsup:598.1-601.67 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:603.1-606.63 + ;; 6-typing.watsup:603.1-606.67 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_1*{t_1 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:608.1-612.67 + ;; 6-typing.watsup:608.1-612.71 rule if{C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: `%|-%:%`(C, `IF%%ELSE%`_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype} :: [I32_valtype]), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -17570,7 +17570,7 @@ relation Func_ok: `%|-%:%`(context, func, deftype) `%|-%:%`(C, FUNC_func(x, local*{local : local}, expr), C.TYPES_context[x!`%`_idx.0]) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], FUNC_comptype(`%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lct))*{lct : localtype, local : local} - -- Expr_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [], RETURN ?(), REFS []} ++ C, expr, `%`_resulttype(t_2*{t_2 : valtype})) + -- Expr_ok: `%|-%:%`(C ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []}, expr, `%`_resulttype(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -19185,7 +19185,7 @@ relation NotationTypingInstrScheme: `%|-%:%`(context, instr*, functype) `%|-%:%`(C, [GLOBAL.GET_instr(x)], `%->%`_functype(`%`_resulttype([]), `%`_resulttype([t]))) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; C-conventions.watsup:47.1-50.74 + ;; C-conventions.watsup:47.1-50.78 rule block{C : context, blocktype : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, [BLOCK_instr(blocktype, instr*{instr : instr})], `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, blocktype, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -23318,19 +23318,19 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Valtype_sub: `%|-%<:%`(C, t, t') -- if ((t' = (numtype : numtype <: valtype)) \/ (t' = (vectype : vectype <: valtype))) - ;; 6-typing.watsup:598.1-601.63 + ;; 6-typing.watsup:598.1-601.67 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:603.1-606.63 + ;; 6-typing.watsup:603.1-606.67 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_1*{t_1 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:608.1-612.67 + ;; 6-typing.watsup:608.1-612.71 rule if{C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: `%|-%:%`(C, `IF%%ELSE%`_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype} :: [I32_valtype]), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -24085,7 +24085,7 @@ relation Func_ok: `%|-%:%`(context, func, deftype) -- if (|lct*{lct : localtype}| = |local*{local : local}|) -- Expand: `%~~%`(C.TYPES_context[x!`%`_idx.0], FUNC_comptype(`%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype})))) -- (Local_ok: `%|-%:%`(C, local, lct))*{lct : localtype, local : local} - -- Expr_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [], RETURN ?(), REFS []} ++ C, expr, `%`_resulttype(t_2*{t_2 : valtype})) + -- Expr_ok: `%|-%:%`(C ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []}, expr, `%`_resulttype(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -25761,7 +25761,7 @@ relation NotationTypingInstrScheme: `%|-%:%`(context, instr*, functype) -- if (x!`%`_idx.0 < |C.GLOBALS_context|) -- if (C.GLOBALS_context[x!`%`_idx.0] = `%%`_globaltype(mut, t)) - ;; C-conventions.watsup:47.1-50.74 + ;; C-conventions.watsup:47.1-50.78 rule block{C : context, blocktype : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, [BLOCK_instr(blocktype, instr*{instr : instr})], `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, blocktype, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) @@ -29908,19 +29908,19 @@ relation Instr_ok: `%|-%:%`(context, instr, instrtype) -- Valtype_sub: `%|-%<:%`(C, t, t') -- where (vectype : vectype <: valtype) = t' - ;; 6-typing.watsup:598.1-601.63 + ;; 6-typing.watsup:598.1-601.67 rule block{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, BLOCK_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:603.1-606.63 + ;; 6-typing.watsup:603.1-606.67 rule loop{C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: `%|-%:%`(C, LOOP_instr(bt, instr*{instr : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_1*{t_1 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x*{x : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) -- Blocktype_ok: `%|-%:%`(C, bt, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), [], `%`_resulttype(t_2*{t_2 : valtype}))) - ;; 6-typing.watsup:608.1-612.67 + ;; 6-typing.watsup:608.1-612.71 rule if{C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: `%|-%:%`(C, `IF%%ELSE%`_instr(bt, instr_1*{instr_1 : instr}, instr_2*{instr_2 : instr}), `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype} :: [I32_valtype]), [], `%`_resulttype(t_2*{t_2 : valtype}))) -- Instrs_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr_1*{instr_1 : instr}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 : valtype}), x_1*{x_1 : localidx}, `%`_resulttype(t_2*{t_2 : valtype}))) @@ -30693,7 +30693,7 @@ relation Func_ok: `%|-%:%`(context, func, deftype) -- (Local_ok: `%|-%:%`(C, local, lct))*{lct : localtype, local : local} -- where FUNC_comptype(`%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) = $expanddt(C.TYPES_context[x!`%`_idx.0]) -- if (|lct*{lct : localtype}| = |local*{local : local}|) - -- Expr_ok: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [], RETURN ?(), REFS []} ++ C, expr, `%`_resulttype(t_2*{t_2 : valtype})) + -- Expr_ok: `%|-%:%`(C ++ {TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS `%%`_localtype(SET_init, t_1)*{t_1 : valtype} :: lct*{lct : localtype}, LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(`%`_resulttype(t_2*{t_2 : valtype})), REFS []}, expr, `%`_resulttype(t_2*{t_2 : valtype})) ;; 6-typing.watsup relation Global_ok: `%|-%:%`(context, global, globaltype) @@ -32398,7 +32398,7 @@ relation NotationTypingInstrScheme: `%|-%:%`(context, instr*, functype) -- if (x!`%`_idx.0 < |C.GLOBALS_context|) -- where `%%`_globaltype(mut, t) = C.GLOBALS_context[x!`%`_idx.0] - ;; C-conventions.watsup:47.1-50.74 + ;; C-conventions.watsup:47.1-50.78 rule block{C : context, blocktype : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*}: `%|-%:%`(C, [BLOCK_instr(blocktype, instr*{instr : instr})], `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) -- NotationTypingInstrScheme: `%|-%:%`({TYPES [], RECS [], FUNCS [], GLOBALS [], TABLES [], MEMS [], ELEMS [], DATAS [], LOCALS [], LABELS [`%`_resulttype(t_2*{t_2 : valtype})], RETURN ?(), REFS []} ++ C, instr*{instr : instr}, `%->%`_functype(`%`_resulttype(t_1*{t_1 : valtype}), `%`_resulttype(t_2*{t_2 : valtype}))) diff --git a/spectec/test-splice/TEST.md b/spectec/test-splice/TEST.md index dc536b3ad3..96cc2dbd2c 100644 --- a/spectec/test-splice/TEST.md +++ b/spectec/test-splice/TEST.md @@ -207,7 +207,8 @@ $$ \frac{ C \vdash {\mathit{bt}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} }{ C \vdash \mathsf{block}~{\mathit{bt}}~{{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize T{-}block}]} @@ -220,7 +221,8 @@ $$ \frac{ C \vdash {\mathit{bt}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_1^\ast}) \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_1^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}^\ast} : {t_1^\ast}~{\rightarrow}_{({x^\ast})}\,{t_2^\ast} }{ C \vdash \mathsf{loop}~{\mathit{bt}}~{{\mathit{instr}}^\ast} : {t_1^\ast} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize T{-}loop}]} @@ -233,9 +235,11 @@ $$ \frac{ C \vdash {\mathit{bt}} : {t_1^\ast} \rightarrow {t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}_1^\ast} : {t_1^\ast}~{\rightarrow}_{({x_1^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}_1^\ast} : {t_1^\ast}~{\rightarrow}_{({x_1^\ast})}\,{t_2^\ast} \qquad -C, \mathsf{labels}~({t_2^\ast}) \vdash {{\mathit{instr}}_2^\ast} : {t_1^\ast}~{\rightarrow}_{({x_2^\ast})}\,{t_2^\ast} +\{ \begin{array}[t]{@{}l@{}} +\mathsf{labels}~({t_2^\ast}) \}\end{array} \oplus C \vdash {{\mathit{instr}}_2^\ast} : {t_1^\ast}~{\rightarrow}_{({x_2^\ast})}\,{t_2^\ast} }{ C \vdash \mathsf{if}~{\mathit{bt}}~{{\mathit{instr}}_1^\ast}~\mathsf{else}~{{\mathit{instr}}_2^\ast} : {t_1^\ast}~\mathsf{i{\scriptstyle 32}} \rightarrow {t_2^\ast} } \, {[\textsc{\scriptsize T{-}if}]}